Skip to content

Conversation

@cijothomas
Copy link
Member

Fixes #2225

For Metrics this affects aggregation (SDK), as now different Meter is returned for scope with different attributes.
Logs,Traces do not store Logger/Tracers, so this requires no change in SDKs.

@cijothomas cijothomas requested a review from a team as a code owner February 21, 2025 19:03
@codecov
Copy link

codecov bot commented Feb 21, 2025

Codecov Report

Attention: Patch coverage is 93.87755% with 9 lines in your changes missing coverage. Please review.

Project coverage is 79.3%. Comparing base (27d364b) to head (8b02c8b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
opentelemetry/src/common.rs 93.0% 9 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2701   +/-   ##
=====================================
  Coverage   79.2%   79.3%           
=====================================
  Files        123     123           
  Lines      22582   22657   +75     
=====================================
+ Hits       17899   17974   +75     
  Misses      4683    4683           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

let _meter2 =
meter_provider.meter_with_scope(make_scope(vec![KeyValue::new("key", "value1")]));

assert_eq!(meter_provider.inner.meters.lock().unwrap().len(), 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - add test with different attributes, just to ensure that existing behavior is not affected.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#2702 Yes there are various combinations that need to have good coverage. Opening an issue to track them overall.

Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cijothomas cijothomas merged commit bc5e6ce into open-telemetry:main Feb 21, 2025
21 checks passed
@cijothomas cijothomas deleted the cijothomas/scope-equality-fix branch February 21, 2025 20:06
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.

Instrumentation Scope should be identifying

2 participants