traceloop / traceloop/openllmetry
🚀 Feature: Move custom histogram buckets to `opentelemetry-semantic-conventions-ai`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.4k
- Forks
- 1.1k
- Avg merge
- 8d 14h
- Merged PRs (30d)
- 2
Description
Problem
@nirga Currently, optimized histogram for specific LLM meters are only defined in traceloop-sdk, while standalone instrumentation packages will use OpenTelemetry's default buckets.
Taking the token usage histogram as an example, when integrated with traceloop-sdk, the instrumentation package utilizes the specified histogram, but upon standalone distribution as opentelemetry-instrumentation-openai, without defined histogram, the package falls back to using the OTel default histogram.
Proposed Implementation
We should move these meters definitions from traceloop-sdk to opentelemetry-semantic-conventions-ai just like opentelemetry-python, enabling the standalone distributed package to utilize them.
✌️ How do you aim to achieve this?
As mentioned above.
🔄️ 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?
Yes I am willing to submit a PR!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading packages/traceloop-sdk/traceloop/sdk/metrics/metrics.py and locating the custom histogram definitions, then inspect the opentelemetry-semantic-conventions-ai package structure and its tests. Move the definitions to that package and verify that standalone instrumentation packages use the same buckets without relying on traceloop-sdk.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100