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

Fixes the instrument kind for noop async instruments #2461

Merged
merged 3 commits into from Dec 22, 2021

Conversation

bogdandrutu
Copy link
Member

@bogdandrutu bogdandrutu commented Dec 16, 2021

Fixes #2460

Signed-off-by: Bogdan Drutu bogdandrutu@gmail.com

@codecov
Copy link

codecov bot commented Dec 16, 2021

Codecov Report

Merging #2461 (8ea2bec) into main (49987ad) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #2461   +/-   ##
=====================================
  Coverage   76.3%   76.3%           
=====================================
  Files        173     173           
  Lines      12010   12022   +12     
=====================================
+ Hits        9167    9179   +12     
  Misses      2598    2598           
  Partials     245     245           
Impacted Files Coverage Δ
metric/sdkapi/noop.go 95.2% <100.0%> (+6.3%) ⬆️

@MadVikingGod
Copy link
Contributor

I have a fundamental disagreement on the underlying problem that the test exposes. Put simply, we assume that if descriptor.Name(), descriptor.InstrumentKind() and descriptor.NumberKind() all match, then the Instrument stored in the map MUST be the same type.

The solution to this should then be either:

  • We check that the types match, so we don't panic.
  • We do something to separate the Sync from the Async so that we don't need to check.

This way if this registry is ever used again we don't find ourselves retreading this.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
@bogdandrutu
Copy link
Member Author

@MadVikingGod no test anymore, this is still a bug fix so please prioritize.

@bogdandrutu bogdandrutu added area:metrics Part of OpenTelemetry Metrics bug Something isn't working labels Dec 18, 2021
CHANGELOG.md Outdated Show resolved Hide resolved
@MrAlias MrAlias merged commit 4aedc1c into open-telemetry:main Dec 22, 2021
@bogdandrutu bogdandrutu deleted the fix2460 branch December 22, 2021 23:34
@MrAlias MrAlias mentioned this pull request Feb 10, 2022
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 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sdkapi.NewNoopSyncInstrument and sdkapi.NewNoopAsyncInstrument do not set type
4 participants