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

Define the Cloud Monitoring category for custom metrics #296

Closed
aaaaahaaaaa opened this issue Nov 1, 2023 · 5 comments
Closed

Define the Cloud Monitoring category for custom metrics #296

aaaaahaaaaa opened this issue Nov 1, 2023 · 5 comments

Comments

@aaaaahaaaaa
Copy link

Based on the example here, the name of the counter (request_counter) ends up being both used for the name of the metric (workload.googleapis.com/request_counter) and the name of the Active metric category under Cloud Monitoring. The result is:

Generic Task > Request_counter > Request_counter

Is there a way a define the category in such a way that the results would:

Generic Task > My Category > Request_counter

And therefore group multiple custom metrics under the same category?

@aabmass
Copy link
Collaborator

aabmass commented Nov 1, 2023

Iirc, if the metric has the form workload.googleapis.com/foo/bar, the UI will render foo as the category. Can you try that?

@aaaaahaaaaa
Copy link
Author

aaaaahaaaaa commented Nov 2, 2023

So the name of the metric would include the /?

That doesn't work, OpenTelemetry raises the following exception:

Exception: Expected ASCII string of maximum length 63 characters but got foo/bar.

@aabmass
Copy link
Collaborator

aabmass commented Nov 14, 2023

That was fixed in open-telemetry/opentelemetry-python#3442. Can you try a newer version of OpenTelemetry API/SDK?

@aabmass
Copy link
Collaborator

aabmass commented Dec 4, 2023

@aaaaahaaaaa is this still an issue for you?

@aaaaahaaaaa
Copy link
Author

@aabmass Sorry for the late feedback, this one slipped through the cracks.

It works, the prefix before the / appears as the category. Thank you :)

For the record, the name of metric in the UI still appears as the full string with the prefix. So category -> category/metric.

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

No branches or pull requests

2 participants