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: fixing metrics views, cherry-pick (3307) #3309

Merged

Conversation

JaydipGabani
Copy link
Contributor

Signed-off-by: Jaydip Gabani gabanijaydip@gmail.com
(cherry picked from commit 71bd2a6)
This PR is CP of #3307
What this PR does / why we need it:

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):
Fixes #

Special notes for your reviewer:

@JaydipGabani JaydipGabani requested a review from a team as a code owner March 15, 2024 12:28
@JaydipGabani JaydipGabani force-pushed the release-3.15 branch 2 times, most recently from 9ec9169 to e379056 Compare March 15, 2024 18:34
@JaydipGabani JaydipGabani changed the title fix: fixing metrics views, cherry-pick (3307) fix: fixing metrics views, cherry-pick (3307) (3301) Mar 15, 2024
@sozercan
Copy link
Member

@JaydipGabani do you mind creating a seperate pr for the protobuf cp? so it's easier to diagnose any issues

@JaydipGabani JaydipGabani changed the title fix: fixing metrics views, cherry-pick (3307) (3301) fix: fixing metrics views, cherry-pick (3307) Mar 15, 2024
Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>
(cherry picked from commit 982a31d)
@codecov-commenter
Copy link

codecov-commenter commented Mar 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.50%. Comparing base (52106aa) to head (adef5a7).

Additional details and impacted files
@@               Coverage Diff                @@
##           release-3.15    #3309      +/-   ##
================================================
+ Coverage         54.42%   54.50%   +0.08%     
================================================
  Files               134      134              
  Lines             12329    12334       +5     
================================================
+ Hits               6710     6723      +13     
+ Misses             5123     5115       -8     
  Partials            496      496              
Flag Coverage Δ
unittests 54.50% <100.00%> (+0.08%) ⬆️

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

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

@maxsmythe
Copy link
Contributor

IIRC there was a race condition with registering metrics that was found as part of the otel migration. This caused some metrics to not be reported, especially if there were multiple exporters. Do you remember what that race condition was? Would this PR interact with that?

@JaydipGabani
Copy link
Contributor Author

IIRC there was a race condition with registering metrics that was found as part of the otel migration. This caused some metrics to not be reported, especially if there were multiple exporters. Do you remember what that race condition was? Would this PR interact with that?

The race condition was related to GetMeterProvider getting called before the execution of SetMeterProvider in exporters. To resolve that I moved function call to GetMeterProvider within newreporter() for all reporter instead of init(). Creating views within init wouldn't introduce this race condition again. In fact it was a mistake on my part to move registering views within newrepoerter() in the first place as it was needed to properly initiate metrics through SetMeterProvider(), i.e. we need to register views before SetMeterProvider() is called.

@maxsmythe
Copy link
Contributor

Thanks for the context!

Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

LGTM

@JaydipGabani JaydipGabani merged commit 7349e22 into open-policy-agent:release-3.15 Mar 19, 2024
16 checks passed
@JaydipGabani JaydipGabani deleted the release-3.15 branch March 19, 2024 20:10
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