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(parsers.xpath): Allow resolving extensions #15586

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Jul 1, 2024

Summary

Currently, the XPath parser fails to resolve fields containing extensions due to the fact that extensions are currently not registered globally and thus cannot be resolved by the unmarshaller.

Instead of registering extensions globally this PR uses a parser-specific registry to avoid side effects between different parsers. Unfortunately, extensions are usually distributed across different files that are not imported by the main file. Therefore, all extensions need to be loaded explicitly additionally to the main file. As a consequence the xpath_protobuf_file option needs to be replaced by xpath_protobuf_files (plural) to be able to specify multiple input files.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #15571

@telegraf-tiger telegraf-tiger bot added fix pr to fix corresponding bug plugin/parser 1. Request for new parser plugins 2. Issues/PRs that are related to parser plugins labels Jul 1, 2024
@srebhan srebhan self-assigned this Jul 2, 2024
@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Jul 2, 2024

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Jul 2, 2024
@srebhan srebhan assigned powersj and DStrand1 and unassigned srebhan Jul 2, 2024
Copy link
Member

@DStrand1 DStrand1 left a comment

Choose a reason for hiding this comment

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

Looks great!

@DStrand1 DStrand1 removed their assignment Jul 2, 2024
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!

@powersj powersj merged commit 94e45a1 into influxdata:master Jul 2, 2024
26 of 27 checks passed
@github-actions github-actions bot added this to the v1.31.2 milestone Jul 2, 2024
powersj pushed a commit that referenced this pull request Jul 22, 2024
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/parser 1. Request for new parser plugins 2. Issues/PRs that are related to parser plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Telegraf config for parsing Juniper UDP / Protobuf (dial-out) data
3 participants