Skip to content

Commit 63f90ec

Browse files
committed
tests: internal: opentelemetry: update logs and trace test cases
Signed-off-by: Eduardo Silva <[email protected]>
1 parent f2244cd commit 63f90ec

File tree

2 files changed

+488
-0
lines changed

2 files changed

+488
-0
lines changed

tests/internal/data/opentelemetry/test_cases.json renamed to tests/internal/data/opentelemetry/logs.json

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,108 @@
592592
}
593593
},
594594

595+
"trace_id_invalid_hex_character": {
596+
"input": {
597+
"resourceLogs": [{
598+
"scopeLogs": [{
599+
"logRecords": [{
600+
"timeUnixNano": "1640995200000000000",
601+
"traceId": "0000000000000000000000000000000G",
602+
"body": {"stringValue": "test log with invalid hex character in trace_id"}
603+
}]
604+
}]
605+
}]
606+
},
607+
"expected_error": {
608+
"code": "FLB_OTEL_LOGS_ERR_INVALID_TRACE_ID"
609+
}
610+
},
611+
612+
"span_id_invalid_hex_character": {
613+
"input": {
614+
"resourceLogs": [{
615+
"scopeLogs": [{
616+
"logRecords": [{
617+
"timeUnixNano": "1640995200000000000",
618+
"spanId": "000000000000000G",
619+
"body": {"stringValue": "test log with invalid hex character in span_id"}
620+
}]
621+
}]
622+
}]
623+
},
624+
"expected_error": {
625+
"code": "FLB_OTEL_LOGS_ERR_INVALID_SPAN_ID"
626+
}
627+
},
628+
629+
"trace_id_odd_length": {
630+
"input": {
631+
"resourceLogs": [{
632+
"scopeLogs": [{
633+
"logRecords": [{
634+
"timeUnixNano": "1640995200000000000",
635+
"traceId": "0000000000000000000000000000001",
636+
"body": {"stringValue": "test log with odd length trace_id"}
637+
}]
638+
}]
639+
}]
640+
},
641+
"expected_error": {
642+
"code": "FLB_OTEL_LOGS_ERR_INVALID_TRACE_ID"
643+
}
644+
},
645+
646+
"span_id_odd_length": {
647+
"input": {
648+
"resourceLogs": [{
649+
"scopeLogs": [{
650+
"logRecords": [{
651+
"timeUnixNano": "1640995200000000000",
652+
"spanId": "000000000000001",
653+
"body": {"stringValue": "test log with odd length span_id"}
654+
}]
655+
}]
656+
}]
657+
},
658+
"expected_error": {
659+
"code": "FLB_OTEL_LOGS_ERR_INVALID_SPAN_ID"
660+
}
661+
},
662+
663+
"trace_id_mixed_valid_invalid_hex": {
664+
"input": {
665+
"resourceLogs": [{
666+
"scopeLogs": [{
667+
"logRecords": [{
668+
"timeUnixNano": "1640995200000000000",
669+
"traceId": "0000000000000000000000000000000Z",
670+
"body": {"stringValue": "test log with mixed valid/invalid hex in trace_id"}
671+
}]
672+
}]
673+
}]
674+
},
675+
"expected_error": {
676+
"code": "FLB_OTEL_LOGS_ERR_INVALID_TRACE_ID"
677+
}
678+
},
679+
680+
"span_id_mixed_valid_invalid_hex": {
681+
"input": {
682+
"resourceLogs": [{
683+
"scopeLogs": [{
684+
"logRecords": [{
685+
"timeUnixNano": "1640995200000000000",
686+
"spanId": "00000000000000Z",
687+
"body": {"stringValue": "test log with mixed valid/invalid hex in span_id"}
688+
}]
689+
}]
690+
}]
691+
},
692+
"expected_error": {
693+
"code": "FLB_OTEL_LOGS_ERR_INVALID_SPAN_ID"
694+
}
695+
},
696+
595697
"base64_encoded_trace_span": {
596698
"input": {
597699
"resourceLogs": [{

0 commit comments

Comments
 (0)