Observability
As a Red Hat Developer Hub administrator, you can track user activities, system events, and data changes with Developer Hub audit logs. Administrators can view, search, filter, and manage the log data from the Red Hat OpenShift Container Platform web console
Monitoring and logging
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.
Setup monitoring for user-defined projects
As a first step, you will need to create the cluster-monitoring-config ConfigMap object:
-
Navigate to the OpenShift console. You can login as admin/{common_password}
-
Click the (+) button on the top navbar on OpenShift to create this ConfigMap
-
Copy the following ConfigMap and paste it into the YAML editor. In this configMap, when the
enableUserWorkload
parameter is set to true, it enables monitoring for user-defined projects in an OpenShift cluster.apiVersion: v1 kind: ConfigMap metadata: name: cluster-monitoring-config namespace: openshift-monitoring data: config.yaml: | enableUserWorkload: true
-
Click the Save button.
Enable metrics monitoring on OpenShift
In this step we will enable the metrics monitoring on Red Hat Developer Hub
-
Open your values.yaml file.
-
Select Edit > Edit single file. When prompted, login as a Platform Engineer with
pe1/{common_password}
-
Find the YAML surrounded by
--- MONITORING ---
and uncomment it by highlighting it and pressingCMD + /
orCTRL + /
.
Refresh the backstage
ArgoCD app for this change to take effect
-
Click Refresh on the
backstage
Application in OpenShift GitOps. If prompted, login asadmin/{openshift_gitops_password}
. -
Wait until the Application reports being in a Healthy state.
-
You can see that a new
servicemonitor
has been created for Red Hat Developer Hub, which can be viewed by navigating to the backstage ArgoCD app.
View Red Hat Developer Hub metrics on OpenShift
You can view the Red Hat Developer Hub’s metrics from the Developer perspective of the OpenShift web console within the backstage
namespace
-
Visit the metrics page to view this Observe menu on OpenShift
-
Click the Metrics tab, and from the
Select query
drop down, chooseCustom query
-
You can query a number of parameters by entering a query into the the
Expression
text area,-
Enter
catalog_entities_count
into the textarea and hitEnter
to view metrics such as how many components, users, templates etc are present in the -
scaffolder_task_count
results in the count and user details -
Other examples are
scaffolder_step_count
,scaffolder_task_count
can yield interesting info about the template usage as well. The below screenshot shows output forscaffolder_step_count
-
-
You can leverage the metrics to build custom Grafana dashboards to visualise them as well.
Audit logging and Telemetry
You can track user activities, system events, and data changes with Developer Hub audit logs. Telemetry data collection supports collecting and analyzing telemetry data to enhance Red Hat Developer Hub experience.
These sections are outside the scope of this workshop, but you can learn amore about it in Red Hat Developer Hub’s product documentation under the Observability section.