telemetry

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: MIT Imports: 12 Imported by: 0

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 NewMetrics

func NewMetrics(meter metric.Meter) (*Metrics, error)

func (*Metrics) PrometheusHandler

func (m *Metrics) PrometheusHandler() http.Handler

PrometheusHandler returns the HTTP handler for Prometheus metrics This handler serves the metrics endpoint for Prometheus to scrape.

type ShutdownFunc

type ShutdownFunc func(ctx context.Context) error

ShutdownFunc is a delegate that shuts down the OpenTelemetry components.

Jump to

Keyboard shortcuts

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