Skip to content

lokitool uses a wrong API url for v3.5 #19450

@diegobelotti

Description

@diegobelotti

Describe the bug
lokitool don't use Loki_TLS_CERT_PATH and LOKI_TLS_KEY_PATH and may be Loki_ instead of LOKI_ is a typo. But neither of them works.
After disabling SSL auth, nothing works because loki exposes ruler api in /loki/api/v1/rule, but lokitool search in /api/v1/rule.

To Reproduce
Steps to reproduce the behavior:

  1. configure env variable for a loki 3.5 endpoint and try "lokitool rules print"

Expected behavior
the same output of
curl -i -s -H X-Scope-OrgID: tenant1 https://loki.example.com/loki/api/v1/rules
instead of
INFO[0000] no rule groups currently exist for this user

Environment:

  • Infrastructure: any
  • Deployment tool: manual

Workaround
As my loki is behind a nginx proxy pass, I've configured a url transformation in nginx:

        location = /api/v1/rules {
          proxy_pass       http://loki-backend.ob.svc.cluster.local:3100/loki$request_uri;
        }
        location ^~ /api/v1/rules/ {
          proxy_pass       http://loki-backend.ob.svc.cluster.local:3100/loki$request_uri;
        }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions