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

Avoid resolving monitored resource every exported timeseries. #427

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bogdandrutu
Copy link

Few more fixes:

  1. Use gke_container as resource type instead of k8s_container when provided as gke_container.
  2. Add support for k8s_container when provided in the options
  3. Use provided default_monitored_labels if type is one of gce_instance, gke_container, aws_ec2_instance.

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()
Copy link
Member

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.

Copy link
Author

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.

Copy link
Member

@c24t c24t left a 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 = ""
Copy link
Member

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?

Copy link
Author

Choose a reason for hiding this comment

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

Done.

@bogdandrutu
Copy link
Author

_default_labels is for metric labels not for resource labels.

@c24t
Copy link
Member

c24t commented Dec 6, 2018

After talking to @bogdandrutu we'll wait on this and #426 until adding support for resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants