You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To try to isolate the bug, I deleted all the rules and I tried loading this one:
namespace: bug
groups:
- name: test
rules:
- record: "test:scalar:bug"
expr: |2
vector(1)
or
vector(2)
cortextool rules load rules-bug.yml \
--address=$CORTEX_URL \
--id=$CORTEX_USER \
--key=$CORTEX_KEY \
--log.level=debug
INFO[0000] log level set to debug
DEBU[0000] path built to request rule group url=/api/prom/rules/bug/test
DEBU[0000] sending request to cortex api method=GET url="https://prometheus-us-central1.grafana.net/api/prom/rules/bug/test"
DEBU[0000] checking response status="404 Not Found"
DEBU[0000] resource not found fields.msg="request failed with response body group does not exist\n" status="404 Not Found"
DEBU[0000] sending request to cortex api method=POST url="https://prometheus-us-central1.grafana.net/api/prom/rules/bug"
DEBU[0000] checking response status="400 Bad Request"
ERRO[0000] requests failed fields.msg="request failed with response body unable to decoded rule group\n" status="400 Bad Request"
ERRO[0000] unable to load rule group error="failed request to the cortex api" group=test namespace=bug
INFO[0000] log level set to debug
DEBU[0000] sending request to cortex api method=GET url="https://prometheus-us-central1.grafana.net/api/prom/rules"
DEBU[0000] checking response status="200 OK"
FATA[0000] unable to read rules from cortex, yaml: line 3: did not find expected key
Also, this rule does not run! I don't see the test:scalar:bug metric in my database.
If I create the same rule on a single line, then it works, so I think both Cortex and Cortextool has an issue with the YAML block quotes with an indentation indicator syntax as described in Prometheus docs.
The text was updated successfully, but these errors were encountered:
I loaded this:
Since then, I can't print the rules anymore.
I can query the API and get the expected YAML.
To try to isolate the bug, I deleted all the rules and I tried loading this one:
I was able to load this rule group using curl.
I'm still unable to print the rules:
But I can GET them from the API:
Also, this rule does not run! I don't see the
test:scalar:bug
metric in my database.If I create the same rule on a single line, then it works, so I think both Cortex and Cortextool has an issue with the YAML block quotes with an indentation indicator syntax as described in Prometheus docs.
The text was updated successfully, but these errors were encountered: