OpenTelemetry
Built-in OpenTelemetry instrumentation for loop runs, tasks, and agent commands. Configure an OTLP endpoint and traces flow automatically.
loop-task includes built-in OpenTelemetry support that automatically instruments loop runs, tasks, and commands. When enabled, it can also configure supported coding agents (OpenCode, Claude Code) to route their telemetry through the same OTLP destination.
Enabled by default, no endpoint contacted
Telemetry instrumentation is active on new installations, but no data is sent anywhere until you explicitly configure an OTLP endpoint. No connection errors appear when no endpoint is set.
Quick Start
-
Configure an OTLP endpoint:
loop-task telemetry endpoint http://127.0.0.1:4318 -
Run your loops normally. Telemetry is emitted automatically.
-
View the status:
loop-task telemetry status
Commands
View status
loop-task telemetry
loop-task telemetry statusOutput:
OpenTelemetry
Enabled: yes
Endpoint: http://127.0.0.1:4318
Protocol: http/protobuf
Service: loop-task
Auto-instrument agents: yes
Capture content: no
Headers: not configuredEnable or disable
loop-task telemetry on
loop-task telemetry offConfigure endpoint
loop-task telemetry endpoint http://127.0.0.1:4318Configure protocol
loop-task telemetry protocol grpc
loop-task telemetry protocol http/protobufTest connection
loop-task telemetry testCommand Palette (Ctrl+P)
Inside the TUI board, press Ctrl+P to access:
- OpenTelemetry status and connection info — shows enabled state, export status, endpoint, protocol, and privacy settings
- Enable or disable OpenTelemetry — toggles telemetry at runtime without restarting
- Test OpenTelemetry connection — sends a diagnostic span to verify the endpoint is reachable
Default Behavior
Telemetry is enabled by default but no endpoint is contacted until one is configured. This means:
- New installations start with telemetry instrumentation active
- No data is sent anywhere until you explicitly configure an OTLP endpoint
- No connection errors appear when no endpoint is set
- The status command reports "enabled" with "not configured" export state
Privacy
Content capture is disabled by default. The following are never exported unless you explicitly enable content capture:
- Prompt content
- Model response content
- Source code
- Full stdout/stderr
- Environment variable values
- Tool arguments containing arbitrary content
- API keys, tokens, and authentication headers
Command arguments are sanitized: only the executable name and argument count are recorded, not the full arguments (which may contain prompts).
Agent Auto-Instrumentation
When a task executes a supported coding agent, loop-task automatically configures that agent's native OpenTelemetry support to route telemetry to the same OTLP endpoint.
Supported Agents
| Agent | Detection | Auto-Configuration |
|---|---|---|
| OpenCode | opencode run ... | Enables experimental OpenTelemetry, sets OTEL_* environment variables |
| Claude Code | claude -p ... or claude --print ... | Enables telemetry, sets OTEL_* environment variables |
You do not need to configure OpenCode or Claude Code telemetry separately. loop-task handles it automatically.
Disabling Auto-Instrumentation
To disable agent auto-instrumentation while keeping loop-task's own telemetry:
# Not yet available via CLI — use settings directlyEnvironment Variables
loop-task respects the standard OpenTelemetry environment variables:
OTEL_EXPORTER_OTLP_ENDPOINT— fallback endpoint if not configured in settingsOTEL_EXPORTER_OTLP_PROTOCOL— fallback protocol (grpc or http/protobuf)OTEL_EXPORTER_OTLP_HEADERS— authentication headers for the OTLP endpointOTEL_RESOURCE_ATTRIBUTES— additional resource attributes (merged with loop-task correlation attributes)
The precedence order is:
- Explicit loop-task CLI settings
- Daemon telemetry settings (configured via
loop-task telemetry endpoint) - Standard
OTEL_*environment variables - No exporter configured
Local Collector Example
Here's a minimal OpenTelemetry Collector configuration for local development:
# otel-collector-config.yaml
receivers:
otlp:
protocols:
grpc:
http:
exporters:
debug:
verbosity: detailed
service:
pipelines:
traces:
receivers: [otlp]
exporters: [debug]
metrics:
receivers: [otlp]
exporters: [debug]Start with Docker:
docker run --rm -p 4317:4317 -p 4318:4318 \
-v $(pwd)/otel-collector-config.yaml:/etc/otelcol/config.yaml \
otel/opentelemetry-collector:latestThen configure loop-task:
loop-task telemetry endpoint http://127.0.0.1:4318
loop-task telemetry testSpan Names
loop-task uses stable span names that do not include dynamic identifiers:
| Span | Name |
|---|---|
| Loop run | loop_task.loop.run |
| Task execute | loop_task.task.execute |
| Command execute | loop_task.command.execute |
| Agent execute | loop_task.agent.execute |
Dynamic identifiers (run ID, task ID, issue numbers) are recorded as span attributes, not in the span name.
Architecture
loop-task
├── loop-task instrumentation
├── OpenCode instrumentation (auto-configured)
└── Claude Code instrumentation (auto-configured)
|
| OTLP
v
Configured OTLP destination
|
v
User's observability backendloop-task supports any OTLP-compatible destination including: OpenTelemetry Collector, Grafana Alloy, Jaeger (via Collector), Grafana Tempo, Honeycomb, Datadog, New Relic, Azure Monitor, and other compatible platforms.