Skip to content

Commit 9551728

Browse files
authored
[datadog-cluster-agent] Add CWS Instrumentation metrics (#17530)
1 parent 43d9277 commit 9551728

File tree

5 files changed

+35
-0
lines changed

5 files changed

+35
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[datadog-cluster-agent] Add CWS Instrumentation metrics

datadog_cluster_agent/datadog_checks/datadog_cluster_agent/check.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
DEFAULT_METRICS = {
88
'admission_webhooks_certificate_expiry': 'admission_webhooks.certificate_expiry',
9+
'admission_webhooks_cws_exec_instrumentation_attempts': 'admission_webhooks.cws_exec_instrumentation_attempts',
10+
'admission_webhooks_cws_pod_instrumentation_attempts': 'admission_webhooks.cws_pod_instrumentation_attempts',
911
'admission_webhooks_library_injection_attempts': 'admission_webhooks.library_injection_attempts',
1012
'admission_webhooks_library_injection_errors': 'admission_webhooks.library_injection_errors',
1113
'admission_webhooks_mutation_attempts': 'admission_webhooks.mutation_attempts',

datadog_cluster_agent/metadata.csv

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
metric_name,metric_type,interval,unit_name,per_unit_name,description,orientation,integration,short_name,curated_metric
22
datadog.cluster_agent.admission_webhooks.certificate_expiry,gauge,,hour,,Time left before the certificate expires,0,datadog_cluster_agent,admission webhooks certificate expiry,
3+
datadog.cluster_agent.admission_webhooks.cws_exec_instrumentation_attempts.count,count,,,,CWS exec Instrumentation attempts count,0,datadog_cluster_agent,cws exec instrumentation attempts,
4+
datadog.cluster_agent.admission_webhooks.cws_exec_instrumentation_attempts.sum,count,,,,CWS exec Instrumentation attempts sum,0,datadog_cluster_agent,cws exec instrumentation attempts,
5+
datadog.cluster_agent.admission_webhooks.cws_pod_instrumentation_attempts.count,count,,,,CWS pod Instrumentation attempts count,0,datadog_cluster_agent,cws pod instrumentation attempts,
6+
datadog.cluster_agent.admission_webhooks.cws_pod_instrumentation_attempts.sum,count,,,,CWS pod Instrumentation attempts sum,0,datadog_cluster_agent,cws pod instrumentation attempts,
37
datadog.cluster_agent.admission_webhooks.library_injection_attempts,count,,,,"Number of library injection attempts by language",0,datadog_cluster_agent,library injection attempts,
48
datadog.cluster_agent.admission_webhooks.library_injection_errors,count,,,,"Number of library injection failures by language",0,datadog_cluster_agent,library injection errors,
59
datadog.cluster_agent.admission_webhooks.mutation_attempts,gauge,,,,Number of pod mutation attempts by mutation type,0,datadog_cluster_agent,admission webhooks mutation attempts,

datadog_cluster_agent/tests/fixtures/metrics.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,30 @@ admission_webhooks_library_injection_attempts{injected="true",language="java"} 4
424424
# HELP admission_webhooks_library_injection_errors Number of library injection failures by language
425425
# TYPE admission_webhooks_library_injection_errors counter
426426
admission_webhooks_library_injection_errors{language="java"} 1
427+
# HELP admission_webhooks_cws_exec_instrumentation_attempts Distribution of exec requests instrumentation attempts by CWS Instrumentation mode
428+
# TYPE admission_webhooks_cws_exec_instrumentation_attempts histogram
429+
admission_webhooks_cws_exec_instrumentation_attempts_bucket{injected="false",mode="init_container",reason="already_instrumented",le="0"} 0
430+
admission_webhooks_cws_exec_instrumentation_attempts_bucket{injected="false",mode="init_container",reason="already_instrumented",le="+Inf"} 1
431+
admission_webhooks_cws_exec_instrumentation_attempts_sum{injected="false",mode="init_container",reason="already_instrumented"} 1
432+
admission_webhooks_cws_exec_instrumentation_attempts_count{injected="false",mode="init_container",reason="already_instrumented"} 1
433+
admission_webhooks_cws_exec_instrumentation_attempts_bucket{injected="false",mode="init_container",reason="pod_not_instrumented",le="0"} 0
434+
admission_webhooks_cws_exec_instrumentation_attempts_bucket{injected="false",mode="init_container",reason="pod_not_instrumented",le="+Inf"} 2
435+
admission_webhooks_cws_exec_instrumentation_attempts_sum{injected="false",mode="init_container",reason="pod_not_instrumented"} 2
436+
admission_webhooks_cws_exec_instrumentation_attempts_count{injected="false",mode="init_container",reason="pod_not_instrumented"} 2
437+
admission_webhooks_cws_exec_instrumentation_attempts_bucket{injected="true",mode="init_container",reason="",le="0"} 0
438+
admission_webhooks_cws_exec_instrumentation_attempts_bucket{injected="true",mode="init_container",reason="",le="+Inf"} 1
439+
admission_webhooks_cws_exec_instrumentation_attempts_sum{injected="true",mode="init_container",reason=""} 1
440+
admission_webhooks_cws_exec_instrumentation_attempts_count{injected="true",mode="init_container",reason=""} 1
441+
# HELP admission_webhooks_cws_pod_instrumentation_attempts Distribution of pod requests instrumentation attempts by CWS Instrumentation mode
442+
# TYPE admission_webhooks_cws_pod_instrumentation_attempts histogram
443+
admission_webhooks_cws_pod_instrumentation_attempts_bucket{injected="false",mode="init_container",reason="already_instrumented",le="0"} 0
444+
admission_webhooks_cws_pod_instrumentation_attempts_bucket{injected="false",mode="init_container",reason="already_instrumented",le="+Inf"} 1
445+
admission_webhooks_cws_pod_instrumentation_attempts_sum{injected="false",mode="init_container",reason="already_instrumented"} 1
446+
admission_webhooks_cws_pod_instrumentation_attempts_count{injected="false",mode="init_container",reason="already_instrumented"} 1
447+
admission_webhooks_cws_pod_instrumentation_attempts_bucket{injected="true",mode="init_container",reason="",le="0"} 0
448+
admission_webhooks_cws_pod_instrumentation_attempts_bucket{injected="true",mode="init_container",reason="",le="+Inf"} 1
449+
admission_webhooks_cws_pod_instrumentation_attempts_sum{injected="true",mode="init_container",reason=""} 1
450+
admission_webhooks_cws_pod_instrumentation_attempts_count{injected="true",mode="init_container",reason=""} 1
427451
# HELP kubernetes_apiserver_emitted_events Number of events emitted by the check.
428452
# TYPE kubernetes_apiserver_emitted_events counter
429453
kubernetes_apiserver_emitted_events{kind="ConfigMap",type="Normal"} 7

datadog_cluster_agent/tests/test_datadog_cluster_agent.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
METRICS = [
1616
'admission_webhooks.certificate_expiry',
17+
'admission_webhooks.cws_exec_instrumentation_attempts.count',
18+
'admission_webhooks.cws_exec_instrumentation_attempts.sum',
19+
'admission_webhooks.cws_pod_instrumentation_attempts.count',
20+
'admission_webhooks.cws_pod_instrumentation_attempts.sum',
1721
'admission_webhooks.library_injection_attempts',
1822
'admission_webhooks.library_injection_errors',
1923
'admission_webhooks.mutation_attempts',

0 commit comments

Comments
 (0)