Skip to content
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

Add stale fixture data point #645

Merged
merged 2 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ var MetricsTestCases = []TestCase{
OTLPInputFixturePath: "testdata/fixtures/metrics/basic_prometheus_metrics.json",
ExpectFixturePath: "testdata/fixtures/metrics/basic_prometheus_metrics_expect.json",
},
{
Name: "Basic Prometheus metrics with stale data point",
OTLPInputFixturePath: "testdata/fixtures/metrics/basic_prometheus_metrics_stale.json",
ExpectFixturePath: "testdata/fixtures/metrics/basic_prometheus_metrics_stale_expect.json",
CompareFixturePath: "testdata/fixtures/metrics/basic_prometheus_metrics_expect.json",
SkipForSDK: true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dashpole should our sdk exporter drop stale points too? This failed for sdk and I didn't see anything handling stale points there

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SDK shouldn't have a notion of stale points. I.e. it shouldn't be possible to get those when coming from the SDK.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah because it's just a prometheus thing right? So it's only possible from the prom receiver, that makes sense

},
{
Name: "Modified prefix unknown domain",
OTLPInputFixturePath: "testdata/fixtures/metrics/basic_counter_metrics.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,4 +332,4 @@
]
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,348 @@
{
"resourceMetrics":[
{
"resource":{
"attributes":[
{
"key":"service.name",
"value":{
"stringValue":"demo"
}
},
{
"key":"service.instance.id",
"value":{
"stringValue":"localhost:2222"
}
},
{
"key":"service.namespace",
"value":{
"stringValue":""
}
},
{
"key":"net.host.port",
"value":{
"stringValue":"2222"
}
},
{
"key":"http.scheme",
"value":{
"stringValue":"http"
}
}
]
},
"scopeMetrics":[
{
"scope":{},
"metrics":[
{
"name":"scrape_series_added",
"description":"The approximate number of new series in this scrape",
"gauge":{
"dataPoints":[
{
"timeUnixNano":"1649443516286000000",
"asDouble":22
}
]
}
},
{
"name":"scrape_series_added",
"description":"The approximate number of new series in this scrape",
"gauge":{
"dataPoints":[
{
"timeUnixNano":"1649443516286000001",
"asDouble":23,
"flags":1
}
]
}
},
{
"name":"ex_com_one",
"gauge":{
"dataPoints":[
{
"attributes":[
{
"key":"ex_com_lemons",
"value":{
"stringValue":"13"
}
},
{
"key":"telemetry_sdk_language",
"value":{
"stringValue":"go"
}
},
{
"key":"telemetry_sdk_name",
"value":{
"stringValue":"opentelemetry"
}
},
{
"key":"telemetry_sdk_version",
"value":{
"stringValue":"1.6.2"
}
}
],
"timeUnixNano":"1649443516286000000",
"asDouble":1
},
{
"attributes":[
{
"key":"A",
"value":{
"stringValue":"1"
}
},
{
"key":"B",
"value":{
"stringValue":"2"
}
},
{
"key":"C",
"value":{
"stringValue":"3"
}
},
{
"key":"ex_com_lemons",
"value":{
"stringValue":"10"
}
},
{
"key":"telemetry_sdk_language",
"value":{
"stringValue":"go"
}
},
{
"key":"telemetry_sdk_name",
"value":{
"stringValue":"opentelemetry"
}
},
{
"key":"telemetry_sdk_version",
"value":{
"stringValue":"1.6.2"
}
}
],
"timeUnixNano":"1649443516286000000",
"asDouble":13
}
]
}
},
{
"name":"ex_com_two",
"histogram":{
"dataPoints":[
{
"attributes":[
{
"key":"A",
"value":{
"stringValue":"1"
}
},
{
"key":"B",
"value":{
"stringValue":"2"
}
},
{
"key":"C",
"value":{
"stringValue":"3"
}
},
{
"key":"ex_com_lemons",
"value":{
"stringValue":"13"
}
},
{
"key":"telemetry_sdk_language",
"value":{
"stringValue":"go"
}
},
{
"key":"telemetry_sdk_name",
"value":{
"stringValue":"opentelemetry"
}
},
{
"key":"telemetry_sdk_version",
"value":{
"stringValue":"1.6.2"
}
}
],
"startTimeUnixNano":"1649443516286000000",
"timeUnixNano":"1649443516286000000",
"count":"1",
"sum":2,
"bucketCounts":[
"0",
"0",
"1",
"0",
"0",
"0",
"0"
],
"explicitBounds":[
1,
2,
5,
10,
20,
50
]
},
{
"attributes":[
{
"key":"A",
"value":{
"stringValue":"1"
}
},
{
"key":"B",
"value":{
"stringValue":"2"
}
},
{
"key":"C",
"value":{
"stringValue":"3"
}
},
{
"key":"ex_com_lemons",
"value":{
"stringValue":"10"
}
},
{
"key":"telemetry_sdk_language",
"value":{
"stringValue":"go"
}
},
{
"key":"telemetry_sdk_name",
"value":{
"stringValue":"opentelemetry"
}
},
{
"key":"telemetry_sdk_version",
"value":{
"stringValue":"1.6.2"
}
}
],
"startTimeUnixNano":"1649443516286000000",
"timeUnixNano":"1649443516286000000",
"count":"2",
"sum":14,
"bucketCounts":[
"0",
"0",
"1",
"0",
"1",
"0",
"0"
],
"explicitBounds":[
1,
2,
5,
10,
20,
50
]
}
],
"aggregationTemporality":"AGGREGATION_TEMPORALITY_CUMULATIVE"
}
},
{
"name":"up",
"description":"The scraping was successful",
"gauge":{
"dataPoints":[
{
"timeUnixNano":"1649443516286000000",
"asDouble":1
}
]
}
},
{
"name":"scrape_duration_seconds",
"description":"Duration of the scrape",
"unit":"seconds",
"gauge":{
"dataPoints":[
{
"timeUnixNano":"1649443516286000000",
"asDouble":0.00699415
}
]
}
},
{
"name":"scrape_samples_scraped",
"description":"The number of samples the target exposed",
"gauge":{
"dataPoints":[
{
"timeUnixNano":"1649443516286000000",
"asDouble":22
}
]
}
},
{
"name":"scrape_samples_post_metric_relabeling",
"description":"The number of samples remaining after metric relabeling was applied",
"gauge":{
"dataPoints":[
{
"timeUnixNano":"1649443516286000000",
"asDouble":22
}
]
}
}
]
}
]
}
]
}
Loading
Loading