telemetry

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package telemetry initializes OpenTelemetry for the agent loop.

Telemetry is off by default — no exporter is configured — so a fresh invocation makes zero outbound network calls. Consumers opt in by setting one of:

  • "console" — writes spans to stderr; useful for local debug
  • "otlp" — honors standard OTEL env vars (OTEL_EXPORTER_OTLP_ENDPOINT, etc.) to ship to a collector
  • "none" — the default; no spans leave

ADK's telemetry.New constructs providers but does NOT install them as OTEL globals; you must call SetGlobalOtelProviders explicitly or ADK's instrumentation will run against the noop tracer. This package handles that.

Index

Constants

View Source
const (
	ModeNone    = "none"    // default; no spans exported
	ModeConsole = "console" // stdout exporter; for local dev
	ModeOTLP    = "otlp"    // honors OTEL_EXPORTER_OTLP_ENDPOINT etc.
)

Mode names recognized by Setup.

Variables

This section is empty.

Functions

func Setup

func Setup(ctx context.Context, mode string) (shutdown func(context.Context) error, err error)

Setup configures OpenTelemetry. Returns a shutdown function the caller MUST call (typically deferred) so buffered spans get flushed.

When mode is "" or "none", no providers are constructed and the shutdown returns nil — call sites stay clean either way.

Types

This section is empty.

Jump to

Keyboard shortcuts

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