Skip to content

Commit 6ac2dfc

Browse files
committed
[cluster-agent] Add new cws instrumentation metrics
1 parent 5ca83b8 commit 6ac2dfc

File tree

4 files changed

+35
-34
lines changed

4 files changed

+35
-34
lines changed

datadog_cluster_agent/datadog_checks/datadog_cluster_agent/check.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
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',
9+
'admission_webhooks_cws_exec_mutation_attempts': 'admission_webhooks.cws_exec_mutation_attempts',
10+
'admission_webhooks_cws_pod_mutation_attempts': 'admission_webhooks.cws_pod_mutation_attempts',
11+
'admission_webhooks_cws_response_duration': 'admission_webhooks.cws_response_duration',
1112
'admission_webhooks_library_injection_attempts': 'admission_webhooks.library_injection_attempts',
1213
'admission_webhooks_library_injection_errors': 'admission_webhooks.library_injection_errors',
1314
'admission_webhooks_mutation_attempts': 'admission_webhooks.mutation_attempts',

datadog_cluster_agent/metadata.csv

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +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,
3+
datadog.cluster_agent.admission_webhooks.cws_response_duration.count,count,,,,CWS mutating webhook response duration count,0,datadog_cluster_agent,cws response duration count,
4+
datadog.cluster_agent.admission_webhooks.cws_response_duration.sum,count,,,,CWS mutating webhook response duration sum,0,datadog_cluster_agent,cws response duration sum,
5+
datadog.cluster_agent.admission_webhooks.cws_exec_mutation_attempts,count,,,,Number of CWS exec mutation attempts by reason and status,0,datadog_cluster_agent,cws exec mutation attempts,
6+
datadog.cluster_agent.admission_webhooks.cws_pod_mutation_attempts,count,,,,Number of CWS pod mutation attempts by reason and status,0,datadog_cluster_agent,cws pod mutation attempts,
77
datadog.cluster_agent.admission_webhooks.library_injection_attempts,count,,,,Number of library injection attempts by language,0,datadog_cluster_agent,library injection attempts,
88
datadog.cluster_agent.admission_webhooks.library_injection_errors,count,,,,Number of library injection failures by language,0,datadog_cluster_agent,library injection errors,
99
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 & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -430,30 +430,30 @@ admission_webhooks_library_injection_attempts{injected="true",language="java"} 4
430430
# HELP admission_webhooks_library_injection_errors Number of library injection failures by language
431431
# TYPE admission_webhooks_library_injection_errors counter
432432
admission_webhooks_library_injection_errors{language="java"} 1
433-
# HELP admission_webhooks_cws_exec_instrumentation_attempts Distribution of exec requests instrumentation attempts by CWS Instrumentation mode
434-
# TYPE admission_webhooks_cws_exec_instrumentation_attempts histogram
435-
admission_webhooks_cws_exec_instrumentation_attempts_bucket{injected="false",mode="init_container",reason="already_instrumented",le="0"} 0
436-
admission_webhooks_cws_exec_instrumentation_attempts_bucket{injected="false",mode="init_container",reason="already_instrumented",le="+Inf"} 1
437-
admission_webhooks_cws_exec_instrumentation_attempts_sum{injected="false",mode="init_container",reason="already_instrumented"} 1
438-
admission_webhooks_cws_exec_instrumentation_attempts_count{injected="false",mode="init_container",reason="already_instrumented"} 1
439-
admission_webhooks_cws_exec_instrumentation_attempts_bucket{injected="false",mode="init_container",reason="pod_not_instrumented",le="0"} 0
440-
admission_webhooks_cws_exec_instrumentation_attempts_bucket{injected="false",mode="init_container",reason="pod_not_instrumented",le="+Inf"} 2
441-
admission_webhooks_cws_exec_instrumentation_attempts_sum{injected="false",mode="init_container",reason="pod_not_instrumented"} 2
442-
admission_webhooks_cws_exec_instrumentation_attempts_count{injected="false",mode="init_container",reason="pod_not_instrumented"} 2
443-
admission_webhooks_cws_exec_instrumentation_attempts_bucket{injected="true",mode="init_container",reason="",le="0"} 0
444-
admission_webhooks_cws_exec_instrumentation_attempts_bucket{injected="true",mode="init_container",reason="",le="+Inf"} 1
445-
admission_webhooks_cws_exec_instrumentation_attempts_sum{injected="true",mode="init_container",reason=""} 1
446-
admission_webhooks_cws_exec_instrumentation_attempts_count{injected="true",mode="init_container",reason=""} 1
447-
# HELP admission_webhooks_cws_pod_instrumentation_attempts Distribution of pod requests instrumentation attempts by CWS Instrumentation mode
448-
# TYPE admission_webhooks_cws_pod_instrumentation_attempts histogram
449-
admission_webhooks_cws_pod_instrumentation_attempts_bucket{injected="false",mode="init_container",reason="already_instrumented",le="0"} 0
450-
admission_webhooks_cws_pod_instrumentation_attempts_bucket{injected="false",mode="init_container",reason="already_instrumented",le="+Inf"} 1
451-
admission_webhooks_cws_pod_instrumentation_attempts_sum{injected="false",mode="init_container",reason="already_instrumented"} 1
452-
admission_webhooks_cws_pod_instrumentation_attempts_count{injected="false",mode="init_container",reason="already_instrumented"} 1
453-
admission_webhooks_cws_pod_instrumentation_attempts_bucket{injected="true",mode="init_container",reason="",le="0"} 0
454-
admission_webhooks_cws_pod_instrumentation_attempts_bucket{injected="true",mode="init_container",reason="",le="+Inf"} 1
455-
admission_webhooks_cws_pod_instrumentation_attempts_sum{injected="true",mode="init_container",reason=""} 1
456-
admission_webhooks_cws_pod_instrumentation_attempts_count{injected="true",mode="init_container",reason=""} 1
433+
# HELP admission_webhooks_cws_response_duration Distribution of CWS mutating webhook response durations per type operation.
434+
# TYPE admission_webhooks_cws_response_duration histogram
435+
admission_webhooks_cws_response_duration_bucket{le="0.005"} 65
436+
admission_webhooks_cws_response_duration_bucket{le="0.01"} 102
437+
admission_webhooks_cws_response_duration_bucket{le="0.025"} 108
438+
admission_webhooks_cws_response_duration_bucket{le="0.05"} 108
439+
admission_webhooks_cws_response_duration_bucket{le="0.1"} 108
440+
admission_webhooks_cws_response_duration_bucket{le="0.25"} 108
441+
admission_webhooks_cws_response_duration_bucket{le="0.5"} 108
442+
admission_webhooks_cws_response_duration_bucket{le="1"} 108
443+
admission_webhooks_cws_response_duration_bucket{le="2.5"} 108
444+
admission_webhooks_cws_response_duration_bucket{le="5"} 108
445+
admission_webhooks_cws_response_duration_bucket{le="10"} 108
446+
admission_webhooks_cws_response_duration_bucket{le="+Inf"} 108
447+
admission_webhooks_cws_response_duration_sum 0.4897835529999999
448+
admission_webhooks_cws_response_duration_count 108
449+
# HELP admission_webhooks_cws_exec_mutation_attempts Number of CWS exec mutation attempts by reason and status.
450+
# TYPE admission_webhooks_cws_exec_mutation_attempts counter
451+
admission_webhooks_cws_exec_mutation_attempts{injected="false",reason="remote_copy_failed"} 1
452+
admission_webhooks_cws_exec_mutation_attempts{injected="true",reason="remote_copy_failed"} 4
453+
# HELP admission_webhooks_cws_pod_mutation_attempts Number of CWS pod mutation attempts by reason and status.
454+
# TYPE admission_webhooks_cws_pod_mutation_attempts counter
455+
admission_webhooks_cws_pod_mutation_attempts{injected="false",reason="no_instrumentation_needed"} 1
456+
admission_webhooks_cws_pod_mutation_attempts{injected="true",reason="no_instrumentation_needed"} 4
457457
# HELP kubernetes_apiserver_emitted_events Number of events emitted by the check.
458458
# TYPE kubernetes_apiserver_emitted_events counter
459459
kubernetes_apiserver_emitted_events{kind="ConfigMap",type="Normal"} 7

datadog_cluster_agent/tests/test_datadog_cluster_agent.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +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',
17+
'admission_webhooks.cws_exec_mutation_attempts',
18+
'admission_webhooks.cws_pod_mutation_attempts',
19+
'admission_webhooks.cws_response_duration.count',
20+
'admission_webhooks.cws_response_duration.sum',
2121
'admission_webhooks.library_injection_attempts',
2222
'admission_webhooks.library_injection_errors',
2323
'admission_webhooks.mutation_attempts',

0 commit comments

Comments
 (0)