From 02098c156849f2f9f06cd2380cdf70d88a46aaed Mon Sep 17 00:00:00 2001 From: Joey Tawadrous <90795735+joey-grafana@users.noreply.github.com> Date: Fri, 27 Jan 2023 10:03:52 +0000 Subject: [PATCH] Tempo: Update docs and default Tempo metrics query (#62185) Update docs and default tempo metrics query --- docs/sources/datasources/jaeger/_index.md | 2 +- docs/sources/datasources/tempo/_index.md | 2 +- public/app/features/explore/TraceView/createSpanLink.test.ts | 2 +- public/app/features/explore/TraceView/createSpanLink.tsx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/sources/datasources/jaeger/_index.md b/docs/sources/datasources/jaeger/_index.md index 4441dc5fc61..0d2bcb14636 100644 --- a/docs/sources/datasources/jaeger/_index.md +++ b/docs/sources/datasources/jaeger/_index.md @@ -154,7 +154,7 @@ datasources: tags: [{ key: 'service.name', value: 'service' }, { key: 'job' }] queries: - name: 'Sample query' - query: 'sum(rate(tempo_spanmetrics_latency_bucket{$__tags}[5m]))' + query: 'sum(rate(traces_spanmetrics_latency_bucket{$__tags}[5m]))' secureJsonData: basicAuthPassword: my_password ``` diff --git a/docs/sources/datasources/tempo/_index.md b/docs/sources/datasources/tempo/_index.md index 124e273f6c3..419f4f78e1c 100644 --- a/docs/sources/datasources/tempo/_index.md +++ b/docs/sources/datasources/tempo/_index.md @@ -175,7 +175,7 @@ datasources: tags: [{ key: 'service.name', value: 'service' }, { key: 'job' }] queries: - name: 'Sample query' - query: 'sum(rate(tempo_spanmetrics_latency_bucket{$__tags}[5m]))' + query: 'sum(rate(traces_spanmetrics_latency_bucket{$__tags}[5m]))' serviceMap: datasourceUid: 'prometheus' search: diff --git a/public/app/features/explore/TraceView/createSpanLink.test.ts b/public/app/features/explore/TraceView/createSpanLink.test.ts index 40050a42cbe..ba208be0afc 100644 --- a/public/app/features/explore/TraceView/createSpanLink.test.ts +++ b/public/app/features/explore/TraceView/createSpanLink.test.ts @@ -496,7 +496,7 @@ describe('createSpanLinkFactory', () => { expect(defaultLink!.title).toBe('defaultQuery'); expect(defaultLink!.href).toBe( `/explore?left=${encodeURIComponent( - '{"range":{"from":"2020-10-14T01:00:00.000Z","to":"2020-10-14T01:00:01.000Z"},"datasource":"prom1Uid","queries":[{"expr":"histogram_quantile(0.5, sum(rate(tempo_spanmetrics_latency_bucket{operation=\\"operation\\"}[5m])) by (le))","refId":"A"}]}' + '{"range":{"from":"2020-10-14T01:00:00.000Z","to":"2020-10-14T01:00:01.000Z"},"datasource":"prom1Uid","queries":[{"expr":"histogram_quantile(0.5, sum(rate(traces_spanmetrics_latency_bucket{service=\\"test service\\"}[5m])) by (le))","refId":"A"}]}' )}` ); diff --git a/public/app/features/explore/TraceView/createSpanLink.tsx b/public/app/features/explore/TraceView/createSpanLink.tsx index 4932b3bfeab..95184af081f 100644 --- a/public/app/features/explore/TraceView/createSpanLink.tsx +++ b/public/app/features/explore/TraceView/createSpanLink.tsx @@ -476,7 +476,7 @@ function buildMetricsQuery( span: TraceSpan ): string { if (!query.query) { - return `histogram_quantile(0.5, sum(rate(tempo_spanmetrics_latency_bucket{operation="${span.operationName}"}[5m])) by (le))`; + return `histogram_quantile(0.5, sum(rate(traces_spanmetrics_latency_bucket{service="${span.process.serviceName}"}[5m])) by (le))`; } let expr = query.query;