cortexproject / cortex

A horizontally scalable, highly available, multi-tenant, long term Prometheus.
https://cortexmetrics.io/
Apache License 2.0
5.48k stars 802 forks source link

Add support for writing to a generic remote_write endpoint in Ruler #6337

Open GiedriusS opened 1 week ago

GiedriusS commented 1 week ago

Is your feature request related to a problem? Please describe.

I would like to use Cortex Ruler in a Thanos stack. Right now the Ruler component writes to ingesters in the ring.

Describe the solution you'd like

Cortex Ruler should be able to write directly to a generic remote_write endpoint.

Maybe the <ruler_config> configuration could look like this:

remote_write:
  url: "http://127.0.0.1/api/v1/receive"
  headers:
    a: b
  .. any extra things

And if this is provided it would only write through remote_write?

Describe alternatives you've considered

Implementing everything needed to make Thanos Receive ingesters behave like Cortex ones but that's a huge project by itself. Let's start small and add support for just remote writing in Cortex Ruler.

Additional context

Other issue on Thanos side: https://github.com/thanos-io/thanos/issues/7905

friedrichg commented 1 week ago

I see great possibilities with this 🪄

are you willing to do first small PR for this? @GiedriusS

GiedriusS commented 1 week ago

Yes, will work on it :+1: