-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[exporter/logging] Improve tests for metrics and traces (#6534)
Improve the test cases for metrics and traces to inspect the full generated text as it's already done for logs
- Loading branch information
Showing
8 changed files
with
332 additions
and
28 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
Empty file.
13 changes: 13 additions & 0 deletions
13
exporter/loggingexporter/internal/otlptext/testdata/metrics/invalid_metric_type.out
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,13 @@ | ||
ResourceMetrics #0 | ||
Resource SchemaURL: | ||
Resource attributes: | ||
-> resource-attr: Str(resource-attr-val-1) | ||
ScopeMetrics #0 | ||
ScopeMetrics SchemaURL: | ||
InstrumentationScope | ||
Metric #0 | ||
Descriptor: | ||
-> Name: sum-int | ||
-> Description: | ||
-> Unit: 1 | ||
-> DataType: Empty |
168 changes: 168 additions & 0 deletions
168
exporter/loggingexporter/internal/otlptext/testdata/metrics/metrics_with_all_types.out
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,168 @@ | ||
ResourceMetrics #0 | ||
Resource SchemaURL: | ||
Resource attributes: | ||
-> resource-attr: Str(resource-attr-val-1) | ||
ScopeMetrics #0 | ||
ScopeMetrics SchemaURL: | ||
InstrumentationScope | ||
Metric #0 | ||
Descriptor: | ||
-> Name: gauge-int | ||
-> Description: | ||
-> Unit: 1 | ||
-> DataType: Gauge | ||
NumberDataPoints #0 | ||
Data point attributes: | ||
-> label-1: Str(label-value-1) | ||
StartTimestamp: 2020-02-11 20:26:12.000000321 +0000 UTC | ||
Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Value: 123 | ||
NumberDataPoints #1 | ||
Data point attributes: | ||
-> label-2: Str(label-value-2) | ||
StartTimestamp: 2020-02-11 20:26:12.000000321 +0000 UTC | ||
Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Value: 456 | ||
Metric #1 | ||
Descriptor: | ||
-> Name: gauge-double | ||
-> Description: | ||
-> Unit: 1 | ||
-> DataType: Gauge | ||
NumberDataPoints #0 | ||
Data point attributes: | ||
-> label-1: Str(label-value-1) | ||
-> label-2: Str(label-value-2) | ||
StartTimestamp: 2020-02-11 20:26:12.000000321 +0000 UTC | ||
Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Value: 1.230000 | ||
NumberDataPoints #1 | ||
Data point attributes: | ||
-> label-1: Str(label-value-1) | ||
-> label-3: Str(label-value-3) | ||
StartTimestamp: 2020-02-11 20:26:12.000000321 +0000 UTC | ||
Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Value: 4.560000 | ||
Metric #2 | ||
Descriptor: | ||
-> Name: sum-int | ||
-> Description: | ||
-> Unit: 1 | ||
-> DataType: Sum | ||
-> IsMonotonic: true | ||
-> AggregationTemporality: Cumulative | ||
NumberDataPoints #0 | ||
Data point attributes: | ||
-> label-1: Str(label-value-1) | ||
StartTimestamp: 2020-02-11 20:26:12.000000321 +0000 UTC | ||
Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Value: 123 | ||
NumberDataPoints #1 | ||
Data point attributes: | ||
-> label-2: Str(label-value-2) | ||
StartTimestamp: 2020-02-11 20:26:12.000000321 +0000 UTC | ||
Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Value: 456 | ||
Metric #3 | ||
Descriptor: | ||
-> Name: sum-double | ||
-> Description: | ||
-> Unit: 1 | ||
-> DataType: Sum | ||
-> IsMonotonic: true | ||
-> AggregationTemporality: Cumulative | ||
NumberDataPoints #0 | ||
Data point attributes: | ||
-> label-1: Str(label-value-1) | ||
-> label-2: Str(label-value-2) | ||
StartTimestamp: 2020-02-11 20:26:12.000000321 +0000 UTC | ||
Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Value: 1.230000 | ||
NumberDataPoints #1 | ||
Data point attributes: | ||
-> label-1: Str(label-value-1) | ||
-> label-3: Str(label-value-3) | ||
StartTimestamp: 2020-02-11 20:26:12.000000321 +0000 UTC | ||
Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Value: 4.560000 | ||
Metric #4 | ||
Descriptor: | ||
-> Name: histogram | ||
-> Description: | ||
-> Unit: 1 | ||
-> DataType: Histogram | ||
-> AggregationTemporality: Cumulative | ||
HistogramDataPoints #0 | ||
Data point attributes: | ||
-> label-1: Str(label-value-1) | ||
-> label-3: Str(label-value-3) | ||
StartTimestamp: 2020-02-11 20:26:12.000000321 +0000 UTC | ||
Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Count: 1 | ||
Sum: 15.000000 | ||
HistogramDataPoints #1 | ||
Data point attributes: | ||
-> label-2: Str(label-value-2) | ||
StartTimestamp: 2020-02-11 20:26:12.000000321 +0000 UTC | ||
Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Count: 1 | ||
Sum: 15.000000 | ||
Min: 15.000000 | ||
Max: 15.000000 | ||
ExplicitBounds #0: 1.000000 | ||
Buckets #0, Count: 0 | ||
Buckets #1, Count: 1 | ||
Metric #5 | ||
Descriptor: | ||
-> Name: exponential-histogram | ||
-> Description: | ||
-> Unit: 1 | ||
-> DataType: ExponentialHistogram | ||
-> AggregationTemporality: Delta | ||
ExponentialHistogramDataPoints #0 | ||
Data point attributes: | ||
-> label-1: Str(label-value-1) | ||
-> label-3: Str(label-value-3) | ||
StartTimestamp: 2020-02-11 20:26:12.000000321 +0000 UTC | ||
Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Count: 5 | ||
Sum: 0.150000 | ||
Bucket (-1.414214, -1.000000], Count: 1 | ||
Bucket (-1.000000, -0.707107], Count: 1 | ||
Bucket [0, 0], Count: 1 | ||
Bucket [1.414214, 2.000000), Count: 1 | ||
Bucket [2.000000, 2.828427), Count: 1 | ||
ExponentialHistogramDataPoints #1 | ||
Data point attributes: | ||
-> label-2: Str(label-value-2) | ||
StartTimestamp: 2020-02-11 20:26:12.000000321 +0000 UTC | ||
Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Count: 3 | ||
Sum: 1.250000 | ||
Min: 0.000000 | ||
Max: 1.000000 | ||
Bucket [0, 0], Count: 1 | ||
Bucket [0.250000, 1.000000), Count: 1 | ||
Bucket [1.000000, 4.000000), Count: 1 | ||
Metric #6 | ||
Descriptor: | ||
-> Name: summary | ||
-> Description: | ||
-> Unit: 1 | ||
-> DataType: Summary | ||
SummaryDataPoints #0 | ||
Data point attributes: | ||
-> label-1: Str(label-value-1) | ||
-> label-3: Str(label-value-3) | ||
StartTimestamp: 2020-02-11 20:26:12.000000321 +0000 UTC | ||
Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Count: 1 | ||
Sum: 15.000000 | ||
SummaryDataPoints #1 | ||
Data point attributes: | ||
-> label-2: Str(label-value-2) | ||
StartTimestamp: 2020-02-11 20:26:12.000000321 +0000 UTC | ||
Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Count: 1 | ||
Sum: 15.000000 | ||
QuantileValue #0: Quantile 0.010000, Value 15.000000 |
45 changes: 45 additions & 0 deletions
45
exporter/loggingexporter/internal/otlptext/testdata/metrics/two_metrics.out
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,45 @@ | ||
ResourceMetrics #0 | ||
Resource SchemaURL: | ||
Resource attributes: | ||
-> resource-attr: Str(resource-attr-val-1) | ||
ScopeMetrics #0 | ||
ScopeMetrics SchemaURL: | ||
InstrumentationScope | ||
Metric #0 | ||
Descriptor: | ||
-> Name: gauge-int | ||
-> Description: | ||
-> Unit: 1 | ||
-> DataType: Gauge | ||
NumberDataPoints #0 | ||
Data point attributes: | ||
-> label-1: Str(label-value-1) | ||
StartTimestamp: 2020-02-11 20:26:12.000000321 +0000 UTC | ||
Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Value: 123 | ||
NumberDataPoints #1 | ||
Data point attributes: | ||
-> label-2: Str(label-value-2) | ||
StartTimestamp: 2020-02-11 20:26:12.000000321 +0000 UTC | ||
Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Value: 456 | ||
Metric #1 | ||
Descriptor: | ||
-> Name: gauge-double | ||
-> Description: | ||
-> Unit: 1 | ||
-> DataType: Gauge | ||
NumberDataPoints #0 | ||
Data point attributes: | ||
-> label-1: Str(label-value-1) | ||
-> label-2: Str(label-value-2) | ||
StartTimestamp: 2020-02-11 20:26:12.000000321 +0000 UTC | ||
Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Value: 1.230000 | ||
NumberDataPoints #1 | ||
Data point attributes: | ||
-> label-1: Str(label-value-1) | ||
-> label-3: Str(label-value-3) | ||
StartTimestamp: 2020-02-11 20:26:12.000000321 +0000 UTC | ||
Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Value: 4.560000 |
Empty file.
51 changes: 51 additions & 0 deletions
51
exporter/loggingexporter/internal/otlptext/testdata/traces/two_spans.out
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,51 @@ | ||
ResourceSpans #0 | ||
Resource SchemaURL: | ||
Resource attributes: | ||
-> resource-attr: Str(resource-attr-val-1) | ||
ScopeSpans #0 | ||
ScopeSpans SchemaURL: | ||
InstrumentationScope | ||
Span #0 | ||
Trace ID : 0102030405060708090a0b0c0d0e0f10 | ||
Parent ID : | ||
ID : 1112131415161718 | ||
Name : operationA | ||
Kind : Unspecified | ||
Start time : 2020-02-11 20:26:12.000000321 +0000 UTC | ||
End time : 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Status code : Error | ||
Status message : status-cancelled | ||
Events: | ||
SpanEvent #0 | ||
-> Name: event-with-attr | ||
-> Timestamp: 2020-02-11 20:26:13.000000123 +0000 UTC | ||
-> DroppedAttributesCount: 2 | ||
-> Attributes:: | ||
-> span-event-attr: Str(span-event-attr-val) | ||
SpanEvent #1 | ||
-> Name: event | ||
-> Timestamp: 2020-02-11 20:26:13.000000123 +0000 UTC | ||
-> DroppedAttributesCount: 2 | ||
Span #1 | ||
Trace ID : | ||
Parent ID : | ||
ID : | ||
Name : operationB | ||
Kind : Unspecified | ||
Start time : 2020-02-11 20:26:12.000000321 +0000 UTC | ||
End time : 2020-02-11 20:26:13.000000789 +0000 UTC | ||
Status code : Unset | ||
Status message : | ||
Links: | ||
SpanLink #0 | ||
-> Trace ID: | ||
-> ID: | ||
-> TraceState: | ||
-> DroppedAttributesCount: 4 | ||
-> Attributes:: | ||
-> span-link-attr: Str(span-link-attr-val) | ||
SpanLink #1 | ||
-> Trace ID: | ||
-> ID: | ||
-> TraceState: | ||
-> DroppedAttributesCount: 4 |
Oops, something went wrong.