Stay organized with collections Save and categorize content based on your preferences.
PromQL queries in Google Cloud Managed Service for Prometheus are partially evaluated at the Monarch backend, and there are some known differences in query results. This document describes the differences.
Other than the differences listed in this document, the PromQL in Managed Service for Prometheus is at parity with the PromQL available in Prometheus version
2.44.
PromQL functions added after Prometheus version 2.44 might not be supported.
UTF-8 supportPromQL for Cloud Monitoring supports UTF-8 querying.
If your Prometheus metric name only consists of alphanumeric characters plus the _
or :
characters, and if your label keys only consist of alphanumeric characters plus the _
character, then you can query using traditional PromQL syntax. For example, a valid query might look like job:my_metric:sum{label_key="label_value"}
.
However, if your Prometheus metric name uses any special characters except for the _
or :
characters, or if your label keys use any special character except for the _
character, then you have to construct your query according to the UTF-8 spec for PromQL.
UTF-8 metric names must be quoted and moved into the braces. Label names must also be quoted if they contain legacy-incompatible characters. The following example valid queries are all equivalent:
{"my.domain.com/metric/name_bucket", "label.key"="label.value"}
{__name__="my.domain.com/metric/name_bucket", "label.key"="label.value"}
{"__name__"="my.domain.com/metric/name_bucket", "label.key"="label.value"}
Only exact matching on metric names is supported. You must include an exact match on the metric name in your query.
We recommend the following workarounds for common scenarios that use a regular expression matcher on the __name__
label:
=~
operator to match on multiple metric names. To fix this usage, expand the config to use a separate policy for each metric and name each metric explicitly. This also prevents you from accidentally autoscaling on unexpected metrics.cpu_servicename_usage
, you might use a wildcard to graph all your services together. Using non-dimensional metrics like this is an explicitly bad practice in Cloud Monitoring, and this practice leads to extremely poor query performance. To fix this usage, move all dimensionality into metric labels instead of embedding dimensions in the metric name./labels/__name__/values
call to discover metrics. You can also discover metrics using the Cloud Monitoring UI.Staleness is not supported in the Monarch backend.
Calculation ofirate
When the lookback window for the irate
function is less than the step size, we increase the window to the step size. Monarch requires this change to ensure that none of the input data is completely ignored in the output. This difference applies to rate
calculations as well.
rate
and increase
When the lookback window for the rate
function is less than the step size, we increase the window to the step size. Monarch requires this change to ensure that none of the input data is completely ignored in the output. This difference applies to irate
calculations as well.
There are differences in the interpolation and extrapolation calculations. Monarch uses a different interpolation algorithm than Prometheus, and this difference can lead to slightly different results. For example, Monarch counter samples are stored with a time range rather than the single timestamp that Prometheus uses. Therefore, counter samples in Monarch can be included in a rate calculation even though the Prometheus timestamp would exclude them. This generally results in more accurate rate results, especially when querying over the beginning or end of the underlying time series.
Calculation ofhistogram_quantile
A PromQL histogram_quantile
calculation on a histogram with no samples produces a NaN value. The internal query language's calculation produces no value; the point at the timestamp is dropped instead.
The rate-calculation differences can also affect the input to histogram_quantile
queries.
Although upstream Prometheus is weakly typed, Monarch is strongly typed. This means that running functions specific to a single type on a differently typed metric (for example, running rate()
on a GAUGE metric or histogram_quantile()
on a COUNTER or untyped metric) doesn't work in Managed Service for Prometheus, even though these functions work in upstream Prometheus.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-11 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-11 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4