I am not familiar with that protobuf. However, you will need to provide the definition file and the type. Once those are resolved you can move on to creating tags and fields with the XPath parser.
Is there a defined set of protobuf types? Because i defined the proto file and provided protobuf type but still was getting same error proto not found.
In your .proto, you need to specify the Go-specific package directive to correctly name your custom proto buffer. Something like this:
package myproto;
In your Telegraf config the xpath_protobuf_type value should be set to the class + message type. Using the package name above of myproto + your Ap message type would require:
xpath_protobuf_type = "myproto.Ap"
I used this protobuf file:
syntax = "proto3";
package myproto;
message Ap {
double dl = 1;
double ul = 2;
}
message ApNon{
uint32 StartTime = 1;
uint64 SampleDurationSec = 2;
repeated Ap ap = 10;
}
And while my file doesn’t have protobuf messages, I got the following error message, which indicates it has loaded the proto type and is attempting to read in data.
2022-03-04T13:58:40Z E! [inputs.file] Error in plugin: proto: cannot parse invalid wire-format data
So after getting import error. I tried to define telegraf config for each file. But for ApNon.proto file i am getting error “cannot parse invalid wire-format data” for second message but for first message i am able to read contents. Telegraf config for ApNon.proto
Sorry for not being clear. I meant with one telegraf config wire format was giving error and for second telegraf config it was parsing correctly. But i need to use first vonfiguration only.
It means it was unable to parse the data you received given the type and message you specified. It could be that the data coming in is not the format you expected, your buffer message could be wrong, or some other things. At this point, Telegraf is doing what you told it to do.
It would be really nice to keep these questions in a single place. We are now up to three places, between this topic, the new topic you created, and the bug you filed. I’m going to let Sven help you out with importing multiple files.
Hi sorry for creating a completely different thread for importing multiple proto file errors.
The issue I raised on GitHub because Sven told me to do the same so he can re-produce the same issue and help me better.
Thanks