I have a json logs contains multiple fields, including trace_id and span_id, e.g:
{"lvl":"DEBUG","lgr":"_logger_name_","m":"_log_message_","trace_id":"97c30396c36dcdcbef6639c35ee6072f","span_id":"e3644f942b296a28"}
To make it more pretty and human readable, I use the following formatting pipeline:
{app="myapp"} | json | __error__ != "JSONParserErr" | label_format level=lvl | line_format `<{{.lgr}}> {{.m}}`
So the line in the dashboard contains only timestamp from metadata, logger name and logger line. Other fields available in the details of the line, including trace_id and span_id:
The problem (and the question) is - now to enable link to Tempo without printing a trace_id to the log line (with printing it works as expected)?