pg-yang commented on issue #9883:
URL: https://github.com/apache/skywalking/issues/9883#issuecomment-1398226560
```java
final byte[] decode = Base64.getDecoder().decode(s);
final byte[] decode2 = Base64.getDecoder().decode(s2);
final ResourceMetrics resourceMetrics =
ResourceMetrics.parseFrom(Arrays.copyOfRange(decode, 5, decode.length));
final ResourceMetrics resourceMetrics2 =
ResourceMetrics.parseFrom(Arrays.copyOfRange(decode2, 5, decode2.length));
```
Hello, above code could work, but I don't know why. s and s2 encoded by
base64. As mentioned in
[OpenTelemetry 0.7.0
format](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats-opentelemetry.html):
Each data structure starts with a header with an UnsignedVarInt32 indicating
the record length in bytes.
`UnsignedVarInt32` is 4 bytes, right? But the code works correctly when I
skip 5 byte, skipping 4 byte will encounter an exception.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]