Correlating logs to traces or traces to logs

  • What Grafana version and what operating system are you using?
    Grafana v10.2.0 (895fbafb7a), in wsl docker, ubuntu

  • What are you trying to achieve?
    Using auto instrumentation using Beyla to send metrics and traces to prometheous and Tempo. And then correlating the traces to logs sent by prom trail to Loki.

  • How are you trying to achieve it?
    The logs are for legacy applications which does not have trace Id and such instrumentation built into it. Therefore we are choosing to use auto instrument, this way we will need less code correction or addition.
    if you see in the image i do get traces with id’s but as no logs contain that trace id so they are not found as well.
    These trace id’s are generated by Beyla. Is there anyway to inject them to logs as well?

  • But so far every article I read says we need trace id in logs itself.
    or I am looking in wrong places?
    Let me know