Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict Meters to only register and collect instruments it created #4333

Merged
merged 8 commits into from
Jul 19, 2023

Conversation

MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Jul 17, 2023

Do not allow the registration or collection of data for instruments from other Meters with the same scope (i.e. from different MeterProviders) (resolves #4164). Do this by comparing the instance of the meter that created an instrument with the meter the operation is being run for.

@MrAlias MrAlias added pkg:SDK Related to an SDK package area:metrics Part of OpenTelemetry Metrics labels Jul 17, 2023
@codecov
Copy link

codecov bot commented Jul 17, 2023

Codecov Report

Merging #4333 (f6693b5) into main (f194fb0) will decrease coverage by 0.1%.
The diff coverage is 100.0%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #4333     +/-   ##
=======================================
- Coverage   83.5%   83.4%   -0.1%     
=======================================
  Files        184     184             
  Lines      14366   14365      -1     
=======================================
- Hits       11997   11990      -7     
- Misses      2143    2149      +6     
  Partials     226     226             
Impacted Files Coverage Δ
sdk/metric/instrument.go 91.8% <100.0%> (+<0.1%) ⬆️
sdk/metric/meter.go 85.8% <100.0%> (-0.1%) ⬇️

... and 2 files with indirect coverage changes

@MrAlias MrAlias changed the title Restrict Meters to only accept and collect for instruments it created Restrict Meters to only register and collect instruments it created Jul 17, 2023
sdk/metric/meter.go Outdated Show resolved Hide resolved
@MrAlias MrAlias merged commit f2a9f2f into open-telemetry:main Jul 19, 2023
@MrAlias MrAlias deleted the restrict-reg-inst-same-meter branch July 19, 2023 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metrics Part of OpenTelemetry Metrics pkg:SDK Related to an SDK package
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Callbacks of instruments from other MeterProviders must not be collected
4 participants