metrics

package
v0.9.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package metrics contains the HTTP server for exposing Prometheus metrics.

Index

Constants

View Source
const DefaultListenAddress = "[::]:8080"

DefaultListenAddress is the default listen address for the node Metrics.

View Source
const DefaultPath = "/metrics"

DefaultPath is the default path for the node Metrics.

Variables

This section is empty.

Functions

func AppendMetricsMiddlewares

AppendMetricsMiddlewares appends the Prometheus metrics middlewares to the gRPC server interceptors.

Types

type Options

type Options struct {
	// ListenAddress is the address to start the metrics server on.
	ListenAddress string
	// Path is the path to expose metrics on.
	Path string
}

Options contains the configuration for exposing node metrics.

type Server

type Server struct {
	Options
	// contains filtered or unexported fields
}

Server is the metrics server.

func New

func New(ctx context.Context, o Options) *Server

New returns a new metrics server.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe starts the server and blocks until the server exits.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown attempts to stop the server gracefully.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL