krr icon indicating copy to clipboard operation
krr copied to clipboard

How to connect with mimir ?

Open pingping95 opened this issue 2 years ago • 12 comments

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

krr simple -p https://mimir.xxxxx.xxx --prometheus-label cluster -l my-cluster

I tried above command and does not success.

image

Describe the solution you'd like Hope to support Mimir

If i did wrong command, please let me know the exact command.

pingping95 avatar Oct 13 '23 01:10 pingping95

I am looking forward to being able to use it with Mimir too.

KelvinVenancio avatar Oct 30 '23 23:10 KelvinVenancio

Hi,

this works for me:

krr simple --prometheus-url "http://localhost:8080/prometheus"

This is a Mimir deployment using the mimir-distributed-4.4.1 helm chart, :8080 is a port forward to its Nginx service (or rather a pod behind it), the /prometheus route should hit Mimir's query frontend. So any URL that hits this service should work, I just happened to use port forwarding. Note that it is a bit sensitive to trailing slashes, eg. I noticed http://localhost:8080/prometheus/ does not work for me. Good luck.

Kind regards, Frank.

FrankFoerster24 avatar Nov 03 '23 10:11 FrankFoerster24

Hi @FrankFoerster24, perfect, it works like a charm, thank you for sharing with us.

KelvinVenancio avatar Nov 03 '23 11:11 KelvinVenancio

Thanks for the update.

If anyone would like to contribute a PR to fix the docs (or autodiscovery, or that issue with trailing slashes) that would be more than welcome! And we'll send you a cool Robusta t-shirt in appreciation :)

aantn avatar Nov 06 '23 18:11 aantn

As a starting point, I hacked something in #168 which works for my installation. Some things are not at the right place yet, though.

FrankFoerster24 avatar Nov 07 '23 14:11 FrankFoerster24

I can add to aforementioned example that current version of krr (v1.6.0) works without issues with self-hosted Mimir.

Only headers for tenant-id should be provided too (were added in https://github.com/robusta-dev/krr/issues/84), example

$ krr simple --prometheus-url https://mimir.some.domain/prometheus --prometheus-headers 'X-Scope-OrgID: some-tenant-id'

nantiferov avatar Jan 12 '24 12:01 nantiferov

@pavangudiwada could you assist with updating the docs re. @FrankFoerster24's and @nantiferov's instructions?

aantn avatar Jan 12 '24 16:01 aantn

Hi all.

I think cluster-label config need to add for those who have lots cluster label values for multi cluster.

krr simple --prometheus-url https://mimir.xxxxx.xxx/prometheus --prometheus-headers 'X-Scope-OrgID: anonymous' --prometheus-label cluster -l cluster-label-value
1. run kubectx
kubectx cluster-to-watch

2. run krr
krr simple --prometheus-url https://mimir.xxxxx.xxx/prometheus --prometheus-headers 'X-Scope-OrgID: anonymous' --prometheus-label cluster -l cluster-to-watch
image

pingping95 avatar Jan 14 '24 10:01 pingping95

To clarify, you have multiple clusters under the same Mimir tenant ID, right?

aantn avatar Jan 14 '24 10:01 aantn

@aantn yes.

I have multiple clusters under same mimir tenant ID.

So i changed my cluster context and then run krr command.

it works for my case.

pingping95 avatar Jan 14 '24 11:01 pingping95

Thanks, we'll add something to the docs.

aantn avatar Jan 14 '24 14:01 aantn

I also just ran into this; for clarification for others this was my scenario:

  • Mimir running in a dedicated cluster with single tenant where all spoke clusters push metrics to
  • If I am targeting a specific spoke cluster you will need to set --prometheus-label cluster -l cluster-label-value AND ensure that your KUBECONFIG in your shell points to that spoke cluster and not Mimir. If you don't do this, you will just end up running krr against the cluster where Mimir is located and not your actual intended target

Ezzahhh avatar Aug 30 '24 04:08 Ezzahhh