Skip to content

Commit

Permalink
fix: OTLP JSON examples (#516)
Browse files Browse the repository at this point in the history
# Why
The example files do not follow the specification. 64 bit integers
must be [string
encoded](https://protobuf.dev/programming-guides/proto3/#json).

# What

 - Fix the encoding in the examples
 - Add an example for log `severityNumber` to point at the enum
   encoding rules.
  • Loading branch information
bripkens authored Jan 9, 2024
1 parent ea449ae commit c56093a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
7 changes: 4 additions & 3 deletions examples/logs.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
},
"logRecords": [
{
"timeUnixNano": 1544712660300000000,
"observedTimeUnixNano": 1544712660300000000,
"timeUnixNano": "1544712660300000000",
"observedTimeUnixNano": "1544712660300000000",
"severityNumber": 10,
"severityText": "Information",
"traceId": "5B8EFFF798038103D269B633813FC60C",
"spanId": "EEE19B7EC3C1B174",
Expand All @@ -51,7 +52,7 @@
{
"key": "int.attribute",
"value": {
"intValue": 10
"intValue": "10"
}
},
{
Expand Down
10 changes: 5 additions & 5 deletions examples/metrics.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"dataPoints": [
{
"asDouble": 5,
"startTimeUnixNano": 1544712660300000000,
"timeUnixNano": 1544712660300000000,
"startTimeUnixNano": "1544712660300000000",
"timeUnixNano": "1544712660300000000",
"attributes": [
{
"key": "my.counter.attr",
Expand All @@ -58,7 +58,7 @@
"dataPoints": [
{
"asDouble": 10,
"timeUnixNano": 1544712660300000000,
"timeUnixNano": "1544712660300000000",
"attributes": [
{
"key": "my.gauge.attr",
Expand All @@ -79,8 +79,8 @@
"aggregationTemporality": 1,
"dataPoints": [
{
"startTimeUnixNano": 1544712660300000000,
"timeUnixNano": 1544712660300000000,
"startTimeUnixNano": "1544712660300000000",
"timeUnixNano": "1544712660300000000",
"count": 2,
"sum": 2,
"bucketCounts": [1,1],
Expand Down
4 changes: 2 additions & 2 deletions examples/trace.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"spanId": "EEE19B7EC3C1B174",
"parentSpanId": "EEE19B7EC3C1B173",
"name": "I'm a server span",
"startTimeUnixNano": 1544712660000000000,
"endTimeUnixNano": 1544712661000000000,
"startTimeUnixNano": "1544712660000000000",
"endTimeUnixNano": "1544712661000000000",
"kind": 2,
"attributes": [
{
Expand Down

0 comments on commit c56093a

Please sign in to comment.