-
Notifications
You must be signed in to change notification settings - Fork 468
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(otlp): add integration test setup for traces (#1477)
- Loading branch information
Showing
15 changed files
with
721 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "integration_test_runner" | ||
version = "0.1.0" | ||
edition = "2021" | ||
publish = false | ||
|
||
|
||
[dependencies] | ||
once_cell = "1.17" | ||
opentelemetry = { path = "../../../opentelemetry", features = ["metrics", "logs"] } | ||
opentelemetry_sdk = { path = "../../../opentelemetry-sdk", features = ["rt-tokio", "logs", "testing"] } | ||
opentelemetry-otlp = { path = "../../../opentelemetry-otlp", features = ["tonic", "metrics", "logs"] } | ||
opentelemetry-semantic-conventions = { path = "../../../opentelemetry-semantic-conventions" } | ||
opentelemetry-proto = { path = "../../../opentelemetry-proto", features = ["gen-tonic-messages", "trace", "with-serde"] } | ||
tokio = { version = "1.0", features = ["full"] } | ||
serde_json = "1" | ||
testcontainers = "0.15.0" |
102 changes: 102 additions & 0 deletions
102
opentelemetry-otlp/tests/integration_test/expected/failed_traces.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
{ | ||
"resourceSpans": [ | ||
{ | ||
"resource": { | ||
"attributes": [ | ||
{ | ||
"key": "service.name", | ||
"value": { | ||
"stringValue": "basic-otlp-tracing-example" | ||
} | ||
} | ||
] | ||
}, | ||
"scopeSpans": [ | ||
{ | ||
"scope": { | ||
"name": "ex.com/basic" | ||
}, | ||
"spans": [ | ||
{ | ||
"traceId": "9b458af7378cba65253d7042d34fc72e", | ||
"spanId": "cd7cf7bf939930b7", | ||
"parentSpanId": "", | ||
"name": "Sub operation...", | ||
"kind": 1, | ||
"startTimeUnixNano": 1703985537070566698, | ||
"endTimeUnixNano": 1703985537070572718, | ||
"attributes": [ | ||
{ | ||
"key": "lemons", | ||
"value": { | ||
"stringValue": "five" | ||
} | ||
} | ||
], | ||
"events": [ | ||
{ | ||
"timeUnixNano": 1703985537070567697, | ||
"name": "Sub span event" | ||
} | ||
], | ||
"status": {} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"resource": { | ||
"attributes": [ | ||
{ | ||
"key": "service.name", | ||
"value": { | ||
"stringValue": "basic-otlp-tracing-example" | ||
} | ||
} | ||
] | ||
}, | ||
"scopeSpans": [ | ||
{ | ||
"scope": { | ||
"name": "ex.com/basic" | ||
}, | ||
"spans": [ | ||
{ | ||
"traceId": "9b458af7378cba65253d7042d34fc72e", | ||
"spanId": "d58cf2d702a061e0", | ||
"parentSpanId": "cd7cf7bf939930b7", | ||
"name": "operation", | ||
"kind": 1, | ||
"startTimeUnixNano": 1703985537070558635, | ||
"endTimeUnixNano": 1703985537070580454, | ||
"attributes": [ | ||
{ | ||
"key": "ex.com/another", | ||
"value": { | ||
"stringValue": "yes" | ||
} | ||
} | ||
], | ||
"events": [ | ||
{ | ||
"timeUnixNano": 1703985537070563326, | ||
"name": "Nice operation!", | ||
"attributes": [ | ||
{ | ||
"key": "bogons", | ||
"value": { | ||
"intValue": 100 | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"status": {} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
102 changes: 102 additions & 0 deletions
102
opentelemetry-otlp/tests/integration_test/expected/traces.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
{ | ||
"resourceSpans": [ | ||
{ | ||
"resource": { | ||
"attributes": [ | ||
{ | ||
"key": "service.name", | ||
"value": { | ||
"stringValue": "basic-otlp-tracing-example" | ||
} | ||
} | ||
] | ||
}, | ||
"scopeSpans": [ | ||
{ | ||
"scope": { | ||
"name": "ex.com/basic" | ||
}, | ||
"spans": [ | ||
{ | ||
"traceId": "9b458af7378cba65253d7042d34fc72e", | ||
"spanId": "cd7cf7bf939930b7", | ||
"parentSpanId": "d58cf2d702a061e0", | ||
"name": "Sub operation...", | ||
"kind": 1, | ||
"startTimeUnixNano": 1703985537070566698, | ||
"endTimeUnixNano": 1703985537070572718, | ||
"attributes": [ | ||
{ | ||
"key": "lemons", | ||
"value": { | ||
"stringValue": "five" | ||
} | ||
} | ||
], | ||
"events": [ | ||
{ | ||
"timeUnixNano": 1703985537070567697, | ||
"name": "Sub span event" | ||
} | ||
], | ||
"status": {} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"resource": { | ||
"attributes": [ | ||
{ | ||
"key": "service.name", | ||
"value": { | ||
"stringValue": "basic-otlp-tracing-example" | ||
} | ||
} | ||
] | ||
}, | ||
"scopeSpans": [ | ||
{ | ||
"scope": { | ||
"name": "ex.com/basic" | ||
}, | ||
"spans": [ | ||
{ | ||
"traceId": "9b458af7378cba65253d7042d34fc72e", | ||
"spanId": "d58cf2d702a061e0", | ||
"parentSpanId": "", | ||
"name": "operation", | ||
"kind": 1, | ||
"startTimeUnixNano": 1703985537070558635, | ||
"endTimeUnixNano": 1703985537070580454, | ||
"attributes": [ | ||
{ | ||
"key": "ex.com/another", | ||
"value": { | ||
"stringValue": "yes" | ||
} | ||
} | ||
], | ||
"events": [ | ||
{ | ||
"timeUnixNano": 1703985537070563326, | ||
"name": "Nice operation!", | ||
"attributes": [ | ||
{ | ||
"key": "bogons", | ||
"value": { | ||
"intValue": 100 | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"status": {} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
17 changes: 17 additions & 0 deletions
17
opentelemetry-otlp/tests/integration_test/otel-collector-config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: | ||
http: | ||
|
||
exporters: | ||
logging: | ||
loglevel: debug | ||
file: | ||
path: /testresults/traces.json | ||
|
||
service: | ||
pipelines: | ||
traces: | ||
receivers: [otlp] | ||
exporters: [file] |
Oops, something went wrong.