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

[pdata] Change outcome of Metric data accessors misuse #5035

Merged

Conversation

dmitryax
Copy link
Member

Change outcome of pdata.Metric.<Gauge|Sum|Histogram|ExponentialHistogram>() functions misuse. In case of type mismatch, they don't panic right away but return an invalid zero-initialized instance for consistency with other OneOf field accessors

Link to tracking Issue: #4775

@codecov
Copy link

codecov bot commented Mar 18, 2022

Codecov Report

Merging #5035 (584a8c4) into main (d95d0d6) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #5035      +/-   ##
==========================================
+ Coverage   91.08%   91.10%   +0.01%     
==========================================
  Files         180      180              
  Lines       10700    10720      +20     
==========================================
+ Hits         9746     9766      +20     
  Misses        737      737              
  Partials      217      217              
Impacted Files Coverage Δ
model/internal/pdata/generated_metrics.go 97.20% <100.00%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d95d0d6...584a8c4. Read the comment docs.

@dmitryax dmitryax force-pushed the change-metric-type-accessor-behavior branch from 9ca8a6e to f6c0795 Compare March 18, 2022 04:00
@dmitryax dmitryax force-pushed the change-metric-type-accessor-behavior branch from f6c0795 to 6c0e47a Compare March 20, 2022 17:33
Change outcome of `pdata.Metric.<Gauge|Sum|Histogram|ExponentialHistogram>()` functions misuse. In case of type mismatch, they don't panic right away but return an invalid zero-initialized instance for consistency with other OneOf field accessors
@dmitryax dmitryax force-pushed the change-metric-type-accessor-behavior branch from 6c0e47a to 584a8c4 Compare March 21, 2022 16:47
@bogdandrutu bogdandrutu merged commit 2b7a90e into open-telemetry:main Mar 21, 2022
@dmitryax dmitryax deleted the change-metric-type-accessor-behavior branch March 23, 2022 06:32
Nicholaswang pushed a commit to Nicholaswang/opentelemetry-collector that referenced this pull request Jun 7, 2022
…y#5035)

Change outcome of `pdata.Metric.<Gauge|Sum|Histogram|ExponentialHistogram>()` functions misuse. In case of type mismatch, they don't panic right away but return an invalid zero-initialized instance for consistency with other OneOf field accessors
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.

4 participants