telemetry

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Namespace = "agent_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