From 0797d0e6ac22dc36f74b5fa9c4592f0c74c33dbb Mon Sep 17 00:00:00 2001 From: Michal Pecenka Date: Mon, 22 Jan 2024 18:45:57 +0100 Subject: [PATCH 1/4] fixing istio duration metric calculation --- deploy/helm/CHANGELOG.md | 6 ++++ deploy/helm/Chart.yaml | 2 +- deploy/helm/node-collector-config.yaml | 11 ++++++- .../logs-fargate-config-map_test.yaml.snap | 4 +-- ...ollector-config-map-windows_test.yaml.snap | 10 ++++++- .../node-collector-config-map_test.yaml.snap | 29 +++++++++++++++++-- 6 files changed, 54 insertions(+), 8 deletions(-) diff --git a/deploy/helm/CHANGELOG.md b/deploy/helm/CHANGELOG.md index 4ec92b59..e1afab59 100644 --- a/deploy/helm/CHANGELOG.md +++ b/deploy/helm/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## [3.2.0-alpha.16] - 2024-01-22 + +### Fixed + +- Fixed how `k8s.istio_request_duration_milliseconds.rate` metric is calculated + ## [3.2.0-alpha.15] - 2024-01-17 ### Fixed diff --git a/deploy/helm/Chart.yaml b/deploy/helm/Chart.yaml index 902e04e1..e3212fd6 100644 --- a/deploy/helm/Chart.yaml +++ b/deploy/helm/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: swo-k8s-collector -version: 3.2.0-alpha.15 +version: 3.2.0-alpha.16 appVersion: "0.9.2" description: SolarWinds Kubernetes Integration keywords: diff --git a/deploy/helm/node-collector-config.yaml b/deploy/helm/node-collector-config.yaml index ea82b9bb..40724331 100644 --- a/deploy/helm/node-collector-config.yaml +++ b/deploy/helm/node-collector-config.yaml @@ -294,13 +294,21 @@ processors: - context: metric statements: - extract_sum_metric(true) where (name == "k8s.istio_request_bytes" or name == "k8s.istio_response_bytes" or name == "k8s.istio_request_duration_milliseconds") + - extract_count_metric(true) where (name == "k8s.istio_request_duration_milliseconds") - set(name, "k8s.istio_request_bytes.rate") where name == "k8s.istio_request_bytes_sum" - set(name, "k8s.istio_response_bytes.rate") where name == "k8s.istio_response_bytes_sum" - - set(name, "k8s.istio_request_duration_milliseconds.rate") where name == "k8s.istio_request_duration_milliseconds_sum" - set(name, "k8s.istio_requests.rate") where name == "k8s.istio_requests_total" - set(name, "k8s.istio_tcp_sent_bytes.rate") where name == "k8s.istio_tcp_sent_bytes_total" - set(name, "k8s.istio_tcp_received_bytes.rate") where name == "k8s.istio_tcp_received_bytes_total" + experimental_metricsgeneration/istio-metrics: + rules: + - name: k8s.istio_request_duration_milliseconds.rate + type: calculate + metric1: k8s.istio_request_duration_milliseconds_sum + metric2: k8s.istio_request_duration_milliseconds_count + operation: divide + metricstransform/istio-metrics: transforms: - include: k8s.istio_request_bytes.rate @@ -631,6 +639,7 @@ service: {{- end }} - metricstransform/rename - transform/istio-metrics + - experimental_metricsgeneration/istio-metrics - metricstransform/istio-metrics - cumulativetodelta/istio-metrics - deltatorate/istio-metrics diff --git a/deploy/helm/tests/__snapshot__/logs-fargate-config-map_test.yaml.snap b/deploy/helm/tests/__snapshot__/logs-fargate-config-map_test.yaml.snap index 05e9101b..4adfa2d3 100644 --- a/deploy/helm/tests/__snapshot__/logs-fargate-config-map_test.yaml.snap +++ b/deploy/helm/tests/__snapshot__/logs-fargate-config-map_test.yaml.snap @@ -24,7 +24,7 @@ Fargate logging ConfigMap spec should include additional filters when they are c Match * Add sw.k8s.cluster.uid Add sw.k8s.log.type container - Add sw.k8s.agent.manifest.version "3.2.0-alpha.15" + Add sw.k8s.agent.manifest.version "3.2.0-alpha.16" flb_log_cw: "false" output.conf: | [OUTPUT] @@ -64,7 +64,7 @@ Fargate logging ConfigMap spec should match snapshot when Fargate logging is ena Match * Add sw.k8s.cluster.uid Add sw.k8s.log.type container - Add sw.k8s.agent.manifest.version "3.2.0-alpha.15" + Add sw.k8s.agent.manifest.version "3.2.0-alpha.16" flb_log_cw: "false" output.conf: | [OUTPUT] diff --git a/deploy/helm/tests/__snapshot__/node-collector-config-map-windows_test.yaml.snap b/deploy/helm/tests/__snapshot__/node-collector-config-map-windows_test.yaml.snap index fec7cd24..77aa471c 100644 --- a/deploy/helm/tests/__snapshot__/node-collector-config-map-windows_test.yaml.snap +++ b/deploy/helm/tests/__snapshot__/node-collector-config-map-windows_test.yaml.snap @@ -150,6 +150,13 @@ Node collector config for windows nodes should match snapshot when using default - k8s.istio_requests.rate - k8s.istio_tcp_sent_bytes.rate - k8s.istio_tcp_received_bytes.rate + experimental_metricsgeneration/istio-metrics: + rules: + - metric1: k8s.istio_request_duration_milliseconds_sum + metric2: k8s.istio_request_duration_milliseconds_count + name: k8s.istio_request_duration_milliseconds.rate + operation: divide + type: calculate filter/histograms: metrics: metric: @@ -889,9 +896,9 @@ Node collector config for windows nodes should match snapshot when using default statements: - extract_sum_metric(true) where (name == "k8s.istio_request_bytes" or name == "k8s.istio_response_bytes" or name == "k8s.istio_request_duration_milliseconds") + - extract_count_metric(true) where (name == "k8s.istio_request_duration_milliseconds") - set(name, "k8s.istio_request_bytes.rate") where name == "k8s.istio_request_bytes_sum" - set(name, "k8s.istio_response_bytes.rate") where name == "k8s.istio_response_bytes_sum" - - set(name, "k8s.istio_request_duration_milliseconds.rate") where name == "k8s.istio_request_duration_milliseconds_sum" - set(name, "k8s.istio_requests.rate") where name == "k8s.istio_requests_total" - set(name, "k8s.istio_tcp_sent_bytes.rate") where name == "k8s.istio_tcp_sent_bytes_total" - set(name, "k8s.istio_tcp_received_bytes.rate") where name == "k8s.istio_tcp_received_bytes_total" @@ -1108,6 +1115,7 @@ Node collector config for windows nodes should match snapshot when using default - memory_limiter - metricstransform/rename - transform/istio-metrics + - experimental_metricsgeneration/istio-metrics - metricstransform/istio-metrics - cumulativetodelta/istio-metrics - deltatorate/istio-metrics diff --git a/deploy/helm/tests/__snapshot__/node-collector-config-map_test.yaml.snap b/deploy/helm/tests/__snapshot__/node-collector-config-map_test.yaml.snap index 3f1d46a5..c3649302 100644 --- a/deploy/helm/tests/__snapshot__/node-collector-config-map_test.yaml.snap +++ b/deploy/helm/tests/__snapshot__/node-collector-config-map_test.yaml.snap @@ -150,6 +150,13 @@ Node collector config should match snapshot when autodiscovery is disabled: - k8s.istio_requests.rate - k8s.istio_tcp_sent_bytes.rate - k8s.istio_tcp_received_bytes.rate + experimental_metricsgeneration/istio-metrics: + rules: + - metric1: k8s.istio_request_duration_milliseconds_sum + metric2: k8s.istio_request_duration_milliseconds_count + name: k8s.istio_request_duration_milliseconds.rate + operation: divide + type: calculate filter/histograms: metrics: metric: @@ -909,9 +916,9 @@ Node collector config should match snapshot when autodiscovery is disabled: statements: - extract_sum_metric(true) where (name == "k8s.istio_request_bytes" or name == "k8s.istio_response_bytes" or name == "k8s.istio_request_duration_milliseconds") + - extract_count_metric(true) where (name == "k8s.istio_request_duration_milliseconds") - set(name, "k8s.istio_request_bytes.rate") where name == "k8s.istio_request_bytes_sum" - set(name, "k8s.istio_response_bytes.rate") where name == "k8s.istio_response_bytes_sum" - - set(name, "k8s.istio_request_duration_milliseconds.rate") where name == "k8s.istio_request_duration_milliseconds_sum" - set(name, "k8s.istio_requests.rate") where name == "k8s.istio_requests_total" - set(name, "k8s.istio_tcp_sent_bytes.rate") where name == "k8s.istio_tcp_sent_bytes_total" - set(name, "k8s.istio_tcp_received_bytes.rate") where name == "k8s.istio_tcp_received_bytes_total" @@ -1296,6 +1303,13 @@ Node collector config should match snapshot when fargate is enabled: - k8s.istio_requests.rate - k8s.istio_tcp_sent_bytes.rate - k8s.istio_tcp_received_bytes.rate + experimental_metricsgeneration/istio-metrics: + rules: + - metric1: k8s.istio_request_duration_milliseconds_sum + metric2: k8s.istio_request_duration_milliseconds_count + name: k8s.istio_request_duration_milliseconds.rate + operation: divide + type: calculate filter/histograms: metrics: metric: @@ -2055,9 +2069,9 @@ Node collector config should match snapshot when fargate is enabled: statements: - extract_sum_metric(true) where (name == "k8s.istio_request_bytes" or name == "k8s.istio_response_bytes" or name == "k8s.istio_request_duration_milliseconds") + - extract_count_metric(true) where (name == "k8s.istio_request_duration_milliseconds") - set(name, "k8s.istio_request_bytes.rate") where name == "k8s.istio_request_bytes_sum" - set(name, "k8s.istio_response_bytes.rate") where name == "k8s.istio_response_bytes_sum" - - set(name, "k8s.istio_request_duration_milliseconds.rate") where name == "k8s.istio_request_duration_milliseconds_sum" - set(name, "k8s.istio_requests.rate") where name == "k8s.istio_requests_total" - set(name, "k8s.istio_tcp_sent_bytes.rate") where name == "k8s.istio_tcp_sent_bytes_total" - set(name, "k8s.istio_tcp_received_bytes.rate") where name == "k8s.istio_tcp_received_bytes_total" @@ -2241,6 +2255,7 @@ Node collector config should match snapshot when fargate is enabled: - memory_limiter - metricstransform/rename - transform/istio-metrics + - experimental_metricsgeneration/istio-metrics - metricstransform/istio-metrics - cumulativetodelta/istio-metrics - deltatorate/istio-metrics @@ -2408,6 +2423,13 @@ Node collector config should match snapshot when using default values: - k8s.istio_requests.rate - k8s.istio_tcp_sent_bytes.rate - k8s.istio_tcp_received_bytes.rate + experimental_metricsgeneration/istio-metrics: + rules: + - metric1: k8s.istio_request_duration_milliseconds_sum + metric2: k8s.istio_request_duration_milliseconds_count + name: k8s.istio_request_duration_milliseconds.rate + operation: divide + type: calculate filter/histograms: metrics: metric: @@ -3167,9 +3189,9 @@ Node collector config should match snapshot when using default values: statements: - extract_sum_metric(true) where (name == "k8s.istio_request_bytes" or name == "k8s.istio_response_bytes" or name == "k8s.istio_request_duration_milliseconds") + - extract_count_metric(true) where (name == "k8s.istio_request_duration_milliseconds") - set(name, "k8s.istio_request_bytes.rate") where name == "k8s.istio_request_bytes_sum" - set(name, "k8s.istio_response_bytes.rate") where name == "k8s.istio_response_bytes_sum" - - set(name, "k8s.istio_request_duration_milliseconds.rate") where name == "k8s.istio_request_duration_milliseconds_sum" - set(name, "k8s.istio_requests.rate") where name == "k8s.istio_requests_total" - set(name, "k8s.istio_tcp_sent_bytes.rate") where name == "k8s.istio_tcp_sent_bytes_total" - set(name, "k8s.istio_tcp_received_bytes.rate") where name == "k8s.istio_tcp_received_bytes_total" @@ -3400,6 +3422,7 @@ Node collector config should match snapshot when using default values: - memory_limiter - metricstransform/rename - transform/istio-metrics + - experimental_metricsgeneration/istio-metrics - metricstransform/istio-metrics - cumulativetodelta/istio-metrics - deltatorate/istio-metrics From f3b58c77ef4c59cbb33e14f5a568555dcbb33c37 Mon Sep 17 00:00:00 2001 From: Michal Pecenka Date: Tue, 23 Jan 2024 11:25:25 +0100 Subject: [PATCH 2/4] fixing calculation --- deploy/helm/node-collector-config.yaml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/deploy/helm/node-collector-config.yaml b/deploy/helm/node-collector-config.yaml index 40724331..38f74700 100644 --- a/deploy/helm/node-collector-config.yaml +++ b/deploy/helm/node-collector-config.yaml @@ -301,14 +301,6 @@ processors: - set(name, "k8s.istio_tcp_sent_bytes.rate") where name == "k8s.istio_tcp_sent_bytes_total" - set(name, "k8s.istio_tcp_received_bytes.rate") where name == "k8s.istio_tcp_received_bytes_total" - experimental_metricsgeneration/istio-metrics: - rules: - - name: k8s.istio_request_duration_milliseconds.rate - type: calculate - metric1: k8s.istio_request_duration_milliseconds_sum - metric2: k8s.istio_request_duration_milliseconds_count - operation: divide - metricstransform/istio-metrics: transforms: - include: k8s.istio_request_bytes.rate @@ -332,7 +324,7 @@ processors: metrics: - k8s.istio_request_bytes.rate - k8s.istio_response_bytes.rate - - k8s.istio_request_duration_milliseconds.rate + - k8s.istio_request_duration_milliseconds_sum - k8s.istio_requests.rate - k8s.istio_tcp_sent_bytes.rate - k8s.istio_tcp_received_bytes.rate @@ -347,11 +339,20 @@ processors: metrics: - k8s.istio_request_bytes.rate - k8s.istio_response_bytes.rate - - k8s.istio_request_duration_milliseconds.rate + - k8s.istio_request_duration_milliseconds_sum - k8s.istio_requests.rate - k8s.istio_tcp_sent_bytes.rate - k8s.istio_tcp_received_bytes.rate + experimental_metricsgeneration/istio-metrics: + rules: + - name: k8s.istio_request_duration_milliseconds.rate + type: calculate + metric1: k8s.istio_request_duration_milliseconds_sum + metric2: k8s.istio_request_duration_milliseconds_count + operation: divide + + connectors: {{- if and .Values.otel.metrics.enabled (or (not .Values.aws_fargate.enabled) .Values.otel.metrics.autodiscovery.prometheusEndpoints.enabled) }} forward/metric-exporter: @@ -639,10 +640,10 @@ service: {{- end }} - metricstransform/rename - transform/istio-metrics - - experimental_metricsgeneration/istio-metrics - metricstransform/istio-metrics - cumulativetodelta/istio-metrics - deltatorate/istio-metrics + - experimental_metricsgeneration/istio-metrics {{- if .Values.otel.metrics.autodiscovery.prometheusEndpoints.customTransformations.counterToRate }} - cumulativetodelta/discovery - deltatorate/discovery From 94a2b2e154c65365a7f8ceb71c17bd5350167c03 Mon Sep 17 00:00:00 2001 From: Michal Pecenka Date: Tue, 23 Jan 2024 12:13:25 +0100 Subject: [PATCH 3/4] fixing calculation --- deploy/helm/Chart.yaml | 2 +- deploy/helm/node-collector-config.yaml | 15 ++++-- ...ollector-config-map-windows_test.yaml.snap | 17 +++++-- .../node-collector-config-map_test.yaml.snap | 48 +++++++++++++------ 4 files changed, 58 insertions(+), 24 deletions(-) diff --git a/deploy/helm/Chart.yaml b/deploy/helm/Chart.yaml index e3212fd6..92756b6e 100644 --- a/deploy/helm/Chart.yaml +++ b/deploy/helm/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: swo-k8s-collector -version: 3.2.0-alpha.16 +version: 3.2.0-alpha.17 appVersion: "0.9.2" description: SolarWinds Kubernetes Integration keywords: diff --git a/deploy/helm/node-collector-config.yaml b/deploy/helm/node-collector-config.yaml index 38f74700..720b84ae 100644 --- a/deploy/helm/node-collector-config.yaml +++ b/deploy/helm/node-collector-config.yaml @@ -300,6 +300,8 @@ processors: - set(name, "k8s.istio_requests.rate") where name == "k8s.istio_requests_total" - set(name, "k8s.istio_tcp_sent_bytes.rate") where name == "k8s.istio_tcp_sent_bytes_total" - set(name, "k8s.istio_tcp_received_bytes.rate") where name == "k8s.istio_tcp_received_bytes_total" + - set(name, "k8s.istio_request_duration_milliseconds_sum_temp") where name == "k8s.istio_request_duration_milliseconds_sum" + - set(name, "k8s.istio_request_duration_milliseconds_count_temp") where name == "k8s.istio_request_duration_milliseconds_count" metricstransform/istio-metrics: transforms: @@ -324,7 +326,8 @@ processors: metrics: - k8s.istio_request_bytes.rate - k8s.istio_response_bytes.rate - - k8s.istio_request_duration_milliseconds_sum + - k8s.istio_request_duration_milliseconds_sum_temp + - k8s.istio_request_duration_milliseconds_count_temp - k8s.istio_requests.rate - k8s.istio_tcp_sent_bytes.rate - k8s.istio_tcp_received_bytes.rate @@ -339,7 +342,8 @@ processors: metrics: - k8s.istio_request_bytes.rate - k8s.istio_response_bytes.rate - - k8s.istio_request_duration_milliseconds_sum + - k8s.istio_request_duration_milliseconds_sum_temp + - k8s.istio_request_duration_milliseconds_count_temp - k8s.istio_requests.rate - k8s.istio_tcp_sent_bytes.rate - k8s.istio_tcp_received_bytes.rate @@ -348,8 +352,8 @@ processors: rules: - name: k8s.istio_request_duration_milliseconds.rate type: calculate - metric1: k8s.istio_request_duration_milliseconds_sum - metric2: k8s.istio_request_duration_milliseconds_count + metric1: k8s.istio_request_duration_milliseconds_sum_temp + metric2: k8s.istio_request_duration_milliseconds_count_temp operation: divide @@ -649,6 +653,9 @@ service: - deltatorate/discovery {{- end }} - groupbyattrs/common-all +{{- if .Values.otel.metrics.filter }} + - filter/metrics +{{- end }} - resource/all receivers: - receiver_creator/discovery diff --git a/deploy/helm/tests/__snapshot__/node-collector-config-map-windows_test.yaml.snap b/deploy/helm/tests/__snapshot__/node-collector-config-map-windows_test.yaml.snap index 77aa471c..d4f70e2b 100644 --- a/deploy/helm/tests/__snapshot__/node-collector-config-map-windows_test.yaml.snap +++ b/deploy/helm/tests/__snapshot__/node-collector-config-map-windows_test.yaml.snap @@ -104,7 +104,8 @@ Node collector config for windows nodes should match snapshot when using default metrics: - k8s.istio_request_bytes.rate - k8s.istio_response_bytes.rate - - k8s.istio_request_duration_milliseconds.rate + - k8s.istio_request_duration_milliseconds_sum_temp + - k8s.istio_request_duration_milliseconds_count_temp - k8s.istio_requests.rate - k8s.istio_tcp_sent_bytes.rate - k8s.istio_tcp_received_bytes.rate @@ -146,14 +147,15 @@ Node collector config for windows nodes should match snapshot when using default metrics: - k8s.istio_request_bytes.rate - k8s.istio_response_bytes.rate - - k8s.istio_request_duration_milliseconds.rate + - k8s.istio_request_duration_milliseconds_sum_temp + - k8s.istio_request_duration_milliseconds_count_temp - k8s.istio_requests.rate - k8s.istio_tcp_sent_bytes.rate - k8s.istio_tcp_received_bytes.rate experimental_metricsgeneration/istio-metrics: rules: - - metric1: k8s.istio_request_duration_milliseconds_sum - metric2: k8s.istio_request_duration_milliseconds_count + - metric1: k8s.istio_request_duration_milliseconds_sum_temp + metric2: k8s.istio_request_duration_milliseconds_count_temp name: k8s.istio_request_duration_milliseconds.rate operation: divide type: calculate @@ -902,6 +904,10 @@ Node collector config for windows nodes should match snapshot when using default - set(name, "k8s.istio_requests.rate") where name == "k8s.istio_requests_total" - set(name, "k8s.istio_tcp_sent_bytes.rate") where name == "k8s.istio_tcp_sent_bytes_total" - set(name, "k8s.istio_tcp_received_bytes.rate") where name == "k8s.istio_tcp_received_bytes_total" + - set(name, "k8s.istio_request_duration_milliseconds_sum_temp") where name == + "k8s.istio_request_duration_milliseconds_sum" + - set(name, "k8s.istio_request_duration_milliseconds_count_temp") where name + == "k8s.istio_request_duration_milliseconds_count" transform/syslogify: error_mode: ignore log_statements: @@ -1115,11 +1121,12 @@ Node collector config for windows nodes should match snapshot when using default - memory_limiter - metricstransform/rename - transform/istio-metrics - - experimental_metricsgeneration/istio-metrics - metricstransform/istio-metrics - cumulativetodelta/istio-metrics - deltatorate/istio-metrics + - experimental_metricsgeneration/istio-metrics - groupbyattrs/common-all + - filter/metrics - resource/all receivers: - receiver_creator/discovery diff --git a/deploy/helm/tests/__snapshot__/node-collector-config-map_test.yaml.snap b/deploy/helm/tests/__snapshot__/node-collector-config-map_test.yaml.snap index c3649302..5ef5e6b5 100644 --- a/deploy/helm/tests/__snapshot__/node-collector-config-map_test.yaml.snap +++ b/deploy/helm/tests/__snapshot__/node-collector-config-map_test.yaml.snap @@ -104,7 +104,8 @@ Node collector config should match snapshot when autodiscovery is disabled: metrics: - k8s.istio_request_bytes.rate - k8s.istio_response_bytes.rate - - k8s.istio_request_duration_milliseconds.rate + - k8s.istio_request_duration_milliseconds_sum_temp + - k8s.istio_request_duration_milliseconds_count_temp - k8s.istio_requests.rate - k8s.istio_tcp_sent_bytes.rate - k8s.istio_tcp_received_bytes.rate @@ -146,14 +147,15 @@ Node collector config should match snapshot when autodiscovery is disabled: metrics: - k8s.istio_request_bytes.rate - k8s.istio_response_bytes.rate - - k8s.istio_request_duration_milliseconds.rate + - k8s.istio_request_duration_milliseconds_sum_temp + - k8s.istio_request_duration_milliseconds_count_temp - k8s.istio_requests.rate - k8s.istio_tcp_sent_bytes.rate - k8s.istio_tcp_received_bytes.rate experimental_metricsgeneration/istio-metrics: rules: - - metric1: k8s.istio_request_duration_milliseconds_sum - metric2: k8s.istio_request_duration_milliseconds_count + - metric1: k8s.istio_request_duration_milliseconds_sum_temp + metric2: k8s.istio_request_duration_milliseconds_count_temp name: k8s.istio_request_duration_milliseconds.rate operation: divide type: calculate @@ -922,6 +924,10 @@ Node collector config should match snapshot when autodiscovery is disabled: - set(name, "k8s.istio_requests.rate") where name == "k8s.istio_requests_total" - set(name, "k8s.istio_tcp_sent_bytes.rate") where name == "k8s.istio_tcp_sent_bytes_total" - set(name, "k8s.istio_tcp_received_bytes.rate") where name == "k8s.istio_tcp_received_bytes_total" + - set(name, "k8s.istio_request_duration_milliseconds_sum_temp") where name == + "k8s.istio_request_duration_milliseconds_sum" + - set(name, "k8s.istio_request_duration_milliseconds_count_temp") where name + == "k8s.istio_request_duration_milliseconds_count" transform/syslogify: error_mode: ignore log_statements: @@ -1257,7 +1263,8 @@ Node collector config should match snapshot when fargate is enabled: metrics: - k8s.istio_request_bytes.rate - k8s.istio_response_bytes.rate - - k8s.istio_request_duration_milliseconds.rate + - k8s.istio_request_duration_milliseconds_sum_temp + - k8s.istio_request_duration_milliseconds_count_temp - k8s.istio_requests.rate - k8s.istio_tcp_sent_bytes.rate - k8s.istio_tcp_received_bytes.rate @@ -1299,14 +1306,15 @@ Node collector config should match snapshot when fargate is enabled: metrics: - k8s.istio_request_bytes.rate - k8s.istio_response_bytes.rate - - k8s.istio_request_duration_milliseconds.rate + - k8s.istio_request_duration_milliseconds_sum_temp + - k8s.istio_request_duration_milliseconds_count_temp - k8s.istio_requests.rate - k8s.istio_tcp_sent_bytes.rate - k8s.istio_tcp_received_bytes.rate experimental_metricsgeneration/istio-metrics: rules: - - metric1: k8s.istio_request_duration_milliseconds_sum - metric2: k8s.istio_request_duration_milliseconds_count + - metric1: k8s.istio_request_duration_milliseconds_sum_temp + metric2: k8s.istio_request_duration_milliseconds_count_temp name: k8s.istio_request_duration_milliseconds.rate operation: divide type: calculate @@ -2075,6 +2083,10 @@ Node collector config should match snapshot when fargate is enabled: - set(name, "k8s.istio_requests.rate") where name == "k8s.istio_requests_total" - set(name, "k8s.istio_tcp_sent_bytes.rate") where name == "k8s.istio_tcp_sent_bytes_total" - set(name, "k8s.istio_tcp_received_bytes.rate") where name == "k8s.istio_tcp_received_bytes_total" + - set(name, "k8s.istio_request_duration_milliseconds_sum_temp") where name == + "k8s.istio_request_duration_milliseconds_sum" + - set(name, "k8s.istio_request_duration_milliseconds_count_temp") where name + == "k8s.istio_request_duration_milliseconds_count" transform/syslogify: error_mode: ignore log_statements: @@ -2255,11 +2267,12 @@ Node collector config should match snapshot when fargate is enabled: - memory_limiter - metricstransform/rename - transform/istio-metrics - - experimental_metricsgeneration/istio-metrics - metricstransform/istio-metrics - cumulativetodelta/istio-metrics - deltatorate/istio-metrics + - experimental_metricsgeneration/istio-metrics - groupbyattrs/common-all + - filter/metrics - resource/all receivers: - receiver_creator/discovery @@ -2377,7 +2390,8 @@ Node collector config should match snapshot when using default values: metrics: - k8s.istio_request_bytes.rate - k8s.istio_response_bytes.rate - - k8s.istio_request_duration_milliseconds.rate + - k8s.istio_request_duration_milliseconds_sum_temp + - k8s.istio_request_duration_milliseconds_count_temp - k8s.istio_requests.rate - k8s.istio_tcp_sent_bytes.rate - k8s.istio_tcp_received_bytes.rate @@ -2419,14 +2433,15 @@ Node collector config should match snapshot when using default values: metrics: - k8s.istio_request_bytes.rate - k8s.istio_response_bytes.rate - - k8s.istio_request_duration_milliseconds.rate + - k8s.istio_request_duration_milliseconds_sum_temp + - k8s.istio_request_duration_milliseconds_count_temp - k8s.istio_requests.rate - k8s.istio_tcp_sent_bytes.rate - k8s.istio_tcp_received_bytes.rate experimental_metricsgeneration/istio-metrics: rules: - - metric1: k8s.istio_request_duration_milliseconds_sum - metric2: k8s.istio_request_duration_milliseconds_count + - metric1: k8s.istio_request_duration_milliseconds_sum_temp + metric2: k8s.istio_request_duration_milliseconds_count_temp name: k8s.istio_request_duration_milliseconds.rate operation: divide type: calculate @@ -3195,6 +3210,10 @@ Node collector config should match snapshot when using default values: - set(name, "k8s.istio_requests.rate") where name == "k8s.istio_requests_total" - set(name, "k8s.istio_tcp_sent_bytes.rate") where name == "k8s.istio_tcp_sent_bytes_total" - set(name, "k8s.istio_tcp_received_bytes.rate") where name == "k8s.istio_tcp_received_bytes_total" + - set(name, "k8s.istio_request_duration_milliseconds_sum_temp") where name == + "k8s.istio_request_duration_milliseconds_sum" + - set(name, "k8s.istio_request_duration_milliseconds_count_temp") where name + == "k8s.istio_request_duration_milliseconds_count" transform/syslogify: error_mode: ignore log_statements: @@ -3422,11 +3441,12 @@ Node collector config should match snapshot when using default values: - memory_limiter - metricstransform/rename - transform/istio-metrics - - experimental_metricsgeneration/istio-metrics - metricstransform/istio-metrics - cumulativetodelta/istio-metrics - deltatorate/istio-metrics + - experimental_metricsgeneration/istio-metrics - groupbyattrs/common-all + - filter/metrics - resource/all receivers: - receiver_creator/discovery From 61b0941b74921019e13549ab6746e738ef27d931 Mon Sep 17 00:00:00 2001 From: Michal Pecenka Date: Tue, 23 Jan 2024 12:16:02 +0100 Subject: [PATCH 4/4] updating tests --- .../logs-fargate-config-map_test.yaml.snap | 4 ++-- .../node-collector-config-map_test.yaml.snap | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/deploy/helm/tests/__snapshot__/logs-fargate-config-map_test.yaml.snap b/deploy/helm/tests/__snapshot__/logs-fargate-config-map_test.yaml.snap index 4adfa2d3..cc5540cd 100644 --- a/deploy/helm/tests/__snapshot__/logs-fargate-config-map_test.yaml.snap +++ b/deploy/helm/tests/__snapshot__/logs-fargate-config-map_test.yaml.snap @@ -24,7 +24,7 @@ Fargate logging ConfigMap spec should include additional filters when they are c Match * Add sw.k8s.cluster.uid Add sw.k8s.log.type container - Add sw.k8s.agent.manifest.version "3.2.0-alpha.16" + Add sw.k8s.agent.manifest.version "3.2.0-alpha.17" flb_log_cw: "false" output.conf: | [OUTPUT] @@ -64,7 +64,7 @@ Fargate logging ConfigMap spec should match snapshot when Fargate logging is ena Match * Add sw.k8s.cluster.uid Add sw.k8s.log.type container - Add sw.k8s.agent.manifest.version "3.2.0-alpha.16" + Add sw.k8s.agent.manifest.version "3.2.0-alpha.17" flb_log_cw: "false" output.conf: | [OUTPUT] diff --git a/deploy/helm/tests/__snapshot__/node-collector-config-map_test.yaml.snap b/deploy/helm/tests/__snapshot__/node-collector-config-map_test.yaml.snap index ac58b15b..46f641a9 100644 --- a/deploy/helm/tests/__snapshot__/node-collector-config-map_test.yaml.snap +++ b/deploy/helm/tests/__snapshot__/node-collector-config-map_test.yaml.snap @@ -2391,7 +2391,8 @@ Node collector config should match snapshot when fargate is enabled and autodisc metrics: - k8s.istio_request_bytes.rate - k8s.istio_response_bytes.rate - - k8s.istio_request_duration_milliseconds.rate + - k8s.istio_request_duration_milliseconds_sum_temp + - k8s.istio_request_duration_milliseconds_count_temp - k8s.istio_requests.rate - k8s.istio_tcp_sent_bytes.rate - k8s.istio_tcp_received_bytes.rate @@ -2433,10 +2434,18 @@ Node collector config should match snapshot when fargate is enabled and autodisc metrics: - k8s.istio_request_bytes.rate - k8s.istio_response_bytes.rate - - k8s.istio_request_duration_milliseconds.rate + - k8s.istio_request_duration_milliseconds_sum_temp + - k8s.istio_request_duration_milliseconds_count_temp - k8s.istio_requests.rate - k8s.istio_tcp_sent_bytes.rate - k8s.istio_tcp_received_bytes.rate + experimental_metricsgeneration/istio-metrics: + rules: + - metric1: k8s.istio_request_duration_milliseconds_sum_temp + metric2: k8s.istio_request_duration_milliseconds_count_temp + name: k8s.istio_request_duration_milliseconds.rate + operation: divide + type: calculate filter/histograms: metrics: metric: @@ -3196,12 +3205,16 @@ Node collector config should match snapshot when fargate is enabled and autodisc statements: - extract_sum_metric(true) where (name == "k8s.istio_request_bytes" or name == "k8s.istio_response_bytes" or name == "k8s.istio_request_duration_milliseconds") + - extract_count_metric(true) where (name == "k8s.istio_request_duration_milliseconds") - set(name, "k8s.istio_request_bytes.rate") where name == "k8s.istio_request_bytes_sum" - set(name, "k8s.istio_response_bytes.rate") where name == "k8s.istio_response_bytes_sum" - - set(name, "k8s.istio_request_duration_milliseconds.rate") where name == "k8s.istio_request_duration_milliseconds_sum" - set(name, "k8s.istio_requests.rate") where name == "k8s.istio_requests_total" - set(name, "k8s.istio_tcp_sent_bytes.rate") where name == "k8s.istio_tcp_sent_bytes_total" - set(name, "k8s.istio_tcp_received_bytes.rate") where name == "k8s.istio_tcp_received_bytes_total" + - set(name, "k8s.istio_request_duration_milliseconds_sum_temp") where name == + "k8s.istio_request_duration_milliseconds_sum" + - set(name, "k8s.istio_request_duration_milliseconds_count_temp") where name + == "k8s.istio_request_duration_milliseconds_count" transform/syslogify: error_mode: ignore log_statements: