argoproj-labs / argo-rollouts-manager

Kubernetes Operator for Argo Rollouts controller.
https://argo-rollouts-manager.readthedocs.io/en/latest/
Apache License 2.0
84 stars 255 forks source link

RolloutManager should create a ServiceMonitor for users with ServiceMonitor support #29

Closed jgwest closed 3 weeks ago

jgwest commented 5 months ago

RolloutManager controller needs to create a ServiceMonitor so that metrics from Rollouts will automatically included in Prometheus gathered metrics, including in OpenShift monitoring (for OpenShift users)

Why is this important?

Scenarios

(Originally a feature request from https://issues.redhat.com/browse/GITOPS-3271)

Work Criteria

jgwest commented 5 months ago

Gerald notes that the following ServiceMonitor worked for him:

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: argo-rollouts-metrics
spec:
  endpoints:
    - port: metrics
  selector:
    matchLabels:
      app.kubernetes.io/name: argo-rollouts-metrics 

Siddhesh notes that this can be used for reference: Use https://github.com/redhat-developer/gitops-operator/blob/master/controllers/argocd_metrics_controller.go#L252 as reference.