You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Logstash installation source (e.g. built from source, with a package manager: DEB/RPM, expanded from tar or zip archive, docker)
How is Logstash being run (e.g. as a service/service manager: systemd, upstart, etc. Via command line, docker/kubernetes)
How was the Logstash Plugin installed
I'm using Logstash version 8.5.1.
I run custom Docker image in which I installed the plugin and copied the ruby classes required to decode the request protobuf payload.
Here is the content of the Dockerfile.
FROM docker.elastic.co/logstash/logstash:8.5.1
RUN /usr/share/logstash/bin/logstash-plugin install logstash-codec-protobuf
COPY opentelemetry /opt/protobuf/opentelemetry
I run Logstash on Minikube using Docker as the container runtime.
Description of the problem including expected versus actual behavior:
I'm trying to send logs collected by the OpenTelemetry Collector to Logstash.
I configured OpenTelemetry Collector in a way that it's sending logs over HTTP using Protobuf encoding.
I haven't found an easy way to debug the content of the request sent by the OpenTelemetry Collector yet, but I'm pretty confident that the Ruby class I've configured the right one.
I trust that by having explored the Go code in the exporter.
For what it's worth here, here is where the request payload is encoded. The NewExportRequestFromLogs function is declared here.
In the same file, we can see that it returns an ExportRequest , which is a wrapper around otlpcollectorlog.ExportLogsServiceRequest, and the MarshalProto function eventually delegates to *otlpcollectorlog.ExportLogsServiceRequest.Marshal().
When I run the whole thing, here is what I see in the Logstash console.
[2023-09-26T20:59:34,393][WARN ][logstash.codecs.protobuf ][main][0ab6a3768106bebf116bb6c30480f3ab4507dcce11f495901fff4cef37068b58] Couldn't decode protobuf: #<Google::Protobuf::ParseError: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length.>
[2023-09-26T20:59:34,592][WARN ][logstash.codecs.protobuf ][main][0ab6a3768106bebf116bb6c30480f3ab4507dcce11f495901fff4cef37068b58] Couldn't decode protobuf: #<Google::Protobuf::ParseError: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length.>
[2023-09-26T20:59:34,793][WARN ][logstash.codecs.protobuf ][main][0ab6a3768106bebf116bb6c30480f3ab4507dcce11f495901fff4cef37068b58] Couldn't decode protobuf: #<Google::Protobuf::ParseError: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length.>
[2023-09-26T20:59:34,994][WARN ][logstash.codecs.protobuf ][main][0ab6a3768106bebf116bb6c30480f3ab4507dcce11f495901fff4cef37068b58] Couldn't decode protobuf: #<Google::Protobuf::ParseError: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length.>
[2023-09-26T20:59:35,194][WARN ][logstash.codecs.protobuf ][main][0ab6a3768106bebf116bb6c30480f3ab4507dcce11f495901fff4cef37068b58] Couldn't decode protobuf: #<Google::Protobuf::ParseError: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length.>
[2023-09-26T20:59:35,392][WARN ][logstash.codecs.protobuf ][main][0ab6a3768106bebf116bb6c30480f3ab4507dcce11f495901fff4cef37068b58] Couldn't decode protobuf: #<Google::Protobuf::ParseError: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length.>
[2023-09-26T20:59:35,592][WARN ][logstash.codecs.protobuf ][main][0ab6a3768106bebf116bb6c30480f3ab4507dcce11f495901fff4cef37068b58] Couldn't decode protobuf: #<Google::Protobuf::ParseError: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length.>
A bunch of error messages that suggest that the wrong ruby class is used to decode the request payload.
However, as I explained, I pretty confident that I've configured the right one.
Looking in the other issues on this repository, I could find other mentions of the plugin not always working properly with the http input, namely this one: #34
And I came to wonder if there is indeed a bug somewhere.
Steps to reproduce:
Assuming you have minikube and docker installed on your machine.
Here are the steps to reproduce.
Clone the repository that contains all the files to reproduce
$ echo test >> /tmp/in.log
[2023-10-26T12:33:29,009][WARN ][l.c.protobuf ] Couldn't decode protobuf: #<Google::Protobuf::ParseError: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length.
[2023-10-26T12:33:29,009][WARN ][l.c.protobuf ] Couldn't decode protobuf: #<Google::Protobuf::ParseError: Protocol message contained an invalid tag (zero).
Also tried using http input, in that case I get:
Couldn't decode protobuf: #<Google::Protobuf::ParseError: Protocol message tag had invalid wire type.
If I configure the OTEL collector to write to kafka and then read the data in kafka I'm able to decode it using the otel protobuf model. I added some code to the logstash codec plugin to write the message its trying to decode to a file and then sent the same message to both kafka and logstash.
The first blog decodes successfully with the protobuf model using python, the second does not and produces the same error message that I get from logstash when it fails to decode the message, so it seems like it may be getting mangled somehow by the input plugin.
Logstash information:
Please include the following information:
bin/logstash --version
)I'm using Logstash version 8.5.1.
I run custom Docker image in which I installed the plugin and copied the ruby classes required to decode the request protobuf payload.
Here is the content of the Dockerfile.
The ruby files are generated using the tooling in this repository: https://github.com/open-telemetry/opentelemetry-proto
A copy of them can be found here: https://github.com/aubm/logstash-protobuf-codec-plugin-opentelemetry-collector-bug-attached-files/tree/master/dockerfiles/logstash/opentelemetry/proto
I run Logstash on Minikube using Docker as the container runtime.
Description of the problem including expected versus actual behavior:
I'm trying to send logs collected by the OpenTelemetry Collector to Logstash.
I configured OpenTelemetry Collector in a way that it's sending logs over HTTP using Protobuf encoding.
Here is the logstash input configuration.
I have a Kubernetes service exposing port 10000 of the Logstash container, the OpenTelemetry exporter is configured as follows.
I haven't found an easy way to debug the content of the request sent by the OpenTelemetry Collector yet, but I'm pretty confident that the Ruby class I've configured the right one.
I trust that by having explored the Go code in the exporter.
For what it's worth here, here is where the request payload is encoded. The
NewExportRequestFromLogs
function is declared here.In the same file, we can see that it returns an
ExportRequest
, which is a wrapper aroundotlpcollectorlog.ExportLogsServiceRequest
, and theMarshalProto
function eventually delegates to*otlpcollectorlog.ExportLogsServiceRequest.Marshal()
.All the Kubernetes manifests can be found here under the config folder: https://github.com/aubm/logstash-protobuf-codec-plugin-opentelemetry-collector-bug-attached-files/tree/master
When I run the whole thing, here is what I see in the Logstash console.
A bunch of error messages that suggest that the wrong ruby class is used to decode the request payload.
However, as I explained, I pretty confident that I've configured the right one.
Looking in the other issues on this repository, I could find other mentions of the plugin not always working properly with the http input, namely this one: #34
And I came to wonder if there is indeed a bug somewhere.
Steps to reproduce:
Assuming you have minikube and docker installed on your machine.
Here are the steps to reproduce.
The text was updated successfully, but these errors were encountered: