fix: use current SDK version in telemetry meter#335
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #335 +/- ##
=======================================
Coverage 89.67% 89.68%
=======================================
Files 25 25
Lines 1492 1493 +1
Branches 279 279
=======================================
+ Hits 1338 1339 +1
Misses 94 94
Partials 60 60 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where the OpenTelemetry meter was being registered with a hardcoded, stale version ("0.6.3") instead of the current SDK version. The fix replaces the hardcoded version with the centralized SdkConstants.SdkVersion constant, which currently holds version "0.9.2". This ensures telemetry metadata accurately reflects the SDK version being used, enabling proper version-based filtering and analysis.
Changes:
- Updated
MetricRecorder.meter()to useSdkConstants.SdkVersioninstead of hardcoded "0.6.3" - Added regression test to verify meter is registered with the correct SDK version
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/telemetry/metrics.test.ts | Added imports for SdkConstants and metrics module, and new test case to verify meter registration uses current SDK version |
| telemetry/metrics.ts | Imported SdkConstants and replaced hardcoded version string with SdkConstants.SdkVersion in getMeter call |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Replaces the hardcoded meter version with the SDK version constant.
Changes
metrics.getMeterreceivesSdkConstants.SdkVersionMetricRecorder.meter()to useSdkConstants.SdkVersionPotential Breaking Change
0.6.3to the actual SDK version.Fixes #334