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

fix: new timer should keep labels #5341

Merged
merged 2 commits into from Nov 3, 2022
Merged

Conversation

Jackmin801
Copy link
Contributor

@Jackmin801 Jackmin801 commented Nov 1, 2022

Goals:

  • Add tests that would have caught the bug
  • Implement fix

The current decorator behaviour for MetricsTimer does not correctly save the labels assigned to the histogram.
This PR fixes this.
An example of the problem is in the tests.
The previous implementation would fail on the line:

assert labels == histogram_metric['data']['data_points'][0]['attributes']

@github-actions github-actions bot added size/XS area/core This issue/PR affects the core codebase labels Nov 1, 2022
@codecov
Copy link

codecov bot commented Nov 1, 2022

Codecov Report

Merging #5341 (ec601d7) into master (a38705d) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #5341   +/-   ##
=======================================
  Coverage   86.69%   86.69%           
=======================================
  Files          99       99           
  Lines        6470     6470           
=======================================
  Hits         5609     5609           
  Misses        861      861           
Flag Coverage Δ
jina 86.69% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
jina/serve/instrumentation/__init__.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

girishc13
girishc13 previously approved these changes Nov 2, 2022
@girishc13 girishc13 marked this pull request as ready for review November 2, 2022 10:33
@JoanFM
Copy link
Member

JoanFM commented Nov 2, 2022

@Jackmin801 do we need to add some tests?

@Jackmin801 Jackmin801 force-pushed the fix-otel-metric-timer-missing-label branch from 68bc21f to 0e8f502 Compare November 2, 2022 11:10
@github-actions github-actions bot added the area/testing This issue/PR affects testing label Nov 2, 2022
JoanFM
JoanFM previously approved these changes Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core This issue/PR affects the core codebase area/testing This issue/PR affects testing size/S size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants