opentelemetry-proto初体验
背景
消费Kafka,Kafka中的数据为OLTP(OpenTelemetry)格式。
初体验
环境准备
先准备好docker环境,然后
git clone https://github.com/open-telemetry/opentelemetry-proto
make gen-java
环境
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-proto</artifactId>
<version>0.17.1</version>
</dependency>
反序列化
import io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;
ExportLogsServiceRequest request = ExportLogsServiceRequest.parseFrom(bytes);