Skip to content

Commit

Permalink
try fixing integrationtests
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed Jul 18, 2023
1 parent f1cef21 commit 9e28767
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 292 deletions.
12 changes: 2 additions & 10 deletions exporter/collector/integrationtest/testcases/testcases_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,14 +373,6 @@ var MetricsTestCases = []TestCase{
// prometheus_target is not supported by the SDK
SkipForSDK: true,
},
{
Name: "Google Managed Prometheus Exponential Histogram",
OTLPInputFixturePath: "testdata/fixtures/metrics/exponential_histogram.json",
ExpectFixturePath: "testdata/fixtures/metrics/exponential_histogram_gmp_expect.json",
ConfigureCollector: configureGMPCollector,
// prometheus_target is not supported by the SDK
SkipForSDK: true,
},
// Tests for specific distributions of the collector
{
Name: "Ops Agent Self-Reported metrics",
Expand Down Expand Up @@ -462,8 +454,8 @@ func configureGMPCollector(cfg *collector.Config) {
cfg.MetricConfig.ExtraMetrics = func(m pmetric.Metrics) pmetric.ResourceMetricsSlice {
// This should not add any change without the featuregate enabled (from Ops Agent)
googlemanagedprometheus.AddUntypedMetrics(m)
googlemanagedprometheus.AddScopeInfoMetric(m)
googlemanagedprometheus.AddTargetInfoMetric(m)
// googlemanagedprometheus.AddScopeInfoMetric(m)
// googlemanagedprometheus.AddTargetInfoMetric(m)
return m.ResourceMetrics()
}
cfg.MetricConfig.InstrumentationLibraryLabels = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,6 @@
}
],
"unit": "s"
},
{
"metric": {
"type": "prometheus.googleapis.com/target_info/gauge"
},
"resource": {
"type": "prometheus_target",
"labels": {
"cluster": "",
"instance": "10.92.5.2:15692",
"job": "demo",
"location": "us-central1-c",
"namespace": ""
}
},
"metricKind": "GAUGE",
"valueType": "INT64",
"points": [
{
"interval": {
"endTime": "1970-01-01T00:00:00Z"
},
"value": {
"int64Value": "1"
}
}
]
}
]
}
Expand All @@ -87,7 +60,7 @@
"startTime": "1970-01-01T00:00:00Z"
},
"value": {
"int64Value": "2"
"int64Value": "1"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,6 @@
}
],
"unit": "s"
},
{
"metric": {
"type": "prometheus.googleapis.com/target_info/gauge"
},
"resource": {
"type": "prometheus_target",
"labels": {
"cluster": "",
"instance": "10.92.5.2:15692",
"job": "demo",
"location": "us-central1-c",
"namespace": ""
}
},
"metricKind": "GAUGE",
"valueType": "INT64",
"points": [
{
"interval": {
"endTime": "1970-01-01T00:00:00Z"
},
"value": {
"int64Value": "1"
}
}
]
}
]
}
Expand All @@ -87,7 +60,7 @@
"startTime": "1970-01-01T00:00:00Z"
},
"value": {
"int64Value": "2"
"int64Value": "1"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
{
"attributes": [
{
"key": "A",
"key": "some.lemons",
"value": {
"stringValue": "1"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"metric": {
"type": "workload.googleapis.com/simple.gauge",
"labels": {
"A": "1"
"some_lemons": "1"
}
},
"resource": {
Expand Down Expand Up @@ -73,9 +73,6 @@
"name": "simple.gauge",
"type": "workload.googleapis.com/simple.gauge",
"labels": [
{
"key": "A"
},
{
"key": "some_lemons"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"metric": {
"type": "prometheus.googleapis.com/simple_gauge_seconds/gauge",
"labels": {
"A": "1"
"some_lemons": "1"
}
},
"resource": {
Expand All @@ -64,33 +64,6 @@
}
],
"unit": "s"
},
{
"metric": {
"type": "prometheus.googleapis.com/target_info/gauge"
},
"resource": {
"type": "prometheus_target",
"labels": {
"cluster": "",
"instance": "10.92.5.2:15692",
"job": "demo",
"location": "us-central1-c",
"namespace": ""
}
},
"metricKind": "GAUGE",
"valueType": "INT64",
"points": [
{
"interval": {
"endTime": "1970-01-01T00:00:00Z"
},
"value": {
"int64Value": "1"
}
}
]
}
]
}
Expand All @@ -117,7 +90,7 @@
"startTime": "1970-01-01T00:00:00Z"
},
"value": {
"int64Value": "3"
"int64Value": "2"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
"timeSeries": [
{
"metric": {
"type": "prometheus.googleapis.com/metric_with_a_scope/gauge",
"labels": {
"otel_scope_name": "very_real_scope",
"otel_scope_version": "0.0.2"
}
"type": "prometheus.googleapis.com/metric_with_a_scope/gauge"
},
"resource": {
"type": "prometheus_target",
Expand All @@ -34,37 +30,6 @@
}
]
},
{
"metric": {
"type": "prometheus.googleapis.com/otel_scope_info/gauge",
"labels": {
"otel_scope_name": "very_real_scope",
"otel_scope_version": "0.0.2"
}
},
"resource": {
"type": "prometheus_target",
"labels": {
"cluster": "rabbitmq-test-dev",
"instance": "10.92.5.2:15692",
"job": "demo",
"location": "us-central1-c",
"namespace": "default"
}
},
"metricKind": "GAUGE",
"valueType": "INT64",
"points": [
{
"interval": {
"endTime": "1970-01-01T00:00:00Z"
},
"value": {
"int64Value": "1"
}
}
]
},
{
"metric": {
"type": "prometheus.googleapis.com/scrape_series_added/gauge"
Expand Down Expand Up @@ -933,42 +898,6 @@
}
],
"unit": "seconds"
},
{
"metric": {
"type": "prometheus.googleapis.com/target_info/gauge",
"labels": {
"cloud_platform": "gcp_kubernetes_engine",
"http_scheme": "http",
"k8s_container_name": "rabbitmq",
"k8s_node_name": "10.92.5.2",
"k8s_pod_name": "rabbitmq-server-0",
"net_host_ip": "10.92.5.2",
"net_host_port": "15692"
}
},
"resource": {
"type": "prometheus_target",
"labels": {
"cluster": "rabbitmq-test-dev",
"instance": "10.92.5.2:15692",
"job": "demo",
"location": "us-central1-c",
"namespace": "default"
}
},
"metricKind": "GAUGE",
"valueType": "INT64",
"points": [
{
"interval": {
"endTime": "1970-01-01T00:00:00Z"
},
"value": {
"int64Value": "1"
}
}
]
}
]
}
Expand All @@ -995,7 +924,7 @@
"startTime": "1970-01-01T00:00:00Z"
},
"value": {
"int64Value": "30"
"int64Value": "28"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,33 +116,6 @@
}
],
"unit": "s"
},
{
"metric": {
"type": "prometheus.googleapis.com/target_info/gauge"
},
"resource": {
"type": "prometheus_target",
"labels": {
"cluster": "",
"instance": "10.92.5.2:15692",
"job": "demo",
"location": "us-central1-c",
"namespace": ""
}
},
"metricKind": "GAUGE",
"valueType": "INT64",
"points": [
{
"interval": {
"endTime": "1970-01-01T00:00:00Z"
},
"value": {
"int64Value": "1"
}
}
]
}
]
}
Expand All @@ -169,7 +142,7 @@
"startTime": "1970-01-01T00:00:00Z"
},
"value": {
"int64Value": "3"
"int64Value": "2"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
{
"resourceMetrics": [
{
"resource": {},
"resource": {
"attributes": [
{
"key": "cloud.availability_zone",
"value": {
"stringValue": "us-central1-c"
}
},
{
"key": "service.name",
"value": {
"stringValue": "demo"
}
},
{
"key": "service.instance.id",
"value": {
"stringValue": "10.92.5.2:15692"
}
}
]
},
"scopeMetrics": [
{
"scope": {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
}
},
"resource": {
"type": "generic_node",
"type": "generic_task",
"labels": {
"location": "global",
"job": "demo",
"location": "us-central1-c",
"namespace": "",
"node_id": ""
"task_id": "10.92.5.2:15692"
}
},
"metricKind": "GAUGE",
Expand Down
Loading

0 comments on commit 9e28767

Please sign in to comment.