Skip to main content
OpenTelemetry — Set OTEL_EXPORTER_OTLP_ENDPOINT and telemetry is on. Leave unset for zero overhead.

Environment Variables

VariableDescriptionDefault
OTEL_EXPORTER_OTLP_ENDPOINTOTLP/HTTP collector URL (e.g. http://localhost:4318). When set, telemetry is auto-enabled.unset = off
GITAGENT_OTEL_ENABLEDSet to false to force-disable telemetry even when endpoint is set.auto
OTEL_SERVICE_NAMEservice.name resource attribute.gitagent
OTEL_SERVICE_VERSIONservice.version resource attribute.unset
OTEL_EXPORTER_OTLP_HEADERSComma-separated key=value pairs, no quotes (e.g. Authorization=Bearer xyz,x-tenant=abc).unset
OTEL_TRACES_EXPORTERSet to console to print spans to stdout — no collector needed.unset

Spans Emitted

SpanKindAttributes
gitagent.agent.sessionINTERNALgitagent.entry, gitagent.cost_usd, gitagent.session.duration_ms
gitagent.tool.executeINTERNALtool.name, tool.call_id, tool.status, tool.error_message
gen_ai.chatCLIENTgen_ai.system, gen_ai.request.model, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens, gitagent.cost_usd
HTTP …CLIENTURL, status code, duration (auto via instrumentation-undici)

Metrics Emitted

MetricTypeDescription
gitagent.tool.callscounterTool executions, labelled by tool.name
gitagent.tool.duration_mshistogramTool execution duration
gitagent.session.duration_mshistogramSession duration
gitagent.session.cost_usdcounterCumulative session cost in USD
gen_ai.client.token.usagecounterToken usage by model and token type
gen_ai.client.operation.durationhistogramLLM call duration

Jaeger Quickstart

docker run -d --name jaeger \
  -p 16686:16686 -p 4318:4318 \
  jaegertracing/all-in-one:latest

OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 gitagent
# Open http://localhost:16686

Console Output (No Collector)

OTEL_TRACES_EXPORTER=console gitagent --voice --dir ~/assistant
OTEL_TRACES_EXPORTER=console is useful for local debugging only — it prints every span to stdout and will flood your terminal in long-running sessions.

SDK Reference

Full API reference for query(), tool(), buildTool(), and hooks

Utilities

Cost tracking helpers that back the gitagent.session.cost_usd metric

Environment Variables

Full list of environment variables GitAgent reads

Compliance & Audit

Pair telemetry with the git-native audit trail for full observability