open-telemetry / opentelemetry-proto

OpenTelemetry protocol (OTLP) specification and Protobuf definitions
https://opentelemetry.io/docs/specs/otlp/
Apache License 2.0
607 stars 262 forks source link

How to use Java service to receive data in the OpenTelemetry (Otel) protocol? #521

Closed Cloud-Yao closed 10 months ago

Cloud-Yao commented 10 months ago

"I am trying to use the Spring Boot framework in Java to receive data sent by OpenTelemetry Collector. I have imported the protobuf SDK provided by OpenTelemetry, and I am processing the data from the Collector (then saving it to my own custom storage database). However, I always encounter an error when parsing the data, and the error is 'Protocol message tag had an invalid wire type.' I have tried to find a lot of information but cannot find an answer. It seems that the official documentation does not provide relevant SDK development examples. Below is my OpenTelemetry Collector configuration, SDK version, and my Java code. How should I parse and retrieve the data from protobuf and then perform the desired processing?"

Cloud-Yao commented 10 months ago
image
Cloud-Yao commented 10 months ago
image
Cloud-Yao commented 10 months ago
image
Cloud-Yao commented 10 months ago
image