-
Notifications
You must be signed in to change notification settings - Fork 251
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
Avoid resolving monitored resource every exported timeseries. #427
base: master
Are you sure you want to change the base?
Conversation
monitored_resource = MonitoredResourceUtil.get_instance() | ||
if monitored_resource is not None: | ||
self._resource_type = monitored_resource.resource_type | ||
self._resource_labels = monitored_resource.get_resource_labels() |
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.
Nit: here and L219: "E501 line too long (80 > 79 characters)". The 80 vs 79 char limit debate rears its ugly head.
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.
Told you to use 80 characters :). Fixed it.
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.
It looks like this obsoletes _default_labels
and should change new_stats_exporter
.
self._resource_labels = monitored_resource.get_resource_labels() | ||
else: | ||
self._resource_type = GLOBAL_RESOURCE_TYPE | ||
self._resource_labels = "" |
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.
Other resource labels are dicts or none, should this be a string?
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.
Done.
_default_labels is for metric labels not for resource labels. |
After talking to @bogdandrutu we'll wait on this and #426 until adding support for resources. |
Few more fixes: