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 integration test with metrics from the prometheus receiver #348

Merged
merged 1 commit into from
Apr 12, 2022
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
5 changes: 5 additions & 0 deletions exporter/collector/integrationtest/testcases.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ var (
OTLPInputFixturePath: "testdata/fixtures/basic_counter_metrics.json",
ExpectFixturePath: "testdata/fixtures/basic_counter_metrics_expect.json",
},
{
Name: "Basic Prometheus metrics",
OTLPInputFixturePath: "testdata/fixtures/basic_prometheus_metrics.json",
ExpectFixturePath: "testdata/fixtures/basic_prometheus_metrics_expect.json",
},
{
Name: "Modified prefix unknown domain",
OTLPInputFixturePath: "testdata/fixtures/basic_counter_metrics.json",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,311 @@
{
"resourceMetrics":[
{
"resource":{
"attributes":[
{
"key":"service.name",
"value":{
"stringValue":"demo"
}
},
{
"key":"service.instance.id",
"value":{
"stringValue":"localhost:2222"
}
},
{
"key":"net.host.port",
"value":{
"stringValue":"2222"
}
},
{
"key":"http.scheme",
"value":{
"stringValue":"http"
}
}
]
},
"instrumentationLibraryMetrics":[
{
"instrumentationLibrary":{},
"metrics":[
{
"name":"scrape_series_added",
"description":"The approximate number of new series in this scrape",
"gauge":{
"dataPoints":[
{
"timeUnixNano":"1649443516286000000",
"asDouble":22
}
]
}
},
{
"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":"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