Skip to content

Commit 52b2493

Browse files
authored
Add new metric for application sync duration (DataDog#21882)
* add new metric from argocd * changelog * e2e exclude metric
1 parent 99a7ce4 commit 52b2493

5 files changed

Lines changed: 10 additions & 1 deletion

File tree

argocd/changelog.d/21882.added

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add a new metric for [application sync duration time](https://github.com/argoproj/argo-cd/issues/11675).

argocd/datadog_checks/argocd/metrics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
'argocd_app_info': 'app.info',
4545
'argocd_app_reconcile': 'app.reconcile',
4646
'argocd_app_sync': 'app.sync',
47+
'argocd_app_sync_duration_seconds': 'app.sync.duration.seconds',
4748
'argocd_app_labels': 'app.labels',
4849
'argocd_cluster_api_resource_objects': 'cluster.api.resource_objects',
4950
'argocd_cluster_api_resources': 'cluster.api.resources',

argocd/metadata.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ argocd.app_controller.app.reconcile.bucket,count,,,,Application reconciliation p
4949
argocd.app_controller.app.reconcile.count,count,,,,The count aggregation of the application reconciliation performance histogram,0,argocd,app_controller app reconcile count,,
5050
argocd.app_controller.app.reconcile.sum,count,,,,The sum aggregation of the application reconciliation performance histogram,0,argocd,app_controller app reconcile sum,,
5151
argocd.app_controller.app.sync.count,count,,,,The total number of application syncs,0,argocd,app_controller app sync,,
52+
argocd.app_controller.app.sync.duration.seconds.count,count,,second,,Application sync performance in seconds,0,argocd,app_controller app sync duration seconds,,
5253
argocd.app_controller.cluster.api.resource_objects,gauge,,object,,The number of Kubernetes resource objects in the cache,0,argocd,app_controller cluster api resource_objects,,
5354
argocd.app_controller.cluster.api.resources,gauge,,resource,,The number of monitored kubernetes API resources.,0,argocd,app_controller cluster api resources,,
5455
argocd.app_controller.cluster.cache.age.seconds,gauge,,second,,The age of the cluster cache in seconds,0,argocd,app_controller cluster cache age seconds,,

argocd/tests/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
'redis.request.count',
8686
'app.k8s.request.count',
8787
'app.sync.count',
88+
'app.sync.duration.seconds.count',
8889
'cluster.events.count',
8990
'kubectl.exec.count',
9091
'workqueue.adds.count',
@@ -208,6 +209,7 @@
208209
'argocd.app_controller.app.sync.count',
209210
'argocd.app_controller.cluster.events.count',
210211
'argocd.app_controller.kubectl.exec.count',
212+
'argocd.app_controller.app.sync.duration.seconds.count',
211213
'argocd.app_controller.app.info',
212214
'argocd.app_controller.app.reconcile.bucket',
213215
'argocd.app_controller.app.reconcile.count',

argocd/tests/fixtures/app_controller_metrics.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,4 +415,8 @@ workqueue_work_duration_seconds_count{name="project_reconciliation_queue"} 6
415415
argocd_cluster_connection_status{name="foo"} 0
416416
argocd_cluster_connection_status{name="bar"} 1
417417
argocd_cluster_connection_status{name="baz"} 2
418-
argocd_cluster_connection_status{name="faz"} 10
418+
argocd_cluster_connection_status{name="faz"} 10
419+
# HELP argocd_app_sync_duration_seconds_total Application sync performance in seconds total.
420+
# TYPE argocd_app_sync_duration_seconds_total counter
421+
argocd_app_sync_duration_seconds_total{dest_server="https://kubernetes.default.svc",name="application-bootstrap",namespace="argocd",phase="Succeeded",project="infrastructure"} 1
422+
argocd_app_sync_duration_seconds_total{dest_server="https://kubernetes.default.svc",name="superhot",namespace="argocd",phase="Failed",project="main"} 1

0 commit comments

Comments
 (0)