OpenTelemetry — Set
OTEL_EXPORTER_OTLP_ENDPOINT and telemetry is on. Leave unset for zero overhead.Environment Variables
| Variable | Description | Default |
|---|---|---|
OTEL_EXPORTER_OTLP_ENDPOINT | OTLP/HTTP collector URL (e.g. http://localhost:4318). When set, telemetry is auto-enabled. | unset = off |
GITAGENT_OTEL_ENABLED | Set to false to force-disable telemetry even when endpoint is set. | auto |
OTEL_SERVICE_NAME | service.name resource attribute. | gitagent |
OTEL_SERVICE_VERSION | service.version resource attribute. | unset |
OTEL_EXPORTER_OTLP_HEADERS | Comma-separated key=value pairs, no quotes (e.g. Authorization=Bearer xyz,x-tenant=abc). | unset |
OTEL_TRACES_EXPORTER | Set to console to print spans to stdout — no collector needed. | unset |
Spans Emitted
| Span | Kind | Attributes |
|---|---|---|
gitagent.agent.session | INTERNAL | gitagent.entry, gitagent.cost_usd, gitagent.session.duration_ms |
gitagent.tool.execute | INTERNAL | tool.name, tool.call_id, tool.status, tool.error_message |
gen_ai.chat | CLIENT | gen_ai.system, gen_ai.request.model, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens, gitagent.cost_usd |
HTTP … | CLIENT | URL, status code, duration (auto via instrumentation-undici) |
Metrics Emitted
| Metric | Type | Description |
|---|---|---|
gitagent.tool.calls | counter | Tool executions, labelled by tool.name |
gitagent.tool.duration_ms | histogram | Tool execution duration |
gitagent.session.duration_ms | histogram | Session duration |
gitagent.session.cost_usd | counter | Cumulative session cost in USD |
gen_ai.client.token.usage | counter | Token usage by model and token type |
gen_ai.client.operation.duration | histogram | LLM call duration |
Jaeger Quickstart
Console Output (No Collector)
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