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

Support explicit monitored resource for Metrics #299

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

daniel-sanche
Copy link
Member

This PR adds the option to pass in a MonitoredResource object when creating an exporter instance, which is then used for all export calls. If not passed, it will fallback to the current behavior of parsing a resource out of the Otel Resource object

The main intention is to allow users to pass in additional monitored_resource types, but it also has performance benefits, using a cached object instead of re-constructing it from scratch for each metric.

It may also make sense to make changes to gcp_resource_detector.get_monitored_resource to parse arbitrary monitored resource types out of the Otel Resource, but I left that off for now for simplicity.

If this change seems reasonable, I can add tests

Fixes #298

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.

Support custom monitored resources for Metrics
2 participants