From 09364feb1d99a6a9e85cc6c27eaefd2af71ad6ea Mon Sep 17 00:00:00 2001 From: Adel Haj Hassan <41540817+adel121@users.noreply.github.com> Date: Fri, 15 Mar 2024 17:02:32 +0100 Subject: [PATCH] remove mutation_errors and update dashboard (#17195) --- .../datadog_cluster_agent_overview.json | 57 +------------------ .../changelog.d/17195.removed | 1 + .../datadog_cluster_agent/check.py | 1 - .../tests/fixtures/metrics.txt | 14 +++-- .../tests/test_datadog_cluster_agent.py | 1 - 5 files changed, 12 insertions(+), 62 deletions(-) create mode 100644 datadog_cluster_agent/changelog.d/17195.removed diff --git a/datadog_cluster_agent/assets/dashboards/datadog_cluster_agent_overview.json b/datadog_cluster_agent/assets/dashboards/datadog_cluster_agent_overview.json index fbdb5c7d3e8bc..9a0faa0642c11 100644 --- a/datadog_cluster_agent/assets/dashboards/datadog_cluster_agent_overview.json +++ b/datadog_cluster_agent/assets/dashboards/datadog_cluster_agent_overview.json @@ -1393,7 +1393,7 @@ { "data_source": "metrics", "name": "query1", - "query": "avg:datadog.cluster_agent.admission_webhooks.mutation_attempts{injected:true,$cluster,$namespace} by {mutation_type}" + "query": "avg:datadog.cluster_agent.admission_webhooks.mutation_attempts{status:success,$cluster,$namespace} by {mutation_type, injected}" } ], "response_format": "timeseries", @@ -1420,59 +1420,6 @@ "height": 2 } }, - { - "id": 4551516642114976, - "definition": { - "title": "Mutation errors by type and reason", - "show_legend": true, - "legend_layout": "auto", - "legend_columns": [ - "avg", - "min", - "max", - "value", - "sum" - ], - "type": "timeseries", - "requests": [ - { - "formulas": [ - { - "formula": "query1" - } - ], - "on_right_yaxis": false, - "queries": [ - { - "data_source": "metrics", - "name": "query1", - "query": "avg:datadog.cluster_agent.admission_webhooks.mutation_errors{$cluster,$namespace} by {mutation_type,reason}" - } - ], - "response_format": "timeseries", - "style": { - "palette": "dog_classic", - "line_type": "solid", - "line_width": "normal" - }, - "display_type": "area" - } - ], - "yaxis": { - "include_zero": true, - "scale": "linear", - "min": "auto", - "max": "auto" - }, - "markers": [] - }, - "layout": { - "x": 8, - "y": 16, - "width": 4, - "height": 2 - } - }, { "id": 1453748622802082, "definition": { @@ -1583,7 +1530,7 @@ { "data_source": "metrics", "name": "query1", - "query": "avg:datadog.cluster_agent.admission_webhooks.mutation_attempts{injected:false,$cluster,$namespace} by {mutation_type}" + "query": "avg:datadog.cluster_agent.admission_webhooks.mutation_attempts{status:error,$cluster,$namespace} by {mutation_type}" } ], "response_format": "timeseries", diff --git a/datadog_cluster_agent/changelog.d/17195.removed b/datadog_cluster_agent/changelog.d/17195.removed new file mode 100644 index 0000000000000..2f30cac04bf9d --- /dev/null +++ b/datadog_cluster_agent/changelog.d/17195.removed @@ -0,0 +1 @@ +removed `admission_webhooks.mutation_errors` metric in the `datadog_cluster_agent` integration diff --git a/datadog_cluster_agent/datadog_checks/datadog_cluster_agent/check.py b/datadog_cluster_agent/datadog_checks/datadog_cluster_agent/check.py index 5b42c06e9daf0..93f9be381bea7 100644 --- a/datadog_cluster_agent/datadog_checks/datadog_cluster_agent/check.py +++ b/datadog_cluster_agent/datadog_checks/datadog_cluster_agent/check.py @@ -9,7 +9,6 @@ 'admission_webhooks_library_injection_attempts': 'admission_webhooks.library_injection_attempts', 'admission_webhooks_library_injection_errors': 'admission_webhooks.library_injection_errors', 'admission_webhooks_mutation_attempts': 'admission_webhooks.mutation_attempts', - 'admission_webhooks_mutation_errors': 'admission_webhooks.mutation_errors', 'admission_webhooks_patcher_attempts': 'admission_webhooks.patcher.attempts', 'admission_webhooks_patcher_completed': 'admission_webhooks.patcher.completed', 'admission_webhooks_patcher_errors': 'admission_webhooks.patcher.errors', diff --git a/datadog_cluster_agent/tests/fixtures/metrics.txt b/datadog_cluster_agent/tests/fixtures/metrics.txt index 0120e0486cd63..6ac3371424dd7 100644 --- a/datadog_cluster_agent/tests/fixtures/metrics.txt +++ b/datadog_cluster_agent/tests/fixtures/metrics.txt @@ -1,12 +1,16 @@ # HELP admission_webhooks_certificate_expiry Time left before the certificate expires in hours. # TYPE admission_webhooks_certificate_expiry gauge admission_webhooks_certificate_expiry 11.083180892013889 -# HELP admission_webhooks_mutation_attempts Number of pod mutation attempts by mutation type (agent config, standard tags). +# HELP admission_webhooks_mutation_attempts Number of pod mutation attempts by mutation type # TYPE admission_webhooks_mutation_attempts gauge -admission_webhooks_mutation_attempts{mutation_type="agent_config"} 100 -# HELP admission_webhooks_mutation_errors Number of mutation failures by mutation type (agent config, standard tags). -# TYPE admission_webhooks_mutation_errors gauge -admission_webhooks_mutation_errors{mutation_type="agent_config"} 1 +admission_webhooks_mutation_attempts{error="",injected="false",mutation_type="agent_sidecar",status="success"} 1 +admission_webhooks_mutation_attempts{error="",injected="false",mutation_type="cws_exec_instrumentation",status="success"} 1 +admission_webhooks_mutation_attempts{error="",injected="false",mutation_type="lib_injection",status="success"} 1 +admission_webhooks_mutation_attempts{error="",injected="false",mutation_type="standard_tags",status="success"} 2 +admission_webhooks_mutation_attempts{error="",injected="true",mutation_type="agent_config",status="success"} 2 +admission_webhooks_mutation_attempts{error="",injected="true",mutation_type="agent_sidecar",status="success"} 1 +admission_webhooks_mutation_attempts{error="",injected="true",mutation_type="cws_pod_instrumentation",status="success"} 2 +admission_webhooks_mutation_attempts{error="",injected="true",mutation_type="lib_injection",status="success"} 1 # HELP admission_webhooks_reconcile_errors Number of reconcile errors per controller. # TYPE admission_webhooks_reconcile_errors gauge admission_webhooks_reconcile_errors{controller="secrets"} 5 diff --git a/datadog_cluster_agent/tests/test_datadog_cluster_agent.py b/datadog_cluster_agent/tests/test_datadog_cluster_agent.py index 1c197d7910c6a..07747d448d463 100644 --- a/datadog_cluster_agent/tests/test_datadog_cluster_agent.py +++ b/datadog_cluster_agent/tests/test_datadog_cluster_agent.py @@ -17,7 +17,6 @@ 'admission_webhooks.library_injection_attempts', 'admission_webhooks.library_injection_errors', 'admission_webhooks.mutation_attempts', - 'admission_webhooks.mutation_errors', 'admission_webhooks.patcher.attempts', 'admission_webhooks.patcher.completed', 'admission_webhooks.patcher.errors',