Skip to content

Comments

feat: OpenTelemetry export and CostTracker (M21)#387

Merged
bug-ops merged 2 commits intomainfrom
feat/m21/observability-cost
Feb 16, 2026
Merged

feat: OpenTelemetry export and CostTracker (M21)#387
bug-ops merged 2 commits intomainfrom
feat/m21/observability-cost

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 16, 2026

Summary

  • Add optional OTLP trace export behind otel feature flag with tracing-opentelemetry layer, spans for LLM calls (llm_call) and tool executions (tool_exec)
  • Add CostTracker with per-model token pricing, daily budget limits (UTC midnight reset), integrated into agent loop with pre-request budget check
  • Config sections [observability] and [cost] in default.toml

Closes #377, closes #378, closes #366

Test plan

  • 7 CostTracker unit tests pass (budget check, daily reset, disabled tracker, zero-cost models)
  • 1444 workspace tests pass
  • Clippy clean, fmt clean
  • otel feature builds clean (cargo build --features otel)
  • Zero OTel overhead when feature disabled
  • Security audit: cargo deny clean, no data leakage in spans

Add optional OTLP trace export (feature-gated behind `otel`) with
tracing-opentelemetry layer and spans for LLM calls and tool executions.

Add CostTracker with per-model token pricing, daily budget limits,
and automatic UTC midnight reset. Integrated into agent loop with
budget check before each LLM request.

Config sections: [observability] and [cost] in default.toml.
@bug-ops bug-ops force-pushed the feat/m21/observability-cost branch from 20bad42 to b4caa85 Compare February 16, 2026 22:47
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 16, 2026
@bug-ops bug-ops enabled auto-merge (squash) February 16, 2026 22:52
@bug-ops bug-ops merged commit d958f64 into main Feb 16, 2026
20 checks passed
@bug-ops bug-ops deleted the feat/m21/observability-cost branch February 16, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config core dependencies documentation Improvements or additions to documentation enhancement New feature or request rust size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement CostTracker with daily budget limits Add OpenTelemetry export for LLM and tool operations Epic: M21 — Observability and cost control

1 participant