Marco Pracucci

Results 427 comments of Marco Pracucci

They're non trivial to rebuild and I see value in them for other Grafana projects, so I have no objection in moving them to a shared lib.

> > Is it as easy to do something similar for frontend v1 too? > > @pracucci thanks, I wanted to ask if the same thing should be done for...

@aknuds1 I checked the frontend v1 code you shared and I think it waits until all inflight queries are done. > Should the above code be changed to just take...

> Should I finalize this PR by writing one or more tests? Yeah that would be great!

> I think there is a race condition in this approach Is it really important? How frequently could happen? We have a similar race in the querier graceful shutdown but...

> @pracucci after writing a timing based test, I realized that waiting on the `WaitGroup` in `Frontend.stopped` wasn't the best idea, since `stopped` gets called (by `BasicService`) after the service...

The issue comes from the error mapping done in Prometheus API, specifically here: https://github.com/prometheus/prometheus/blob/ae597cac62425f0d3017860af6be5f65666c9e93/web/api/v1/api.go#L1602-L1603 When the context is canceled while running the PromQL engine then the HTTP response status code...

I see 3 options to solve this problem (in order of my preference): 1. Easy: change the status code in Prometheus ([proposed here](https://github.com/prometheus/prometheus/pull/11897)) 2. Easy: if (1) is discarded, change...

> Easy: change the status code in Prometheus Change has been merged by Prometheus (thanks!). So I'm proceeding updating the upstream Prometheus into our fork ([PR](https://github.com/grafana/mimir-prometheus/pull/406)) and then will update...

Would be very nice if we wouldn't have to change it manually in the config, but we could auto-detect the tenant scrape interval (or highest value if customer has multiple...