// 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-all-projects-with-mon-dashboard_{context}"]
= Querying metrics for all projects with the {product-title} web console

// The following section will be included in the administrator section, hence there is no need to include "administrator" in the title
[role="_abstract"]

Monitor the state of a cluster and any user-defined workloads by using the {product-title} metrics query browser. The query browser uses Prometheus Query Language (PromQL) queries to examine metrics visualized on a plot.

As a
ifndef::openshift-dedicated,openshift-rosa[]
cluster administrator
endif::openshift-dedicated,openshift-rosa[]
ifdef::openshift-dedicated,openshift-rosa[]
`dedicated-admin`
endif::openshift-dedicated,openshift-rosa[]
or as a user with view permissions for all projects, you can access metrics for all default {product-title} and user-defined projects in the Metrics UI.

ifdef::openshift-dedicated,openshift-rosa[]
[NOTE]
====
Only dedicated administrators have access to the third-party UIs provided with {product-title} monitoring.
====
endif::openshift-dedicated,openshift-rosa[]

.Prerequisites

ifndef::openshift-dedicated,openshift-rosa[]
* You have access to the cluster as a user with the `cluster-admin` cluster role or with view permissions for all projects.
endif::openshift-dedicated,openshift-rosa[]
ifdef::openshift-dedicated,openshift-rosa[]
* You have access to the cluster as a user with the `dedicated-admin` role or with view permissions for all projects.
endif::openshift-dedicated,openshift-rosa[]
* You have installed the {oc-first}.

.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*.
|===
