Documentation
¶
Index ¶
Constants ¶
View Source
const (
Namespace = "mcp_registry"
)
Variables ¶
This section is empty.
Functions ¶
func InitMetrics ¶
func InitMetrics(version string) (ShutdownFunc, *Metrics, error)
func NewPrometheusMeterProvider ¶
func NewPrometheusMeterProvider(res *resource.Resource, exp *prometheus.Exporter) (*sdkmetric.MeterProvider, error)
Types ¶
type Metrics ¶
type Metrics struct {
// Requests tracks the number of HTTP requests
Requests metric.Int64Counter
// RequestDuration tracks the duration of HTTP Requests
RequestDuration metric.Float64Histogram
// ErrorCount tracks the number of errors
ErrorCount metric.Int64Counter
// Up tracks the health of the service
Up metric.Int64Gauge
}
func (*Metrics) PrometheusHandler ¶
PrometheusHandler returns the HTTP handler for Prometheus metrics This handler serves the metrics endpoint for Prometheus to scrape.
type ShutdownFunc ¶
ShutdownFunc is a delegate that shuts down the OpenTelemetry components.
Click to show internal directories.
Click to hide internal directories.