-
Notifications
You must be signed in to change notification settings - Fork 764
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
chore: moving to otel from opencensus #3011
Conversation
6c39ee4
to
5033da0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for figuring this out!
I left some comments on the first registry, but wanted to avoid repeating comments.
With proper encapsulation and separation-of-concerns, I think we can get this PR to the point where there are no changes outside of stats_reporter.go/tests, pkg/metrics
.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #3011 +/- ##
==========================================
+ Coverage 53.78% 54.44% +0.65%
==========================================
Files 136 134 -2
Lines 12195 12329 +134
==========================================
+ Hits 6559 6712 +153
+ Misses 5135 5122 -13
+ Partials 501 495 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
4d25b16
to
30bfce9
Compare
Signed-off-by: Jaydip Gabani <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting closer!
90% of comments are in the same general areas:
-
files adjacent to
stats_reporter.go
andstats_reporter_test.go
should not have deltas (I think there was one potential exception to this) -
All metrics state for callbacks should be maintained by
reporter
structs -
All callbacks should be named like
observeX
-
reportX
functions should be maintained, with the same function signature (necessary for the zero-delta bullet point). In the case where callbacks are involved, this means updatingreporter
to have internal state and handling concurrency (locking/atomic variables). -
Callbacks should be handled via constructing the reporter (better separation of concerns and necessary for zero delta)
Signed-off-by: Jaydipkumar Arvindbhai Gabani <[email protected]>
Signed-off-by: Jaydip Gabani <[email protected]>
Signed-off-by: Jaydip Gabani <[email protected]>
@maxsmythe Thanks for providing detailed feedback. I think I addressed all of your feedback. PTAL! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting close! Biggest themes are:
observe
functions need to acquire a read mutex- I think we can consolidate a lot of test helper code
Some other, less global comments. Once this is done, we can help make sure stackdriver doesn't have a diff.
Signed-off-by: Jaydip Gabani <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM pending @acpana's approval for stackdriver
Signed-off-by: Jaydip Gabani <[email protected]>
Signed-off-by: Jaydip Gabani <[email protected]>
Signed-off-by: Jaydip Gabani <[email protected]>
Signed-off-by: Jaydip Gabani <[email protected]>
// AddReader adds a reader to the options and updates the MeterProvider if the required conditions are met. | ||
func AddReader(opt metric.Option) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
api nits: if we keep this structure, it may be useful to at least spell out the "required conditions". Alternatively splitting this into a AddReader
and SetMetricsProvider
might offer a cleaner/ more concise api
Signed-off-by: Jaydip Gabani <[email protected]>
Signed-off-by: Jaydip Gabani <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of b5c3c1a, I don't see a delta to metrics sent to GCM (formerly stackdriver). Thank you loads Jay for working on this 💯 🥇
7692a33
into
open-policy-agent:master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Jaydip Gabani <[email protected]> Signed-off-by: Jaydipkumar Arvindbhai Gabani <[email protected]>
What this PR does / why we need it:
As opencensus is EOL, moving to opentelemetry for metrics.
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 #2465
Special notes for your reviewer: