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

Remove any OpenMetrics metric prefixes immediately during parsing #8432

Merged
merged 1 commit into from
Jan 23, 2021

Conversation

ofek
Copy link
Contributor

@ofek ofek commented Jan 23, 2021

Motivation

So that all other configuration may reference the trimmed metric name, thus eliminating much confusion for users

Additional Notes

I made this Added rather than Fixed since the legacy version did not do this:

type_override = scraper_config['type_overrides'].get(metric.name)
if type_override:
metric.type = type_override
elif scraper_config['_type_override_patterns']:
for pattern, new_type in iteritems(scraper_config['_type_override_patterns']):
if pattern.search(metric.name):
metric.type = new_type
break
if metric.type not in self.METRIC_TYPES:
continue
metric.name = self._remove_metric_prefix(metric.name, scraper_config)

@ofek ofek requested review from a team as code owners January 23, 2021 07:00
@ofek ofek merged commit 697aa05 into master Jan 23, 2021
@ofek ofek deleted the ofek/o branch January 23, 2021 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant