diff --git a/deploy/helm/sumologic/conf/metrics/collector/otelcol/config.yaml b/deploy/helm/sumologic/conf/metrics/collector/otelcol/config.yaml index 3df5cd998a..56a1a701b3 100644 --- a/deploy/helm/sumologic/conf/metrics/collector/otelcol/config.yaml +++ b/deploy/helm/sumologic/conf/metrics/collector/otelcol/config.yaml @@ -57,8 +57,8 @@ processors: metric_statements: - context: metric statements: - - extract_sum_metric(true) where IsMatch(name, "^(apiserver_request_duration_seconds|coredns_dns_request_duration_seconds|kubelet_runtime_operations_duration_seconds)$") - - extract_count_metric(true) where IsMatch(name, "^(apiserver_request_duration_seconds|coredns_dns_request_duration_seconds|kubelet_runtime_operations_duration_seconds)$") + - extract_sum_metric(true) where type == METRIC_DATA_TYPE_HISTOGRAM or type == METRIC_DATA_TYPE_EXPONENTIAL_HISTOGRAM + - extract_count_metric(true) where type == METRIC_DATA_TYPE_HISTOGRAM or type == METRIC_DATA_TYPE_EXPONENTIAL_HISTOGRAM {{- end }} receivers: diff --git a/deploy/helm/sumologic/conf/metrics/otelcol/processors.yaml b/deploy/helm/sumologic/conf/metrics/otelcol/processors.yaml index 910adc29a0..91da9a49bd 100644 --- a/deploy/helm/sumologic/conf/metrics/otelcol/processors.yaml +++ b/deploy/helm/sumologic/conf/metrics/otelcol/processors.yaml @@ -16,7 +16,7 @@ filter/drop_unnecessary_metrics: - resource.attributes["job"] != "pod-annotations" and IsMatch(name, "scrape_.*") {{- if .Values.sumologic.metrics.dropHistogramBuckets }} # drop histograms we've extracted sums and counts from, but don't want the full thing - - IsMatch(name, "^(apiserver_request_duration_seconds|coredns_dns_request_duration_seconds|kubelet_runtime_operations_duration_seconds)$") + - type == METRIC_DATA_TYPE_HISTOGRAM or type == METRIC_DATA_TYPE_EXPONENTIAL_HISTOGRAM {{- end }} # Prometheus receiver puts all labels in record-level attributes, and we need them in resource diff --git a/tests/helm/testdata/goldenfile/metadata_metrics_otc/additional_endpoints.output.yaml b/tests/helm/testdata/goldenfile/metadata_metrics_otc/additional_endpoints.output.yaml index ec860318a7..d95ae32fd3 100644 --- a/tests/helm/testdata/goldenfile/metadata_metrics_otc/additional_endpoints.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_metrics_otc/additional_endpoints.output.yaml @@ -44,7 +44,7 @@ data: metrics: metric: - resource.attributes["job"] != "pod-annotations" and IsMatch(name, "scrape_.*") - - IsMatch(name, "^(apiserver_request_duration_seconds|coredns_dns_request_duration_seconds|kubelet_runtime_operations_duration_seconds)$") + - type == METRIC_DATA_TYPE_HISTOGRAM or type == METRIC_DATA_TYPE_EXPONENTIAL_HISTOGRAM groupbyattrs: keys: - container diff --git a/tests/helm/testdata/goldenfile/metadata_metrics_otc/basic.output.yaml b/tests/helm/testdata/goldenfile/metadata_metrics_otc/basic.output.yaml index cffd7c17d4..d2d19260ba 100644 --- a/tests/helm/testdata/goldenfile/metadata_metrics_otc/basic.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_metrics_otc/basic.output.yaml @@ -44,7 +44,7 @@ data: metrics: metric: - resource.attributes["job"] != "pod-annotations" and IsMatch(name, "scrape_.*") - - IsMatch(name, "^(apiserver_request_duration_seconds|coredns_dns_request_duration_seconds|kubelet_runtime_operations_duration_seconds)$") + - type == METRIC_DATA_TYPE_HISTOGRAM or type == METRIC_DATA_TYPE_EXPONENTIAL_HISTOGRAM groupbyattrs: keys: - container diff --git a/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.output.yaml b/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.output.yaml index d21eca4765..8c135c188c 100644 --- a/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.output.yaml @@ -121,7 +121,7 @@ data: metrics: metric: - resource.attributes["job"] != "pod-annotations" and IsMatch(name, "scrape_.*") - - IsMatch(name, "^(apiserver_request_duration_seconds|coredns_dns_request_duration_seconds|kubelet_runtime_operations_duration_seconds)$") + - type == METRIC_DATA_TYPE_HISTOGRAM or type == METRIC_DATA_TYPE_EXPONENTIAL_HISTOGRAM groupbyattrs: keys: - container diff --git a/tests/helm/testdata/goldenfile/metadata_metrics_otc/debug.output.yaml b/tests/helm/testdata/goldenfile/metadata_metrics_otc/debug.output.yaml index 0982f4e5da..121b278dc8 100644 --- a/tests/helm/testdata/goldenfile/metadata_metrics_otc/debug.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_metrics_otc/debug.output.yaml @@ -46,7 +46,7 @@ data: metrics: metric: - resource.attributes["job"] != "pod-annotations" and IsMatch(name, "scrape_.*") - - IsMatch(name, "^(apiserver_request_duration_seconds|coredns_dns_request_duration_seconds|kubelet_runtime_operations_duration_seconds)$") + - type == METRIC_DATA_TYPE_HISTOGRAM or type == METRIC_DATA_TYPE_EXPONENTIAL_HISTOGRAM groupbyattrs: keys: - container diff --git a/tests/helm/testdata/goldenfile/metadata_metrics_otc/debug_with_sumologic_mock.output.yaml b/tests/helm/testdata/goldenfile/metadata_metrics_otc/debug_with_sumologic_mock.output.yaml index 85bb94537c..73191a4a7a 100644 --- a/tests/helm/testdata/goldenfile/metadata_metrics_otc/debug_with_sumologic_mock.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_metrics_otc/debug_with_sumologic_mock.output.yaml @@ -69,7 +69,7 @@ data: metrics: metric: - resource.attributes["job"] != "pod-annotations" and IsMatch(name, "scrape_.*") - - IsMatch(name, "^(apiserver_request_duration_seconds|coredns_dns_request_duration_seconds|kubelet_runtime_operations_duration_seconds)$") + - type == METRIC_DATA_TYPE_HISTOGRAM or type == METRIC_DATA_TYPE_EXPONENTIAL_HISTOGRAM groupbyattrs: keys: - container diff --git a/tests/helm/testdata/goldenfile/metadata_metrics_otc/debug_with_sumologic_mock_http.output.yaml b/tests/helm/testdata/goldenfile/metadata_metrics_otc/debug_with_sumologic_mock_http.output.yaml index b8738cadd4..95ef385cce 100644 --- a/tests/helm/testdata/goldenfile/metadata_metrics_otc/debug_with_sumologic_mock_http.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_metrics_otc/debug_with_sumologic_mock_http.output.yaml @@ -146,7 +146,7 @@ data: metrics: metric: - resource.attributes["job"] != "pod-annotations" and IsMatch(name, "scrape_.*") - - IsMatch(name, "^(apiserver_request_duration_seconds|coredns_dns_request_duration_seconds|kubelet_runtime_operations_duration_seconds)$") + - type == METRIC_DATA_TYPE_HISTOGRAM or type == METRIC_DATA_TYPE_EXPONENTIAL_HISTOGRAM groupbyattrs: keys: - container diff --git a/tests/helm/testdata/goldenfile/metadata_metrics_otc/filtered_app_metrics.output.yaml b/tests/helm/testdata/goldenfile/metadata_metrics_otc/filtered_app_metrics.output.yaml index 2a540b3141..5dc94c165e 100644 --- a/tests/helm/testdata/goldenfile/metadata_metrics_otc/filtered_app_metrics.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_metrics_otc/filtered_app_metrics.output.yaml @@ -68,7 +68,7 @@ data: metrics: metric: - resource.attributes["job"] != "pod-annotations" and IsMatch(name, "scrape_.*") - - IsMatch(name, "^(apiserver_request_duration_seconds|coredns_dns_request_duration_seconds|kubelet_runtime_operations_duration_seconds)$") + - type == METRIC_DATA_TYPE_HISTOGRAM or type == METRIC_DATA_TYPE_EXPONENTIAL_HISTOGRAM groupbyattrs: keys: - container diff --git a/tests/helm/testdata/goldenfile/metrics_collector_otc/basic.output.yaml b/tests/helm/testdata/goldenfile/metrics_collector_otc/basic.output.yaml index d6d6915fb1..e62554af74 100644 --- a/tests/helm/testdata/goldenfile/metrics_collector_otc/basic.output.yaml +++ b/tests/helm/testdata/goldenfile/metrics_collector_otc/basic.output.yaml @@ -115,8 +115,10 @@ spec: metric_statements: - context: metric statements: - - extract_sum_metric(true) where IsMatch(name, "^(apiserver_request_duration_seconds|coredns_dns_request_duration_seconds|kubelet_runtime_operations_duration_seconds)$") - - extract_count_metric(true) where IsMatch(name, "^(apiserver_request_duration_seconds|coredns_dns_request_duration_seconds|kubelet_runtime_operations_duration_seconds)$") + - extract_sum_metric(true) where type == METRIC_DATA_TYPE_HISTOGRAM or type + == METRIC_DATA_TYPE_EXPONENTIAL_HISTOGRAM + - extract_count_metric(true) where type == METRIC_DATA_TYPE_HISTOGRAM or type + == METRIC_DATA_TYPE_EXPONENTIAL_HISTOGRAM receivers: prometheus: config: diff --git a/tests/helm/testdata/goldenfile/metrics_collector_otc/debug.output.yaml b/tests/helm/testdata/goldenfile/metrics_collector_otc/debug.output.yaml index 79717f7786..f2d94c2512 100644 --- a/tests/helm/testdata/goldenfile/metrics_collector_otc/debug.output.yaml +++ b/tests/helm/testdata/goldenfile/metrics_collector_otc/debug.output.yaml @@ -117,8 +117,10 @@ spec: metric_statements: - context: metric statements: - - extract_sum_metric(true) where IsMatch(name, "^(apiserver_request_duration_seconds|coredns_dns_request_duration_seconds|kubelet_runtime_operations_duration_seconds)$") - - extract_count_metric(true) where IsMatch(name, "^(apiserver_request_duration_seconds|coredns_dns_request_duration_seconds|kubelet_runtime_operations_duration_seconds)$") + - extract_sum_metric(true) where type == METRIC_DATA_TYPE_HISTOGRAM or type + == METRIC_DATA_TYPE_EXPONENTIAL_HISTOGRAM + - extract_count_metric(true) where type == METRIC_DATA_TYPE_HISTOGRAM or type + == METRIC_DATA_TYPE_EXPONENTIAL_HISTOGRAM receivers: prometheus: config: diff --git a/tests/helm/testdata/goldenfile/metrics_collector_otc/kubelet.output.yaml b/tests/helm/testdata/goldenfile/metrics_collector_otc/kubelet.output.yaml index d777b6c750..d3086a70fe 100644 --- a/tests/helm/testdata/goldenfile/metrics_collector_otc/kubelet.output.yaml +++ b/tests/helm/testdata/goldenfile/metrics_collector_otc/kubelet.output.yaml @@ -115,8 +115,10 @@ spec: metric_statements: - context: metric statements: - - extract_sum_metric(true) where IsMatch(name, "^(apiserver_request_duration_seconds|coredns_dns_request_duration_seconds|kubelet_runtime_operations_duration_seconds)$") - - extract_count_metric(true) where IsMatch(name, "^(apiserver_request_duration_seconds|coredns_dns_request_duration_seconds|kubelet_runtime_operations_duration_seconds)$") + - extract_sum_metric(true) where type == METRIC_DATA_TYPE_HISTOGRAM or type + == METRIC_DATA_TYPE_EXPONENTIAL_HISTOGRAM + - extract_count_metric(true) where type == METRIC_DATA_TYPE_HISTOGRAM or type + == METRIC_DATA_TYPE_EXPONENTIAL_HISTOGRAM receivers: prometheus: config: