Skip to content

Commit

Permalink
[CONTP-382] Add Validation Webhook telemetry metrics (#18867)
Browse files Browse the repository at this point in the history
* Add Validation Webhook telemetry

* Updating webhooks_receieved description
  • Loading branch information
gabedos authored Oct 18, 2024
1 parent 34afd9d commit 67be2b5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions datadog_cluster_agent/changelog.d/18867.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add telemetry scraping for Validation AdmissionController
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'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_validation_attempts': 'admission_webhooks.validation_attempts',
'admission_webhooks_patcher_attempts': 'admission_webhooks.patcher.attempts',
'admission_webhooks_patcher_completed': 'admission_webhooks.patcher.completed',
'admission_webhooks_patcher_errors': 'admission_webhooks.patcher.errors',
Expand Down
3 changes: 2 additions & 1 deletion datadog_cluster_agent/metadata.csv
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ datadog.cluster_agent.admission_webhooks.reconcile_errors,gauge,,,,Number of rec
datadog.cluster_agent.admission_webhooks.reconcile_success,gauge,,success,,Number of reconcile successes per controller,0,datadog_cluster_agent,admission webhooks reconcile success,
datadog.cluster_agent.admission_webhooks.response_duration.count,count,,,,Webhook response duration count,0,datadog_cluster_agent,webhook response duration count,
datadog.cluster_agent.admission_webhooks.response_duration.sum,count,,second,,Webhook response duration sum,0,datadog_cluster_agent,webhook response duration sum,
datadog.cluster_agent.admission_webhooks.webhooks_received,gauge,,,,Number of mutation webhook requests received,0,datadog_cluster_agent,admission webhooks received,
datadog.cluster_agent.admission_webhooks.validation_attempts,gauge,,,,Number of pod validation attempts by validation type,0,datadog_cluster_agent,admission webhooks validation attempts,
datadog.cluster_agent.admission_webhooks.webhooks_received,gauge,,,,Number of webhook requests received,0,datadog_cluster_agent,admission webhooks received,
datadog.cluster_agent.aggregator.flush,count,,,,"Number of metrics/service checks/events flushed by (data_type, state)",0,datadog_cluster_agent,aggregator flush,
datadog.cluster_agent.aggregator.processed,count,,,,Amount of metrics/services_checks/events processed by the aggregator by data_type,0,datadog_cluster_agent,aggregator processed,
datadog.cluster_agent.api_requests,count,,request,,"Requests made to the cluster agent API by (handler, status)",0,datadog_cluster_agent,api requests,
Expand Down
5 changes: 4 additions & 1 deletion datadog_cluster_agent/tests/fixtures/metrics.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ admission_webhooks_mutation_attempts{error="",injected="true",mutation_type="age
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_validation_attempts Number of pod validation attempts by validation type
# TYPE admission_webhooks_validation_attempts gauge
admission_webhooks_validation_attempts{error="",validated="true",webhook_name="kubernetes_audit",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
Expand All @@ -34,7 +37,7 @@ admission_webhooks_response_duration_bucket{le="10"} 108
admission_webhooks_response_duration_bucket{le="+Inf"} 108
admission_webhooks_response_duration_sum 0.4897835529999999
admission_webhooks_response_duration_count 108
# HELP admission_webhooks_webhooks_received Number of mutation webhook requests received.
# HELP admission_webhooks_webhooks_received Number of webhook requests received.
# TYPE admission_webhooks_webhooks_received gauge
admission_webhooks_webhooks_received 300
# HELP aggregator__dogstatsd_contexts Count the number of dogstatsd contexts in the aggregator
Expand Down
1 change: 1 addition & 0 deletions datadog_cluster_agent/tests/test_datadog_cluster_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
'admission_webhooks.library_injection_attempts',
'admission_webhooks.library_injection_errors',
'admission_webhooks.mutation_attempts',
'admission_webhooks.validation_attempts',
'admission_webhooks.patcher.attempts',
'admission_webhooks.patcher.completed',
'admission_webhooks.patcher.errors',
Expand Down

0 comments on commit 67be2b5

Please sign in to comment.