telemetry

package
v0.0.0-...-e18c8c3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFailedSetup    = errors.New("failed to setup telemetry")
	ErrFailedExporter = errors.New("failed to setup exporter")
)

Functions

func SetupOTelMetrics

func SetupOTelMetrics(exporters ...func() (metric.Reader, error)) error

SetupOTelMetrics sets up the OpenTelemetry metrics provider with the Prometheus exporter. This allows using the in-process OpenTelemetry APIs, but exports them in a way that is easy to hook up to graph visualization software.

The objects it bootstraps are global, largely for convenience.

See: 1. https://github.com/open-telemetry/opentelemetry-go/blob/main/example/prometheus/main.go

func WithPrometheusHTTP

func WithPrometheusHTTP(listenOn string) func() (metric.Reader, error)

WithPrometheusHTTP sets up the promethus exporter, as well as starts a HTTP instance on the specified address / port with the "/metrics" endpoint exposed.

Types

type WithReader

type WithReader func() (metric.Reader, error)

WithReader allows supplying different metric "readers" to the OpenTelemetry infrastructure. Readers allow exporting the data to different "sinks".

Jump to

Keyboard shortcuts

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