Ce contenu n'est pas disponible dans la langue sélectionnée.

Chapter 2. Monitoring


2.1. Monitoring with GitOps dashboards

Monitoring GitOps instances helps you track application deployments, troubleshoot synchronization issues, and optimize resource usage. The Red Hat OpenShift GitOps monitoring dashboards provide a graphical view of instance health, application status, component performance, and rollout metrics across your cluster.

There are four GitOps dashboards available:

  • GitOps Overview: See an overview of all GitOps instances installed on the cluster, including the number of applications, health and sync status, application and sync activity.
  • GitOps Components: View detailed resource metrics, such as CPU and memory usage, for the application-controller, repo-server, server, and other GitOps components.
  • GitOps gRPC Services: View metrics related to gRPC service activity between the various components in Red Hat OpenShift GitOps.
  • GitOps Rollouts: View metrics related to the total active Rollouts resources, the number of available, desired, and unavailable replicas, and statistics on the performance of the Rollouts controller.

2.1.1. Accessing GitOps monitoring dashboards

The Red Hat OpenShift GitOps Operator automatically deploys monitoring dashboards when you install it. Access these dashboards from the Administrator perspective of the OpenShift Container Platform web console to monitor instance health, application synchronization status, and component performance.

Note

Disabling or changing the content of the dashboards is not supported.

Prerequisites

  • You have access to the OpenShift Container Platform web console.
  • The Red Hat OpenShift GitOps Operator is installed in the default namespace, openshift-gitops-operator.
  • Cluster monitoring is enabled on the openshift-gitops-operator namespace.
  • A GitOps instance is installed and running in a namespace, such as openshift-gitops.

Procedure

  1. In the Administrator perspective of the web console, go to Observe Dashboards.
  2. From the Dashboard drop-down list, select the desired GitOps dashboard: GitOps (Overview), GitOps / Components, GitOps / gRPC Services or GitOps / Rollouts.
  3. Optional: Choose a specific namespace, cluster, and interval from the Namespace, Cluster, and Interval drop-down lists.
  4. Review the metrics displayed in the dashboard to monitor your GitOps instance health and performance.

2.2. Monitoring Argo CD instances

Monitoring Argo CD instances helps you track application health, troubleshoot synchronization issues, and measure deployment performance. The Red Hat OpenShift GitOps Operator automatically connects Argo CD instances to the cluster monitoring stack to collect metrics and generate alerts for out-of-sync applications.

2.2.1. Prerequisites

  • You have access to the cluster with cluster-admin privileges.
  • You have access to the OpenShift Container Platform web console.
  • You have installed the Red Hat OpenShift GitOps Operator in your cluster.
  • An GitOps instance is installed and running in a namespace, such as openshift-gitops.

2.2.2. Monitoring Argo CD health using Prometheus metrics

Monitor the health status of your Argo CD applications by querying Prometheus metrics. This helps you identify degraded applications, track sync status, and troubleshoot deployment issues.

Prerequisites

  • You have access to the OpenShift Container Platform web console.
  • At least one application is deployed using GitOps.
  • Monitoring is enabled for the namespace where your Argo CD instance is installed.

Procedure

  1. In the Developer perspective of the web console, select the namespace where your application is deployed, and navigate to Observe Metrics.
  2. From the Select query drop-down list, select Custom query.
  3. To check the health status of your application, enter the Prometheus Query Language (PromQL) query similar to the following example in the Expression field:

    Example:

sum(argocd_app_info{dest_namespace=~"<your_defined_namespace>",health_status!=""}) by (health_status)

+

where:

<your_defined_namespace>
Specifies the variable with the actual name of your defined namespace, for example openshift-gitops.

Review the query results to check the health status of your applications. The results show the number of applications grouped by health status values such as Healthy, Progressing, Degraded, Suspended, or Missing.

Disabling automatic metric scraping for Argo CD instances helps prevent excessive storage usage in clusters with multiple instances. By default, the Red Hat OpenShift GitOps Operator scrapes metrics for all Argo CD instances, creating monitoring resources and labels in each namespace.

As a result, the Operator creates the following resources and labels in the namespace where the Argo CD instance is installed:

  • gitops-operator-argocd-alerts prometheus rule
  • <argocd_namespace>-read role
  • <argocd_name>, <argocd_name>-repo-server, and <argocd_name>-server service monitors
  • <argocd_namespace>-prometheus-k8s-read-binding role binding
  • openshift.io/cluster-monitoring=true label

If you have multiple Argo CD instances, scraping metrics for each instance can increase storage usage. To reduce storage consumption and gain more control over monitoring, disable metric scraping for individual instances by using the web console’s YAML view to configure the Argo CD custom resource (CR).

As a cluster administrator, by disabling metric scraping for individual instances, you can give your users better control, flexibility, and stability to manage their defined namespaces.

Procedure

  1. Log in to the OpenShift Container Platform web console.
  2. In the Administrator perspective of the web console, click Operators Installed Operators.
  3. From the Project list, select the project where the user-defined Argo CD instance is installed.
  4. Select Red Hat OpenShift GitOps from the installed Operators list and go to the Argo CD tab.
  5. Click your user-defined Argo CD instance.
  6. Configure the ArgoCD CR of your user-defined Argo CD instance to disable the automatic scraping of metrics:

    1. Click the YAML tab and edit the YAML file of the ArgoCD CR.
    2. In the ArgoCD CR, set the spec.monitoring.disableMetrics field value to true:

      Example ArgoCD CR:

      apiVersion: argoproj.io/v1beta1
      kind: ArgoCD
      metadata:
       name: example
       namespace: spring-petclinic
      spec:
       monitoring:
         disableMetrics: true

      where:

      metadata.name
      Specifies the name of the user-defined Argo CD instance.
      metadata.namespace
      Specifies the namespace where you want to run the user-defined Argo CD instance.
      Tip

      Alternatively, use the oc CLI to disable automatic metric scraping:

      $ oc patch argocd example -n spring-petclinic --type='json' -p='[{"op": "replace", "path": "/spec/monitoring/disableMetrics", "value": true}]'

      Example output:

      argocd.argoproj.io/example patched
  7. Verify that the Operator adds the openshift.io/cluster-monitoring=false label to your defined namespace:

    1. Go to Administration Namespaces.

      The Namespaces page displays the created namespaces.

    2. Click your defined namespace, go to the YAML tab, and verify that under the metadata.labels section, the openshift.io/cluster-monitoring=false label is added by the Operator.
  8. Verify that the Operator deletes the following resources from your defined namespace:

    1. Go to Home Search.
    2. From the Resources list, select PrometheusRule, Role, RoleBinding, and ServiceMonitors.

      The Search page displays the selected resources.

    3. In the Search page, verify that under the PrometheusRule section, the gitops-operator-argocd-alerts prometheus rule is removed.
    4. Under the Roles section, from the Filter list, select Namespace Roles.
    5. Verify that the <argocd_namespace>-read role is removed.
    6. Under the RoleBindings section, from the Filter list, select Namespace RoleBindings.
    7. Verify that the <argocd_namespace>-prometheus-k8s-read-binding role binding is removed.
    8. Verify that under the ServiceMonitors section, the <argocd_name>, <argocd_name>-repo-server, and <argocd_name>-server service monitors are removed.
Note

You can enable the metrics for your instance by modifying the spec.monitoring.disableMetrics field value to false. The Operator then creates the required role, role bindings, and service monitors and adds the openshift.io/cluster-monitoring=true label to your defined namespace.

2.3. Monitoring the GitOps Operator performance

Monitor Red Hat OpenShift GitOps Operator performance to identify resource bottlenecks, track reconciliation times, and optimize cluster performance. The Operator exposes performance metrics that the OpenShift monitoring stack collects and displays in the OpenShift Container Platform web console. You can track the following metrics:

Expand
Table 2.1. GitOps Operator performance metrics
Metric nameTypeDescription

active_argocd_instances_total

Gauge

The total number of active Argo CD instances currently managed by the Operator across the cluster.

active_argocd_instances_by_phase

Gauge

The number of active Argo CD instances in a given phase, such as Pending or Available.

active_argocd_instance_reconciliation_count

Counter

The total number of reconciliations that have occurred for an Argo CD instance in a given namespace.

controller_runtime_reconcile_time_seconds_per_instance_bucket

Counter

The number of reconciliation cycles completed under given time durations for an instance. For example, controller_runtime_reconcile_time_seconds_per_instance_bucket{le="0.5"} shows the number of reconciliations that took under 0.5 seconds to complete for a given instance.

controller_runtime_reconcile_time_seconds_per_instance_count

Counter

The total number of reconciliation cycles observed for a given instance.

controller_runtime_reconcile_time_seconds_per_instance_sum

Counter

The total amount of time taken for the observed reconciliations for a given instance.

Note

Gauge is a value that can go up or down. Counter is a value that can only go up.

2.3.1. Accessing the GitOps Operator metrics

The OpenShift Container Platform web console provides access to GitOps Operator metrics through the Administrator perspective. Use these metrics to track reconciliation performance, monitor active instances, and identify potential bottlenecks.

Prerequisites

  • You have access to the OpenShift Container Platform web console.
  • The Red Hat OpenShift GitOps Operator is installed in the default openshift-gitops-operator namespace.
  • Cluster monitoring is enabled for the openshift-gitops-operator namespace.

Procedure

  1. In the Administrator perspective of the web console, go to Observe Metrics.
  2. In the Expression field, enter the name of the metric you want to query. See the metrics table for available options.

    • active_argocd_instances_total
    • active_argocd_instances_by_phase
    • active_argocd_instance_reconciliation_count
    • controller_runtime_reconcile_time_seconds_per_instance_bucket
    • controller_runtime_reconcile_time_seconds_per_instance_count
    • controller_runtime_reconcile_time_seconds_per_instance_sum
  3. Optional: Filter the metric by its properties. For example, filter the active_argocd_instances_by_phase metric by the Available phase:

    Example:

    active_argocd_instances_by_phase{phase="Available"}
  4. Optional: Click Add query to enter multiple queries.
  5. Click Run queries to enable and observe the GitOps Operator metrics.
  6. Review the metrics visualization to monitor Operator performance.

The Red Hat OpenShift GitOps Environments page in the Developer perspective of the OpenShift Container Platform web console shows a list of the successful deployments of the application environments, along with links to the revision for each deployment.

The Application environments page in the Developer perspective of the OpenShift Container Platform web console displays the health status of application resources, such as routes, synchronization status, deployment configurations, and deployment history.

2.4.1. Settings for environment labels and annotations

Configure specific labels and annotations in your application and namespace manifests to enable environment monitoring in the OpenShift Container Platform web console. These settings allow the GitOps Operator to identify and track your application environments.

Environment labels

The environment application manifest must include the labels.openshift.gitops/environment and destination.namespace fields. The value of the openshift.gitops/environment label must match both the destination.namespace value and the application manifest name.

Example environment application manifest specification:

spec:
  labels:
    openshift.gitops/environment: <environment_name>
  destination:
    namespace: <environment_name>
# ...

Example of an environment application manifest:

apiVersion: argoproj.io/v1beta1
kind: Application
metadata:
  name: dev-env
  namespace: openshift-gitops
spec:
  labels:
    openshift.gitops/environment: dev-env
  destination:
    namespace: dev-env
# ...

where:

metadata.name
Specifies the name of the environment application manifest. This value must match the openshift.gitops/environment label value and the destination.namespace value.
Environment annotations

The environment namespace manifest must include the annotations.app.openshift.io/vcs-uri and annotations.app.openshift.io/vcs-ref fields to specify the version control source repository of the application. The namespace name must match the environment name that the application manifest defines.

Example environment namespace manifest specification:

apiVersion: v1
kind: Namespace
metadata:
  annotations:
    app.openshift.io/vcs-uri: <application_source_url>
    app.openshift.io/vcs-ref: <branch_reference>
  name: <environment_name>
# ...

where:

metadata.name
Specifies the name of the environment namespace. This value must match the environment name defined in the application manifest.

Example of an environment namespace manifest:

apiVersion: v1
kind: Namespace
metadata:
  annotations:
    app.openshift.io/vcs-uri: https://example.com/<your_domain>/<your_gitops.git>
    app.openshift.io/vcs-ref: main
  labels:
    argocd.argoproj.io/managed-by: openshift-gitops
  name: dev-env
# ...

2.4.2. Checking health information

Check the health status and deployment history of your GitOps-managed applications using the GitOps environments monitoring interface in the OpenShift Container Platform web console.

Prerequisites

  • You have installed the Red Hat OpenShift GitOps Operator from OperatorHub.
  • Your applications are managed and synchronized by Argo CD.

Procedure

  1. In the OpenShift Container Platform web console, navigate to the Developer perspective and click Environments. The Environments page shows the list of applications along with their Environment status.
  2. Hover over the icons under the Environment status column to see the synchronization status of all the environments.
  3. Click the application name from the list to view the details of a specific application.
  4. In the Application environments page, view the Resources section under the Overview tab to check the resource health status:

    • A broken heart icon indicates that resource issues have degraded the application’s performance.
    • A yellow yield sign icon indicates that resource issues have delayed the health status data.
  5. Optional: In the Application environments page, click the Deployment History tab to view the deployment history. The page displays details such as Last deployment, Description (commit message), Environment, Author, and Revision.

2.5. Monitoring Argo CD custom resource workloads

With Red Hat OpenShift GitOps, you can monitor the availability of Argo CD custom resource workloads for specific Argo CD instances. When workload pods for components such as the application controller, repository server, or API server fail to start, or when the number of ready replicas does not match the desired replica count, the GitOps Operator triggers alerts. You can enable or disable workload monitoring for individual Argo CD instances.

2.5.1. Prerequisites

  • You are logged in to the cluster as a user with the cluster-admin role.
  • Red Hat OpenShift GitOps is installed in your cluster.
  • The monitoring stack is configured in your cluster in the openshift-monitoring project. In addition, the Argo CD instance is in a namespace that you can monitor through Prometheus.
  • The kube-state-metrics service is running on your cluster.
  • Optional: If you are enabling monitoring for an Argo CD instance already present in a user-defined project, ensure that the monitoring is enabled for user-defined projects in your cluster.

    Note

    If you want to enable monitoring for an Argo CD instance in a namespace that is not watched by the default openshift-monitoring stack, for example, any namespace that does not start with openshift-*, then you must enable user workload monitoring in your cluster. This action enables the monitoring stack to pick up the created PrometheusRule.

By default, the monitoring configuration for Argo CD custom resource workloads is set to false.

Enable workload monitoring for specific Argo CD instances to receive alerts when component replica counts drift from the desired state. When enabled, the GitOps Operator creates a PrometheusRule object that defines alert rules for all workloads managed by the Argo CD instance. The Operator does not overwrite manual changes to the PrometheusRule object.

Procedure

  1. Set the .spec.monitoring.enabled field value to true on a given Argo CD instance:

    Example Argo CD custom resource:

    apiVersion: argoproj.io/v1beta1
    kind: ArgoCD
    metadata:
      name: example-argocd
      labels:
        example: repo
    spec:
     # ...
      monitoring:
        enabled: true
     # ...
  2. Verify whether an alert rule is included in the PrometheusRule created by the Operator:

    Example alert rule:

    apiVersion: monitoring.coreos.com/v1
    kind: PrometheusRule
    metadata:
      name: argocd-component-status-alert
      namespace: openshift-gitops
    spec:
      groups:
        - name: ArgoCDComponentStatus
          rules:
            # ...
            - alert: ApplicationSetControllerNotReady
              annotations:
                message: >-
                  ApplicationSet controller deployment for the Argo CD instance in
                  namespace "default" is not running
              expr: >-
                kube_statefulset_status_replicas{
                  statefulset="openshift-gitops-application-controller",
                  namespace="openshift-gitops"
                } !=
                kube_statefulset_status_replicas_ready{
                  statefulset="openshift-gitops-application-controller",
                  namespace="openshift-gitops"
                }
              for: 1m
              labels:
                severity: critical

    where:

    spec.groups.name
    Specifies the name of the alert rule group.
    spec.groups.rules.alert
    Specifies the name of the alert that triggers when workloads created by the Argo CD instance are not running as expected.
    spec.groups.rules.annotations.message
    Specifies a description of the alert condition.
    spec.groups.rules.expr
    Specifies the Prometheus expression that evaluates the alert condition.
    spec.groups.rules.for
    Specifies the duration for which the condition must be true before the alert fires.
    spec.groups.rules.labels.severity
    Specifies the severity level of the alert.

Disable workload monitoring for specific Argo CD instances when you no longer need alerts for component workloads. When disabled, the GitOps Operator automatically deletes the associated PrometheusRule object.

Procedure

  • Set the .spec.monitoring.enabled field value to false on a given Argo CD instance:

    Example Argo CD custom resource:

    apiVersion: argoproj.io/v1beta1
    kind: ArgoCD
    metadata:
      name: example-argocd
      labels:
        example: repo
    spec:
     # ...
      monitoring:
        enabled: false
     # ...

Verification

  • Verify that the PrometheusRule object has been deleted:

    $ oc get prometheusrule -n <namespace>

    The argocd-component-status-alert PrometheusRule object no longer appears in the list.

Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de la documentation Red Hat

Legal Notice

Theme

© 2026 Red Hat
Retour au début