Find a metric
Open the Metrics browser beside the editor, or Search metrics, and type part of a name. Each metric shows its type (counter, histogram, or gauge) and how many labels and fields it has. Select a metric to put it into the query and run it. An empty workspace offers Connect a metrics source; see Datasource. A metric that has not been seen within the retention of its stream leaves the list.Write the query
The editor has two modes:- Code: write PromQL directly. Common PromQL functions lists the usual functions; the PromQL support matrix lists all that are implemented.
- Builder: choose the Metric, Add label filter for each label to match, a Function (Raw metric, Rate, Instant rate, or Increase), an Aggregation (Sum, Average, Maximum, or Minimum), and the Range. The PromQL it builds is shown below. An expression that the builder cannot represent, such as a function with extra parameters, stays as it is until a builder field is changed.
Add to dashboard opens a new dashboard with the query as its first panel. Clear query empties
the editor. When a valid query finds nothing, Expand time range 4× and Clear filters and retry
help before the expression is changed.
Read the chart
- Drag across the plot to zoom into a time range, drag the X-axis to pan, and double-click to zoom out. Reset time range returns to the range before the chart was touched.
- Choose the Draw style (line, bar, or points) and Stack (Off, Normal, or Percent; stacking needs two series or more).
- Use the legend to isolate or compare series.
- With exemplars on, select a diamond to see its trace, and Open trace to inspect the request behind the point.
Analyze the result
Graph, Table, and Query inspector show the result as a chart, as raw rows, and as the query that ran. The panels around the result explain the data:
The metric cardinality limits of the instance refuse new
series beyond a limit, so check Cardinality before adding a label with many values.
Correlate a metric spike
Select the window of the spike, keep the service and environment labels, then open the related traces or logs. MoleSignal carries the selected range into the next signal. See Cross-signal correlation.Permissions
Listing metrics requiresstreams.read. Running PromQL requires streams.query. Add to dashboard
requires dashboards.create.
Querying
SQL, PromQL, and asynchronous jobs.
Traces
Move from latency or error-rate changes to individual requests.