-
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(parsers.xpath): Handle protobuf maps correctly #13719
Conversation
I can confirm this parses for my use case. |
@@ -138,7 +138,6 @@ func (d *protobufDocument) GetNodePath(node, relativeTo dataNode, sep string) st | |||
if n.Parent != nil && n.Parent.Value() != nil { | |||
kind = reflect.TypeOf(n.Parent.Value()).Kind() | |||
} | |||
fmt.Printf("node %q: %v (value=%v) parent: %v\n", n.Data, kind, n.Value(), n.Parent.Value()) |
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.
Are these helpful? should they be log messages? Same question in xpath/parsers.go
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.
I'd love to have those at the debug level.
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.
These will only pollute the output. If in doubt you can always print the XML equivalent of the input document using the xpath_print_document
setting.
21925c1
to
842759b
Compare
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
(cherry picked from commit 806b7cd)
resolves #13715
Currently, Telegraf panics if you use maps (such as
map<string, string>
) in your protocol-buffers. This is mainly due to a bug in the protocol-buffer parsing code of theprotobufquery
library.This PR bumps the dependency of the library and adds a unit-test based on the data of #13715. While at it I unified the location of the xpath-querying libraries under the
srebhan
account.