traceloop / traceloop/openllmetry

🚀 Feature: cost metrics across all instrumentations

Open
#1,042 10 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.4k
Forks
1.1k
Avg merge
8d 14h
Merged PRs (30d)
2

Description

Which component is this feature for?

All Packages

🔖 Feature description

Add span attributes and metrics for total cost for each model we instrument. Right now we only send token usage but we can easily extend this and send cost as well - we just need to define a prices const in each instrumentation and multiple the prompt/completion token usage.

🎤 Why is this feature needed ?

Better visibility into the cost for OpenLLMetry usage. Right now we only provide token usage which is basically just a proxy for cost.

✌️ How do you aim to achieve this?

See feature decsription

🔄️ Additional Information

No response

👀 Have you spent some time to check if this feature request has been raised before?
  • I checked and didn't find similar issue
Are you willing to submit PR?

None

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing token-usage span attributes and metrics in each instrumentation package; no specific files or tests are named in the issue. Define the supported model pricing data and how prompt and completion usage map to total cost before implementing the cross-package scope. Done means every supported instrumentation reports cost consistently alongside token usage, with validation for the affected metrics.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.