From e3aece65430434a6ba079152ccbfdbb907f89a5a Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 10 Apr 2024 17:09:36 +0100 Subject: [PATCH] Support new Loki 3.0 service_name --- olli/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/olli/api.py b/olli/api.py index 7d72a84..bd18e00 100644 --- a/olli/api.py +++ b/olli/api.py @@ -31,7 +31,7 @@ def get_token_logs(self, token: TokenConfig) -> dict[str, Any]: case_filter = "(?i)" if not token.case_sensitive else "" resp = httpx.get(self.route("query_range"), params={ - "query": f'{{job=~"({job_regex})"}} |~ "{case_filter}{token.token}"', + "query": f'{{service_name=~"({job_regex})-.+"}} |~ "{case_filter}{token.token}"', "start": f"{start_ts:0.0f}", "limit": LOKI_CONFIG.max_logs, })