Skip to main content
Observability records HTTP requests, Runner invocations, model calls, tool calls, errors, latency, and token usage during an agent run. VeADK Go provides observability.NewPlugin(), observability.ADKTelemetryOptions(), HTTP middleware, exporter configuration, and bounded shutdown on top of OpenTelemetry.

When to Use

  • Debug latency or errors across model, tool, knowledge-base, and memory paths.
  • Export agent traces to APMPlus, Cozeloop, TLS, an OTLP Collector, stdout, or a file.
  • Keep AgentKit Server App, Simple App, and custom ADK launcher spans in one trace pipeline.
  • Flush queued spans and metrics before process shutdown.

Enable It in Runner or Launcher Code

If you use ADK launcher directly or assemble runner.PluginConfig yourself, register the VeADK Go observability plugin and bind ADK telemetry to the same OpenTelemetry provider.
observability.NewPlugin() initializes exporters from the global config or environment variables. If no exporter is configured, it returns a no-op plugin and agent calls can still proceed.

Enable It in App Servers

When you start Simple App, A2A App, or AgentKit Server App through apps.Run, RunConfig adds the observability plugin and ADK telemetry options by default. Set DisableObservability: true only when you manage the provider and plugin lifecycle yourself.
App servers also install observability.HTTPMiddleware around the HTTP API handler so HTTP requests and downstream ADK spans can share one trace path.

Configure Exporters

VeADK Go supports environment variables and config.yaml. Environment variables are usually better for containers, CI, and AgentKit Runtime. config.yaml works well for local development or fixed deployment packages.

stdout

stdout is useful for local span-shape checks and does not require any external service.

File

File export is useful for local debugging or offline inspection.

OTLP

Standard OTLP works with OpenTelemetry Collector. OTEL_TRACES_EXPORTER=otlp enables the standard OTLP trace exporter. HTTP protobuf defaults to http://localhost:4318/v1/traces; gRPC defaults to http://localhost:4317.
Use trace-specific variables when you need to pass a complete trace URL:

APMPlus

APMPlus requires an endpoint, API key, and service name. When an APMPlus API key is configured, VeADK Go enables GenAI metrics and APMPlus custom metrics.

Cozeloop

Cozeloop uses its own endpoint, API key, and service name.

TLS

TLS export requires an endpoint, region, topic ID, and AK/SK. Inject AK/SK through environment variables or platform secrets.

config.yaml Example

Environment variables override matching config values. A running provider is not reconfigured when environment variables change, so set the full configuration before service startup.

Configuration Reference

What Gets Collected

Before collecting prompts, tool input, tool output, or model responses, confirm whether they can contain user data, file contents, credentials, or other sensitive information. In production, define masking and retention policies before exporting data to an external observability platform.

Lifecycle

observability.Init initializes once. The first NewPlugin call triggers initialization. Before process exit, call observability.Shutdown(ctx) or rely on the default apps.Run shutdown path. Shutdown and ForceFlush respect the caller deadline and an internal five-second upper bound; spans still queued after the deadline may be lost.

Troubleshooting

Last modified on October 20, 2026