Loki labels not filtering correctly after Grafana upgrade to 11.1.3

Hello,

We are running:

  • Loki v2.8.2 in k8s
  • Grafana OSS v11.1.3 on a Linux VM

After the upgrade from v10.4.1 to v11.1.3, there is a problem with the labels from our Loki data sources. When you choose a specific system with a hostname label and then try to filter for example the jobs for the system or the log file that’s scraped it’s showing all possible options (for all systems from that data source) instead of filtering the jobs/log files/etc. for the specific system. After testing by adding my Loki data sources on a separate Grafana isntance, this seems to start breaking from v11.1.X, on 11.0.X it is still working correctly. The interesting thing is that the Label Browser is filtering correctly, however the Explore field is not. The problem is that this is breaking my filters in my logs dashboards by showing all values for all systems from the Loki data source even though I select a specific system on which I want to filter. I couldn’t find any workaround and also couldn’t find any information in the changelog, breaking changes, etc. that explain why this would break in 11.1.X. Can you please advise if there’s some kind of fix for this planned and why it’s working in 11.0.X but not in 11.1X ?

Thank you

1 Like

Could you provide some screenshots, please? What it looks like from label browser vs explorer, and some screenshot somehow showing labels not filtered correctly would be nice.

Most of the time you can see the query that Grafana performs to Loki. If you are able to track it down, you can perform the same query yourself and be able to tell if it’s a problem with Grafana or something else. If you do think it’s a problem with Grafana might be worth posting a bug on GitHub.

Hopefully someone else running 11.1.3 can comment as well.

i have the same issue… 11.0.4 works

Hi recently tried bumping the Grafana UI from appversion v10.4.0 to v11.2.0 and I’m also noticing this same issue and this affects both Logs and Metrics query from the explorer view. This is not an issue on v10.x.

Issue summary: Labels selected in the explorer view are not narrowing down the values for subsequent labels as the get stacked upon each other.

Here is a query that shows this issue for v11.2:
Explorer:

Label browser works correctly:

Hello, I believe I had the same issue and have also solved it for myself.

After a long time away from my loki log dashboard I signed in to see that whenever I had more than 1 option selected on a filter no data would show up on a dashboard. If multiple options or ‘all’ was selected I would see nothing. Looking at the Label Filters I see that I was using an equal sign “=” instead of 'Matches regex “=~” '. Once I changed to matches regex “=~” it appears to be working again. It must have allowed just an equals sign in the past

I have the same problem after upgrade to 11.3.0 version. And this is not the result of use “=” instead of “= ~”.