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: Fix handling of imports in protocol-buffer definitions #10798

Merged
merged 7 commits into from
Mar 23, 2022

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Mar 9, 2022

resolves #10794

Currently, the XPath parser fails when confronted with protocol-buffer definitions that import other definitions and are not in the current working directory. To solve the issue, we add a new option (xpath_protobuf_import_paths) to allow the user to specify import paths that are used to look up specified and imported definitions. If, for example, you do have files A.proto and B.proto within a package foo that are located in /data/my_proto/files you can use

  data_format = "xpath_protobuf"
  xpath_protobuf_file = "A.proto"
  xpath_protobuf_type = "foo.Measurement"
  xpath_protobuf_import_paths = [".", "/data/my_proto_files"]
 ...

to specify the required information to the parser.

@telegraf-tiger telegraf-tiger bot added fix pr to fix corresponding bug new plugin plugin/parser 1. Request for new parser plugins 2. Issues/PRs that are related to parser plugins labels Mar 9, 2022
@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Mar 9, 2022

Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip.
Downloads for additional architectures and packages are available below.

👍 This pull request doesn't change the Telegraf binary size

📦 Click here to get additional PR build artifacts

Artifact URLs

DEB RPM TAR GZ ZIP
amd64.deb aarch64.rpm darwin_amd64.tar.gz windows_amd64.zip
arm64.deb armel.rpm darwin_arm64.tar.gz windows_i386.zip
armel.deb armv6hl.rpm freebsd_amd64.tar.gz
armhf.deb i386.rpm freebsd_armv7.tar.gz
i386.deb ppc64le.rpm freebsd_i386.tar.gz
mips.deb riscv64.rpm linux_amd64.tar.gz
mipsel.deb s390x.rpm linux_arm64.tar.gz
ppc64el.deb x86_64.rpm linux_armel.tar.gz
riscv64.deb linux_armhf.tar.gz
s390x.deb linux_i386.tar.gz
linux_mips.tar.gz
linux_mipsel.tar.gz
linux_ppc64le.tar.gz
linux_riscv64.tar.gz
linux_s390x.tar.gz
static_linux_amd64.tar.gz

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.

Two questions about the paths, and then this is good to go!

Thank you or jumping on this!

plugins/parsers/xpath/README.md Show resolved Hide resolved
@powersj powersj 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 Mar 10, 2022
@weknin
Copy link

weknin commented Mar 23, 2022

Hey! This bug occurs on our end as well, any ETA for a merge ?

@powersj powersj merged commit 6f0c5af into influxdata:master Mar 23, 2022
@weknin
Copy link

weknin commented Mar 24, 2022

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/xml fix pr to fix corresponding bug new plugin 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 not able to read multiple .proto files
4 participants