forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pkg/pdatatest] Do not ignore timestamps in CompareMetrics, use optio…
…ns (open-telemetry#17983) It's pretty common to ignore timestamps when using CompareMetrics in tests for scrapers, but it's not obvious behavior for other use cases. We should provide options to explicitly ignore timestamps. That will make the Compare... functions provide clean comparison with not implicit behavior.
- Loading branch information
Showing
58 changed files
with
415 additions
and
190 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: enhancement | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
component: pkg/pdatatest | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Do not ignore timestamps implicitly, provide explicit options for that. | ||
|
||
# One or more tracking issues related to the change | ||
issues: [17865] |
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
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
34 changes: 34 additions & 0 deletions
34
pkg/pdatatest/pmetrictest/testdata/ignore-start-timestamp/actual.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,34 @@ | ||
{ | ||
"resourceMetrics": [ | ||
{ | ||
"scopeMetrics": [ | ||
{ | ||
"metrics": [ | ||
{ | ||
"name": "gauge.one", | ||
"gauge": { | ||
"dataPoints": [ | ||
{ | ||
"asDouble": 123.456, | ||
"startTimeUnixNano": "11651379494838206464" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "sum.one", | ||
"sum": { | ||
"dataPoints": [ | ||
{ | ||
"asInt": 123, | ||
"startTimeUnixNano": "11651379494838206464" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
34 changes: 34 additions & 0 deletions
34
pkg/pdatatest/pmetrictest/testdata/ignore-start-timestamp/expected.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,34 @@ | ||
{ | ||
"resourceMetrics": [ | ||
{ | ||
"scopeMetrics": [ | ||
{ | ||
"metrics": [ | ||
{ | ||
"name": "gauge.one", | ||
"gauge": { | ||
"dataPoints": [ | ||
{ | ||
"asDouble": 123.456, | ||
"startTimeUnixNano": "0" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "sum.one", | ||
"sum": { | ||
"dataPoints": [ | ||
{ | ||
"asInt": 123, | ||
"startTimeUnixNano": "0" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
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
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
Oops, something went wrong.