You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prometheus supports stats=1 as part of the /api/v1/query and api/v1/query_range endpoints. It returns an additional json field called "stats" with some execution timings. For /query:
Right now this parameter causes gmp-frontend to return an error:
{
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name \"stats\": Cannot bind query parameter. Field 'stats' could not be found in request message.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"description": "Invalid JSON payload received. Unknown name \"stats\": Cannot bind query parameter. Field 'stats' could not be found in request message."
}
]
}
]
}
}
This means we can't make use of some excellent Prometheus tooling out there like pint to lint for expensive queries, because it relies on the stats=1 parameter (and not just for that one check, but all that call Prometheus APIs). Is it possible to increase compatibility with Prometheus and start supporting this param?
The text was updated successfully, but these errors were encountered:
The main challenge is to map internal workings of Google Cloud Monitoring PromQL engine to those stats which assumes Prometheus' TSDB PromQL engine.
We could make it work, at the minimum level, so tools like [pint](https://cloudflare.github.io/pint/checks/query/cost.html could work OR we could contribute to pint to make sure it's more generic. Anyway, the acceptance criteria here:
bwplotka
changed the title
Feature request: support the ?stats=1 query parameter
Feature request: GMP query API works with "pint" tool (support the ?stats=1 query parameter)
Jul 8, 2024
Prometheus supports
stats=1
as part of the/api/v1/query
andapi/v1/query_range
endpoints. It returns an additional json field called "stats" with some execution timings. For/query
:Right now this parameter causes gmp-frontend to return an error:
This means we can't make use of some excellent Prometheus tooling out there like pint to lint for expensive queries, because it relies on the
stats=1
parameter (and not just for that one check, but all that call Prometheus APIs). Is it possible to increase compatibility with Prometheus and start supporting this param?The text was updated successfully, but these errors were encountered: