Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 2. Enabling observability for Red Hat Developer Hub on OpenShift Container Platform


In OpenShift Container Platform, metrics are exposed through an HTTP service endpoint under the /metrics canonical name. You can create a ServiceMonitor custom resource (CR) to scrape metrics from a service endpoint in a user-defined project.

You can enable and view metrics for an Operator-installed Red Hat Developer Hub instance from the Developer perspective of the OpenShift Container Platform web console.

Prerequisites

  • Your OpenShift Container Platform cluster has monitoring for user-defined projects enabled.
  • You have installed Red Hat Developer Hub on OpenShift Container Platform using the Red Hat Developer Hub Operator.
  • You have installed the OpenShift CLI (oc).

Procedure

Currently, the Red Hat Developer Hub Operator does not support creating a ServiceMonitor custom resource (CR) by default. You must complete the following steps to create a ServiceMonitor CR to scrape metrics from the endpoint.

  1. Create the ServiceMonitor CR as a YAML file:

    apiVersion: monitoring.coreos.com/v1
    kind: ServiceMonitor
    metadata:
      name: <developer_hub_service_monitor_name> 
    1
    
      namespace: <rhdh_namespace_name> 
    2
    
      labels:
        app.kubernetes.io/instance: <rhdh_cr_name> 
    3
    
        app.kubernetes.io/name: Backstage
    spec:
      namespaceSelector:
        matchNames:
          - <rhdh_namespace_name> 
    4
    
      selector:
        matchLabels:
          app.kubernetes.io/instance: <deployment_name> 
    5
    
          app.kubernetes.io/name: <rhdh_cr_type> 
    6
    
      endpoints:
      - port: http-metrics
        path: '/metrics'
    Copy to Clipboard Toggle word wrap
    1
    The name of your ServiceMonitor resource, for example, developer_hub_service_monitor.
    2
    The namespace where your ServiceMonitor will live, for example, my-rhdh-project.
    3
    The label name identifying the ServiceMonitor CR instance, for example, my-rhdh-custom-resource.
    4
    The namespace where your RHDH instance is installed, for example, my-rhdh-project.
    5
    The name of your RHDH deployment, for example, developer-hub.
    6
    The name of your RHDH application, for example, backstage.
    Note

    spec.selector.matchLabels configuration must match the labels of your RHDH installation.

  2. Apply the ServiceMonitor CR by running the following command:

    oc apply -f <filename>
    Copy to Clipboard Toggle word wrap

Verification

  1. From the Developer perspective in the OpenShift Container Platform web console, select the Observe view.
  2. Click the Metrics tab to view metrics for Red Hat Developer Hub pods.
  3. From the Developer perspective in the OpenShift Container Platform web console, click Project > Services and verify the labels for backstage-developer-hub.

You can enable and view metrics for a Red Hat Developer Hub Helm deployment from the Developer perspective of the OpenShift Container Platform web console.

Prerequisites

  • Your OpenShift Container Platform cluster has monitoring for user-defined projects enabled.
  • You have installed Red Hat Developer Hub on OpenShift Container Platform using the Helm chart.

Procedure

  1. From the Developer perspective in the OpenShift Container Platform web console, select the Topology view.
  2. Click the overflow menu of the Red Hat Developer Hub Helm chart, and select Upgrade.

  3. On the Upgrade Helm Release page, select the YAML view option in Configure via, then configure the metrics section in the YAML, as shown in the following example:

    upstream:
    # ...
      metrics:
        serviceMonitor:
          enabled: true
          path: /metrics
          port: http-metrics
    # ...
    Copy to Clipboard Toggle word wrap
  4. Click Upgrade.

Verification

  1. From the Developer perspective in the OpenShift Container Platform web console, select the Observe view.
  2. Click the Metrics tab to view metrics for Red Hat Developer Hub pods.
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat