-
Notifications
You must be signed in to change notification settings - Fork 538
refactor integration tests and add metrics coverage #2432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
cijothomas
merged 2 commits into
open-telemetry:main
from
scottgerring:chore/integration-test-2
Dec 17, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,2 @@ | ||
lcov.info | ||
actual/*.json |
This file contains hidden or 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 hidden or 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,10 @@ | ||
# OTLP - Integration Tests | ||
scottgerring marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This directory contains integration tests for `opentelemetry-otlp`. It uses | ||
[testcontainers](https://testcontainers.com/) to start an instance of the OTEL collector using [otel-collector-config.yaml](otel-collector-config.yaml), which then uses a file exporter per signal to write the output it receives back to the host machine. | ||
|
||
The tests connect directly to the collector on `localhost:4317` and `localhost:4318`, push data through, and then check that what they expect | ||
has popped back out into the files output by the collector. | ||
|
||
For this to work, you need a couple of things: | ||
* Docker, for the test container | ||
* TCP/4317 and TCP/4318 free on your local machine. If you are running another collector, you'll need to stop it for the tests to run |
This file contains hidden or 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 @@ | ||
Output from the otel-collector goes here. |
133 changes: 133 additions & 0 deletions
133
opentelemetry-otlp/tests/integration_test/expected/different_metrics.json
This file contains hidden or 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,133 @@ | ||
{ | ||
"resourceMetrics": [ | ||
{ | ||
"resource": { | ||
"attributes": [ | ||
{ | ||
"key": "service.name", | ||
"value": { | ||
"stringValue": "metrics-integration-test" | ||
} | ||
} | ||
] | ||
}, | ||
"scopeMetrics": [ | ||
{ | ||
"scope": { | ||
"name": "meter" | ||
}, | ||
"metrics": [ | ||
{ | ||
"name": "counter_u64", | ||
"sum": { | ||
"dataPoints": [ | ||
{ | ||
"attributes": [ | ||
{ | ||
"key": "mykey1", | ||
"value": { | ||
"stringValue": "mydifferentval" | ||
} | ||
}, | ||
{ | ||
"key": "mykey2", | ||
"value": { | ||
"stringValue": "myvalue2" | ||
} | ||
} | ||
], | ||
"startTimeUnixNano": "1734094309366798000", | ||
"timeUnixNano": "1734094317871514000", | ||
"asInt": "15" | ||
} | ||
], | ||
"aggregationTemporality": 2, | ||
"isMonotonic": true | ||
} | ||
}, | ||
{ | ||
"name": "example_histogram", | ||
"histogram": { | ||
"dataPoints": [ | ||
{ | ||
"attributes": [ | ||
{ | ||
"key": "mykey3", | ||
"value": { | ||
"stringValue": "myvalue4" | ||
} | ||
} | ||
], | ||
"startTimeUnixNano": "1734094309366875000", | ||
"timeUnixNano": "1734094317871537000", | ||
"count": "1", | ||
"sum": 42, | ||
"bucketCounts": [ | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"1", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0" | ||
], | ||
"explicitBounds": [ | ||
0, | ||
5, | ||
10, | ||
25, | ||
50, | ||
75, | ||
100, | ||
250, | ||
500, | ||
750, | ||
1000, | ||
2500, | ||
5000, | ||
7500, | ||
10000 | ||
], | ||
"min": 42, | ||
"max": 42 | ||
} | ||
], | ||
"aggregationTemporality": 2 | ||
} | ||
}, | ||
{ | ||
"name": "example_up_down_counter", | ||
"sum": { | ||
"dataPoints": [ | ||
{ | ||
"attributes": [ | ||
{ | ||
"key": "mykey5", | ||
"value": { | ||
"stringValue": "myvalue5" | ||
} | ||
} | ||
], | ||
"startTimeUnixNano": "1734094309366941000", | ||
"timeUnixNano": "1734094317871548000", | ||
"asInt": "-1" | ||
} | ||
], | ||
"aggregationTemporality": 2 | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.