1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/monitoring-querying-metrics-for-user-defined-projects-with-mon-dashboard.adoc
Janelle Neczypor 3a7a4af45d OSDOCS-14495
2025-09-23 20:53:37 +00:00

87 lines
4.1 KiB
Plaintext

// Module included in the following assemblies:
//
// * observability/monitoring/managing-metrics.adoc
// * virt/support/virt-prometheus-queries.adoc
:_mod-docs-content-type: PROCEDURE
[id="querying-metrics-for-user-defined-projects-with-mon-dashboard_{context}"]
= Querying metrics for user-defined projects with the {product-title} web console
You can use the {product-title} metrics query browser to run Prometheus Query Language (PromQL) queries to examine metrics visualized on a plot. This functionality provides information about any user-defined workloads that you are monitoring.
As a developer, you must specify a project name when querying metrics. You must have the required privileges to view metrics for the selected project.
The Metrics UI includes predefined queries, for example, CPU, memory, bandwidth, or network packet. These queries are restricted to the selected project. You can also run custom Prometheus Query Language (PromQL) queries for the project.
ifdef::openshift-dedicated,openshift-rosa,openshift-rosa-hcp[]
[NOTE]
====
Developers cannot access the third-party UIs provided with {product-title} monitoring.
====
endif::openshift-dedicated,openshift-rosa,openshift-rosa-hcp[]
.Prerequisites
* You have access to the cluster as a developer or as a user with view permissions for the project that you are viewing metrics for.
* You have enabled monitoring for user-defined projects.
* You have deployed a service in a user-defined project.
* You have created a `ServiceMonitor` custom resource definition (CRD) for the service to define how the service is monitored.
.Procedure
. In the {product-title} web console, click *Observe* -> *Metrics*.
. To add one or more queries, perform any of the following actions:
+
|===
|Option |Description
|Select an existing query.
|From the *Select query* drop-down list, select an existing query.
|Create a custom query.
|Add your Prometheus Query Language (PromQL) query to the *Expression* field.
As you type a PromQL expression, autocomplete suggestions appear in a drop-down list. These suggestions include functions, metrics, labels, and time tokens.
Use the keyboard arrows to select one of these suggested items and then press Enter to add the item to your expression. Move your mouse pointer over a suggested item to view a brief description of that item.
|Add multiple queries. |Click *Add query*.
|Duplicate an existing query. |Click the options menu {kebab} next to the query, then choose *Duplicate query*.
|Disable a query from being run. |Click the options menu {kebab} next to the query and choose *Disable query*.
|===
. To run queries that you created, click *Run queries*. The metrics from the queries are visualized on the plot. If a query is invalid, the UI shows an error message.
+
[NOTE]
====
* When drawing time series graphs, queries that operate on large amounts of data might time out or overload the browser. To avoid this, click *Hide graph* and calibrate your query by using only the metrics table. Then, after finding a feasible query, enable the plot to draw the graphs.
* By default, the query table shows an expanded view that lists every metric and its current value. Click the *˅* down arrowhead to minimize the expanded view for a query.
====
. Optional: Save the page URL to use this set of queries again in the future.
. Explore the visualized metrics. Initially, all metrics from all enabled queries are shown on the plot. Select which metrics are shown by performing any of the following actions:
+
|===
|Option |Description
|Hide all metrics from a query. |Click the options menu {kebab} for the query and click *Hide all series*.
|Hide a specific metric. |Go to the query table and click the colored square near the metric name.
|Zoom into the plot and change the time range.
a|Perform one of the following actions:
* Visually select the time range by clicking and dragging on the plot horizontally.
* Use the menu to select the time range.
|Reset the time range. |Click *Reset zoom*.
|Display outputs for all queries at a specific point in time. |Hover over the plot at the point you are interested in. The query outputs appear in a pop-up box.
|Hide the plot. |Click *Hide graph*.
|===