telemetry

package
v0.0.0-...-c46dd35 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package telemetry is the instrumentation-only OpenTelemetry API surface shared across Aether: attribute keys, span helpers, and gRPC stats handlers. Everything here is a no-op until a binary main installs real providers via common/telemetry/setup (or the CNI plugin's cni/internal/telemetry).

This package must stay free of the OTel SDK, exporters, and Prometheus so that short-lived binaries (the CNI plugin) can instrument without linking provider/exporter machinery.

Index

Constants

View Source
const (
	// AttrPodName is the Kubernetes pod name.
	AttrPodName = attribute.Key("aether.pod.name")
	// AttrPodNamespace is the Kubernetes namespace of the pod.
	AttrPodNamespace = attribute.Key("aether.pod.namespace")
	// AttrContainerID is the pod sandbox container ID from the CNI invocation.
	AttrContainerID = attribute.Key("aether.container.id")
	// AttrSnapshotVersion is the xDS or registrar snapshot version.
	AttrSnapshotVersion = attribute.Key("aether.snapshot.version")
)

Shared OTel attribute keys, so the same pod/service identity attributes are queryable across spans emitted by the CNI plugin, agent, and registrar.

Variables

This section is empty.

Functions

func ClientStatsHandler

func ClientStatsHandler() stats.Handler

ClientStatsHandler returns the client-side counterpart of ServerStatsHandler. Installing it on a gRPC connection propagates trace context to the server, linking client and server spans across processes.

func EndSpan

func EndSpan(span trace.Span, err error)

EndSpan records the operation outcome on the span and ends it. Designed for use in a defer alongside a named error return:

ctx, span := otel.Tracer(name).Start(ctx, "op")
defer func() { telemetry.EndSpan(span, retErr) }()

func ServerStatsHandler

func ServerStatsHandler() stats.Handler

ServerStatsHandler returns a gRPC server stats handler that records OTel spans and RPC metrics through the global providers. It is a no-op until setup.Setup/setup.SetupTracing (common/telemetry/setup) register real providers, so it is safe (and intended) to install unconditionally on every gRPC server.

Types

This section is empty.

Directories

Path Synopsis
Package setup wires OpenTelemetry providers for long-running binaries: an SDK MeterProvider bridged into controller-runtime's Prometheus registry, a TracerProvider, and a LoggerProvider, each with optional OTLP gRPC export.
Package setup wires OpenTelemetry providers for long-running binaries: an SDK MeterProvider bridged into controller-runtime's Prometheus registry, a TracerProvider, and a LoggerProvider, each with optional OTLP gRPC export.

Jump to

Keyboard shortcuts

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