Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve behaviour when using cortextool interacting with a Loki / GEL cluster #230

Open
eamonryan opened this issue Dec 16, 2021 · 1 comment

Comments

@eamonryan
Copy link
Member

Currently, if trying to use the standard cortextool commands to interact with a Loki or GEL cluster e.g.

  • cortextool rules print
  • cortextool rules load

These commands will fail as the interaction is different, /loki needs appending to the server address and additionally, for loading rules, cortextool will complain that the | character is not valid as it is trying to parse them as PromQL rules, not LogQL rules.

Adding the --backend=loki flag gets around this issue and I have filed 1 PR (#228) and 1 issue (#229) to improve documentation of this flag.

But could we make this a more automated experience?

I would imagine it's possible to detect whether we are interacting with a Cortex or Loki (or GEM or GEL) cluster, so could we use that information to something like one of the following?

  1. Inform the user when it is a Loki cluster e.g. "It looks like you are trying to address a Loki cluster, please add the flag --backend=loki to all commands for them to succeed"
  2. Do it automatically for the user e.g. just silently add the flag to the commands so that they succeed, or print a notice while doing it.
@cydergoth
Copy link

cydergoth commented Jan 2, 2024

Also, the version of cortextool in the container image grafana/cortextool:latest doesn't appear to be aware of the --backend=loki flag. It does, however seem the image grafana/cortex-tools:latest version of cortextool is aware of this flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants