Skip to content

feat: add cost tracking to observability layer (APPENG-5370) - #79

Open
Aliciapet11 wants to merge 1 commit into
mainfrom
feat/cost-tracking
Open

feat: add cost tracking to observability layer (APPENG-5370)#79
Aliciapet11 wants to merge 1 commit into
mainfrom
feat/cost-tracking

Conversation

@Aliciapet11

Copy link
Copy Markdown
Collaborator

Summary

Implements cost tracking functionality for the observability layer.

  • New module: abevalflow/observability/cost.py with calculate_cost() function
  • MLflow integration: Observer now logs estimated_cost_usd as a metric
  • Data flow: MetricsContext → to_observability_dict() → calculate_cost() → ObservabilityMetricsRow.estimated_cost_usd → DB
  • Test coverage: 15 new tests, all 58 tests passing

Verification

  • ✅ All tests passing (58 total)
  • ✅ Ruff linting clean
  • ✅ Cost tracking data flows correctly through observability pipeline

- Implement calculate_cost() function to compute estimated_cost_usd
- Update MLflow observer to log estimated_cost_usd as a metric
- Export calculate_cost from observability module
- Add comprehensive test coverage (15 new tests, all 58 tests passing)
- Data flow: MetricsContext → to_observability_dict() → calculate_cost() → EstimatedCostUSD metric
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant