-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Conversation
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.
Thanks for jumping on this one!
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 👍 This pull request doesn't change the Telegraf binary size 📦 Click here to get additional PR build artifactsArtifact URLs |
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.
Thanks for fixing this so fast!
Before this fix, my metrics were named "file" but now they are named "parser". (using xpath parser where I set a |
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. forparsers.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.