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

fix(processors.parser): Keep name of original metric if parser doesn't return one #12116

Merged
merged 2 commits into from Oct 27, 2022

Conversation

srebhan
Copy link
Contributor

@srebhan srebhan commented Oct 27, 2022

resolves #12115

With PR #11600 parsers for processors are no longer initialized with an empty metric name by default. Instead they now use the name of the parent plugin. However, processors.parser tries to use the original metric-name in case the parser does not provide an individual name (e.g. for parsers.value) for the returned metric. To do so, the processor checks for an empty name which is no longer valid as the parser's default metric name is now "parser".

This PR fixes the check for the default name to restore the old behavior.

Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

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

Thanks for jumping on this one!

Copy link
Contributor

@MyaLongmire MyaLongmire left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this so fast!

@srebhan srebhan merged commit 7d37ddf into influxdata:master Oct 27, 2022
dba-leshop pushed a commit to dba-leshop/telegraf that referenced this pull request Oct 30, 2022
popey pushed a commit that referenced this pull request Nov 2, 2022
@srebhan srebhan deleted the fix-issue-12115 branch November 7, 2022 11:50
@Hipska
Copy link
Contributor

Hipska commented Dec 8, 2022

Before this fix, my metrics were named "file" but now they are named "parser". (using xpath parser where I set a metric_name for each, this used to work before..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug plugin/processor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

processors.parser changes measurement name to 'parser'
4 participants