Documentation ¶
Index ¶
Constants ¶
const Subsystem = "MNTR"
Subsystem defines the sub system name of this package.
Variables ¶
This section is empty.
Functions ¶
func GetPromInterceptors ¶
func GetPromInterceptors(_ *PrometheusConfig) ([]grpc.UnaryServerInterceptor, []grpc.StreamServerInterceptor)
GetPromInterceptors returns the set of interceptors for Prometheus monitoring if monitoring is enabled, else empty slices. Monitoring is currently disabled.
Types ¶
type PrometheusConfig ¶
type PrometheusConfig struct { // Active, if true, then Prometheus metrics will be exported. Active bool `long:"active" description:"if true prometheus metrics will be exported"` // ListenAddr is the listening address that we should use to allow the // main Prometheus server to scrape our metrics. ListenAddr string `long:"listenaddr" description:"the interface we should listen on for prometheus"` // RPCServer is a pointer to the main RPC server. We use this to export // generic RPC metrics to monitor the health of the service. RPCServer *grpc.Server // UniverseStats is used to collect any stats that are relevant to the // universe. UniverseStats universe.Telemetry // AssetStore is used to collect any stats that are relevant to the // asset store. AssetStore *tapdb.AssetStore // AssetMinter is used to collect any stats that are relevant to the // asset minter. AssetMinter tapgarden.Planter // PerfHistograms indicates if the additional histogram information for // latency, and handling time of gRPC calls should be enabled. This // generates additional data, and consume more memory for the // Prometheus server. PerfHistograms bool `long:"perfhistograms" description:"enable additional histogram to track gRPC call processing performance (latency, etc)"` }
PrometheusConfig is the set of configuration data that specifies if Prometheus metric exporting is activated, and if so the listening address of the Prometheus server.
func DefaultPrometheusConfig ¶
func DefaultPrometheusConfig() PrometheusConfig
DefaultPrometheusConfig is the default configuration for the Prometheus metrics exporter.
type PrometheusExporter ¶
type PrometheusExporter struct {
// contains filtered or unexported fields
}
PrometheusExporter is a metric exporter that uses Prometheus directly. The internal server will interact with this struct in order to export relevant metrics.
func NewPrometheusExporter ¶
func NewPrometheusExporter(cfg *PrometheusConfig) (*PrometheusExporter, error)
NewPrometheusExporter makes a new instance of the PrometheusExporter given the config.
func (*PrometheusExporter) Start ¶
func (p *PrometheusExporter) Start() error
Start registers all relevant metrics with the Prometheus library, then launches the HTTP server that Prometheus will hit to scrape our metrics.