Is your feature request related to a problem? Please describe.
The ArgoCD Operator provides no way to add custom annotations to metrics Services (argocd-server-metrics, argocd-metrics, etc.). This prevents service-based autodiscovery for monitoring tools like Datadog that rely on service annotations.
Current workaround requires manual patching:
oc annotate svc argocd-server-metrics \
ad.datadoghq.com/service.check_names='["openmetrics"]' \
ad.datadoghq.com/service.init_configs='[{}]' \
ad.datadoghq.com/service.instances='[{"openmetrics_endpoint":"http://%%host%%:%%port%%/metrics","namespace":"argocd_server","metrics":[".*"]}]'
This is not GitOps-friendly, not persistent across deployments, and cannot be managed declaratively.
Describe the solution you'd like
Add optional annotations field for metrics services in the ArgoCD CR:
apiVersion: argoproj.io/v1beta1
kind: ArgoCD
metadata:
name: argocd
spec:
server:
metrics:
enabled: true
annotations:
ad.datadoghq.com/service.check_names: '["openmetrics"]'
ad.datadoghq.com/service.init_configs: '[{}]'
ad.datadoghq.com/service.instances: '[{"openmetrics_endpoint":"http://%%host%%:%%port%%/metrics","namespace":"argocd_server","metrics":[".*"]}]'
controller:
metrics:
enabled: true
annotations:
ad.datadoghq.com/service.check_names: '["openmetrics"]'
ad.datadoghq.com/service.init_configs: '[{}]'
ad.datadoghq.com/service.instances: '[{"openmetrics_endpoint":"http://%%host%%:%%port%%/metrics","namespace":"argocd_controller","metrics":[".*"]}]'
This would enable:
- Datadog OpenMetrics autodiscovery (primary use case)
- Annotation-based Prometheus scraping (alternative to ServiceMonitor)
- Service mesh integration for metrics endpoints
Describe alternatives you've considered
- Manual annotation - Current workaround, not persistent or GitOps-friendly
- Pod annotations - Available since v0.13.0 via
spec.server.annotations, but Datadog service-based autodiscovery requires service annotations, not pod annotations
- ServiceMonitor only - Works for Prometheus Operator but doesn't help with Datadog or other monitoring tools
- CR metadata.annotations - Doesn't work; operator doesn't propagate CR annotations to child Services
Additional context
I'm willing to collaborate on a PR if this design is accepted.
Note: This issue was drafted with assistance from AI tools, reviewed for technical accuracy.
Is your feature request related to a problem? Please describe.
The ArgoCD Operator provides no way to add custom annotations to metrics Services (
argocd-server-metrics,argocd-metrics, etc.). This prevents service-based autodiscovery for monitoring tools like Datadog that rely on service annotations.Current workaround requires manual patching:
This is not GitOps-friendly, not persistent across deployments, and cannot be managed declaratively.
Describe the solution you'd like
Add optional
annotationsfield for metrics services in the ArgoCD CR:This would enable:
Describe alternatives you've considered
spec.server.annotations, but Datadog service-based autodiscovery requires service annotations, not pod annotationsAdditional context
argocd-serverservice (port 443), not metrics servicesI'm willing to collaborate on a PR if this design is accepted.
Note: This issue was drafted with assistance from AI tools, reviewed for technical accuracy.