Add support for metrics to emit#767
Merged
jerbly merged 5 commits intoopen-telemetry:mainfrom Jun 2, 2025
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #767 +/- ##
=======================================
- Coverage 75.9% 75.7% -0.3%
=======================================
Files 67 68 +1
Lines 5435 5494 +59
=======================================
+ Hits 4127 4159 +32
- Misses 1308 1335 +27 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
lquerel
approved these changes
Jun 2, 2025
Contributor
lquerel
left a comment
There was a problem hiding this comment.
I made few suggestions to better separate metrics from spans but otherwise LGTM
crates/weaver_emit/src/lib.rs
Outdated
|
|
||
| // TODO Emit metrics | ||
| // Emit metrics | ||
| let meter_provider = match tracer_provider_config { |
Contributor
There was a problem hiding this comment.
tracer_provider_config could be renamed/generalized into signal_provider_config
crates/weaver_emit/src/lib.rs
Outdated
| let meter_provider = match tracer_provider_config { | ||
| ExporterConfig::Stdout => init_stdout_meter_provider(), | ||
| ExporterConfig::Otlp { endpoint } => { | ||
| init_meter_provider(endpoint).map_err(|e| Error::TracerProviderError { |
Contributor
There was a problem hiding this comment.
TracerProviderError -> MetricProviderError ?
crates/weaver_emit/src/spans.rs
Outdated
| /// Values are generated based on the attribute type and examples where possible. | ||
| #[must_use] | ||
| fn get_attribute_name_value(attribute: &Attribute) -> KeyValue { | ||
| pub fn get_attribute_name_value(attribute: &Attribute) -> KeyValue { |
Contributor
There was a problem hiding this comment.
Should not that be moved into a dedicated module?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #748 and #752
Emits a metric for every one defined in the model.
Deficiencies:
intorfloat. So integer instruments are created in all cases.1is used in all cases.Bug fixes:
This feature highlighted two issues which are fixed here with regression tests.