Skip to content

Commit 80af1fd

Browse files
bripkensVinozzZ
authored andcommitted
fix: OTLP JSON examples (open-telemetry#516)
# 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.
1 parent 3ef853d commit 80af1fd

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

examples/logs.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
},
2828
"logRecords": [
2929
{
30-
"timeUnixNano": 1544712660300000000,
31-
"observedTimeUnixNano": 1544712660300000000,
30+
"timeUnixNano": "1544712660300000000",
31+
"observedTimeUnixNano": "1544712660300000000",
32+
"severityNumber": 10,
3233
"severityText": "Information",
3334
"traceId": "5B8EFFF798038103D269B633813FC60C",
3435
"spanId": "EEE19B7EC3C1B174",
@@ -51,7 +52,7 @@
5152
{
5253
"key": "int.attribute",
5354
"value": {
54-
"intValue": 10
55+
"intValue": "10"
5556
}
5657
},
5758
{

examples/metrics.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"dataPoints": [
3737
{
3838
"asDouble": 5,
39-
"startTimeUnixNano": 1544712660300000000,
40-
"timeUnixNano": 1544712660300000000,
39+
"startTimeUnixNano": "1544712660300000000",
40+
"timeUnixNano": "1544712660300000000",
4141
"attributes": [
4242
{
4343
"key": "my.counter.attr",
@@ -58,7 +58,7 @@
5858
"dataPoints": [
5959
{
6060
"asDouble": 10,
61-
"timeUnixNano": 1544712660300000000,
61+
"timeUnixNano": "1544712660300000000",
6262
"attributes": [
6363
{
6464
"key": "my.gauge.attr",
@@ -79,8 +79,8 @@
7979
"aggregationTemporality": 1,
8080
"dataPoints": [
8181
{
82-
"startTimeUnixNano": 1544712660300000000,
83-
"timeUnixNano": 1544712660300000000,
82+
"startTimeUnixNano": "1544712660300000000",
83+
"timeUnixNano": "1544712660300000000",
8484
"count": 2,
8585
"sum": 2,
8686
"bucketCounts": [1,1],

examples/trace.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"spanId": "EEE19B7EC3C1B174",
3232
"parentSpanId": "EEE19B7EC3C1B173",
3333
"name": "I'm a server span",
34-
"startTimeUnixNano": 1544712660000000000,
35-
"endTimeUnixNano": 1544712661000000000,
34+
"startTimeUnixNano": "1544712660000000000",
35+
"endTimeUnixNano": "1544712661000000000",
3636
"kind": 2,
3737
"attributes": [
3838
{

0 commit comments

Comments
 (0)