observability

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package observability provides OpenTelemetry setup for the OpenBotStack runtime.

It initializes tracing and metrics providers. The Prometheus metrics exporter is always enabled for the /metrics endpoint. Tracing is only enabled when otel_enabled is set to true in configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMetrics

func InitMetrics() error

InitMetrics creates OTel metric instruments. Must be called after Setup().

func MetricsMiddleware

func MetricsMiddleware(next http.Handler) http.Handler

MetricsMiddleware records HTTP request metrics for all requests.

func PrometheusHandler

func PrometheusHandler() http.Handler

PrometheusHandler returns an http.Handler that serves Prometheus-format metrics.

func Setup

func Setup(ctx context.Context, cfg config.ObservabilityConfig, version string) (func(), error)

Setup initializes OpenTelemetry tracing and metrics. When otelEnabled is false, only the Prometheus metrics exporter is set up (tracing is a no-op). Returns a cleanup function for graceful shutdown.

Types

This section is empty.

Jump to

Keyboard shortcuts

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