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

gcp/observability: Add compressed metrics to observability module and synchronize View data with exporter #6105

Merged
merged 3 commits into from
Mar 15, 2023

Conversation

zasweq
Copy link
Contributor

@zasweq zasweq commented Mar 9, 2023

This PR adds compressed metrics to observability module, and also unregisters the views on module closure, synchronizing any recorded data with any exporters registered. It also fixes a naming bug in stats/opencensus. This was not caught in unit tests, as the unit tests in stats/opencensus verified keyed on name. However, the compression/uncompressed bytes measurements are technically correct. After this is merged I will need to get rid of go.mod import directive in gcp/observability and stats/opencensus as this fixes bug in stats/opencensus, which will create new commit hash in that package.

RELEASE NOTES:

  • gcp/observability: Add compressed metrics to observability module and synchronize View data with exporter

@zasweq zasweq requested a review from dfawley March 9, 2023 20:16
@zasweq zasweq assigned dfawley and zasweq and unassigned zasweq Mar 9, 2023
@zasweq zasweq added the Type: Feature New features or improvements in behavior label Mar 9, 2023
@zasweq zasweq added this to the 1.54 Release milestone Mar 9, 2023
@@ -35,6 +35,19 @@ import (
var (
// It's a variable instead of const to speed up testing
defaultMetricsReportingInterval = time.Second * 30
o11yMetrics = []*view.View{
Copy link
Member

Choose a reason for hiding this comment

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

I'd rather not put o11y into our code base, personally. It's an abbreviation that many people may not be familiar with.

Should this be defaultViews to be even more descriptive?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, ok. Kevin said this comment about wordage in my packet as well. Switched.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I switched it, but I don't know if I like "default" semantically. These are the views defined by Yash in his document. I don't feel strongly though so went ahead and switched.

@@ -130,11 +140,15 @@ func stopOpenCensus() {
if exporter != nil {
internal.ClearGlobalDialOptions()
internal.ClearGlobalServerOptions()
// This Unregister call guarantees the data recorded gets sent to exporter,
// synchronising the view package and exporter.
Copy link
Member

Choose a reason for hiding this comment

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

As with the comment below, I assume this is also safe to do even if the views weren't already registered (i.e. metrics are disabled)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Luckily, yes. Like below, added a docstring.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dfawley dfawley assigned zasweq and unassigned dfawley Mar 14, 2023
@zasweq zasweq merged commit 36fd0a4 into grpc:master Mar 15, 2023
1 check passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Feature New features or improvements in behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants