mirror of
https://github.com/grafana/grafana.git
synced 2024-12-01 13:09:22 -06:00
Tempo: Create trace to logs links with traces in structured metadata (#93923)
This commit is contained in:
parent
f3ba16d3b7
commit
157ded7c3f
@ -200,7 +200,7 @@ describe('createSpanLinkFactory', () => {
|
||||
datasource: 'loki1_uid',
|
||||
queries: [
|
||||
{
|
||||
expr: '{cluster="cluster1", hostname="hostname1", service_namespace="namespace1"} |="7946b05c2e2e4e5a" |="6605c7b08e715d6c"',
|
||||
expr: '{cluster="cluster1", hostname="hostname1", service_namespace="namespace1"} | label_format log_line_contains_trace_id=`{{ contains "7946b05c2e2e4e5a" __line__ }}` | log_line_contains_trace_id="true" OR trace_id="7946b05c2e2e4e5a" | label_format log_line_contains_span_id=`{{ contains "6605c7b08e715d6c" __line__ }}` | log_line_contains_span_id="true" OR span_id="6605c7b08e715d6c"',
|
||||
refId: '',
|
||||
},
|
||||
],
|
||||
|
@ -384,10 +384,12 @@ function getQueryForLoki(
|
||||
|
||||
let expr = '{${__tags}}';
|
||||
if (filterByTraceID && span.traceID) {
|
||||
expr += ' |="${__span.traceId}"';
|
||||
expr +=
|
||||
' | label_format log_line_contains_trace_id=`{{ contains "${__span.traceId}" __line__ }}` | log_line_contains_trace_id="true" OR trace_id="${__span.traceId}"';
|
||||
}
|
||||
if (filterBySpanID && span.spanID) {
|
||||
expr += ' |="${__span.spanId}"';
|
||||
expr +=
|
||||
' | label_format log_line_contains_span_id=`{{ contains "${__span.spanId}" __line__ }}` | log_line_contains_span_id="true" OR span_id="${__span.spanId}"';
|
||||
}
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user