Grafana Logs panel and Loki datasource

I have dashboard with logs panel and a lot of options for our QA team. They can easily search logs for app and environment by choosing it from the drop down list without using LogQL. In the queries for logs panel I have regexp or json parser for extract labels. So, how I can add link to label traceId? I can’t use derived fields function because of our logs types. We have json based, and java based logs. Derived fields only support regexp filter. I can’t use json here. I didn’t find any solution for configuring link to our tempo from logs panel. Could you help me?

Hi @axymen ,

Have a look at this Indexing trace_id as a label in Loki - #2 by b0b

I would assume this works the same for the logs panel as for Explore

Hi, b0b. Thanks for your answer. This solution will work great, when you have one grafana or Loki data source per project or per team. What we can do for more than one team? For example, we have three teams. Every team has frontend and backend developers and use different stacks. So, we should support all of possible log patterns and build the regexp for each of this.
If we can manage tempo links in logs pannel settings, we will delegates this head pain to the teams DevOps engineer. It will be more flexible.

Ideally, you should standardize your log format :wink:

Of course, this is not always practical… I have not spent a whole lot of time on this yet but I did test how I might get this to work if logs had different formats for trace id.

If I remember correctly this kind of worked…