opentelemetry

package
v0.0.56 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

README

api/sinks/opentelemetry

OpenTelemetry sink for shipping score check results to an OTLP-compatible backend. Each completed score is emitted as an OTLP log record and delivered over HTTP to the configured endpoint.

Score records carry the check timestamp, the check's captured stdout as the log body, and structured attributes for team number, box name, service name, boolean pass/fail status, and the check's captured stderr. Keeping stderr as its own attribute rather than folding it into the body lets a backend filter or suppress check noise without losing the primary output. Severity is Info on every record; pass and fail are distinguished by the status attribute rather than by log level. Records are batched by a background processor and flushed on a configurable interval rather than one request per score. The batch size, flush interval, and queue depth all have sensible defaults (20 records, 5 seconds, 200 record queue) and can be overridden in config.

Authentication is supported via HTTP Basic auth, supplied either as a pre-encoded base64 credential string or as a username and password pair. TLS is controlled by the URL scheme: http endpoints disable TLS, https endpoints use it. A custom stream-name header is supported for backends like OpenObserve that use it for routing. Export errors from the background batch processor are routed through the application's structured logger rather than being silently dropped to stderr.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddScore

func AddScore(ctx context.Context, score types.Score) error

AddScore emits a log record for a completed score check.

func Init

func Init(ctx context.Context, cfg config.OTelConfig) (func(), error)

Init sets up the OTLP HTTP log exporter. Scheme determines TLS: http → insecure, https → TLS. Set Username or BasicAuth to enable HTTP Basic auth.

Types

This section is empty.

Jump to

Keyboard shortcuts

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