robusta-dev / krr

Prometheus-based Kubernetes Resource Recommendations
MIT License
3.07k stars 164 forks source link

How to connect with mimir ? #158

Open pingping95 opened 1 year ago

pingping95 commented 1 year ago

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.

KelvinVenancio commented 1 year ago

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

FrankFoerster24 commented 1 year ago

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.

KelvinVenancio commented 1 year ago

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

aantn commented 1 year ago

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 :)

FrankFoerster24 commented 1 year ago

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

nantiferov commented 10 months ago

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'
aantn commented 10 months ago

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

pingping95 commented 10 months ago

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
aantn commented 10 months ago

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

pingping95 commented 10 months ago

@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.

aantn commented 10 months ago

Thanks, we'll add something to the docs.

Ezzahhh commented 3 months ago

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