|
|
|
@ -18,6 +18,7 @@ import { |
|
|
|
|
BackendSrvRequest, |
|
|
|
|
DataSourceWithBackend, |
|
|
|
|
getBackendSrv, |
|
|
|
|
reportInteraction, |
|
|
|
|
TemplateSrv, |
|
|
|
|
getTemplateSrv, |
|
|
|
|
} from '@grafana/runtime'; |
|
|
|
@ -159,6 +160,15 @@ export class TempoDatasource extends DataSourceWithBackend<TempoQuery, TempoJson |
|
|
|
|
|
|
|
|
|
if (targets.nativeSearch?.length) { |
|
|
|
|
try { |
|
|
|
|
reportInteraction('grafana_traces_search_queried', { |
|
|
|
|
datasourceType: 'tempo', |
|
|
|
|
app: options.app ?? '', |
|
|
|
|
serviceName: targets.nativeSearch[0].serviceName ?? '', |
|
|
|
|
spanName: targets.nativeSearch[0].spanName ?? '', |
|
|
|
|
limit: targets.nativeSearch[0].limit ?? '', |
|
|
|
|
search: targets.nativeSearch[0].search ?? '', |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const timeRange = config.featureToggles.tempoBackendSearch |
|
|
|
|
? { startTime: options.range.from.unix(), endTime: options.range.to.unix() } |
|
|
|
|
: undefined; |
|
|
|
@ -199,6 +209,12 @@ export class TempoDatasource extends DataSourceWithBackend<TempoQuery, TempoJson |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (targets.traceId?.length > 0) { |
|
|
|
|
reportInteraction('grafana_traces_traceID_queried', { |
|
|
|
|
datasourceType: 'tempo', |
|
|
|
|
app: options.app ?? '', |
|
|
|
|
query: targets.traceId[0].query ?? '', |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
subQueries.push(this.handleTraceIdQuery(options, targets.traceId)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|