mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 20:24:18 -06:00
Tempo: Add request histogram to service graph datalink (#44671)
This commit is contained in:
parent
f81b9c8150
commit
de04f19c47
@ -353,6 +353,18 @@ const serviceGraphLinks = [
|
||||
datasourceName: 'Prometheus',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: '',
|
||||
title: 'Request histogram',
|
||||
internal: {
|
||||
query: {
|
||||
expr:
|
||||
'histogram_quantile(0.9, rate(traces_service_graph_request_server_seconds_bucket{server="${__data.fields.id}"}[$__interval]))',
|
||||
},
|
||||
datasourceUid: 'prom',
|
||||
datasourceName: 'Prometheus',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: '',
|
||||
title: 'Failed request rate',
|
||||
|
@ -18,7 +18,13 @@ import { identity, pick, pickBy, groupBy, startCase } from 'lodash';
|
||||
import { LokiOptions, LokiQuery } from '../loki/types';
|
||||
import { PrometheusDatasource } from '../prometheus/datasource';
|
||||
import { PromQuery } from '../prometheus/types';
|
||||
import { failedMetric, mapPromMetricsToServiceMap, serviceMapMetrics, totalsMetric } from './graphTransform';
|
||||
import {
|
||||
failedMetric,
|
||||
histogramMetric,
|
||||
mapPromMetricsToServiceMap,
|
||||
serviceMapMetrics,
|
||||
totalsMetric,
|
||||
} from './graphTransform';
|
||||
import {
|
||||
transformTrace,
|
||||
transformTraceList,
|
||||
@ -322,6 +328,11 @@ function serviceMapQuery(request: DataQueryRequest<TempoQuery>, datasourceUid: s
|
||||
`rate(${totalsMetric}{server="\${__data.fields.id}"}[$__interval])`,
|
||||
datasourceUid
|
||||
),
|
||||
makePromLink(
|
||||
'Request histogram',
|
||||
`histogram_quantile(0.9, rate(${histogramMetric}{server="\${__data.fields.id}"}[$__interval]))`,
|
||||
datasourceUid
|
||||
),
|
||||
makePromLink(
|
||||
'Failed request rate',
|
||||
`rate(${failedMetric}{server="\${__data.fields.id}"}[$__interval])`,
|
||||
|
@ -133,14 +133,13 @@ function findTraceDuration(view: DataFrameView<Row>): number {
|
||||
export const secondsMetric = 'traces_service_graph_request_server_seconds_sum';
|
||||
export const totalsMetric = 'traces_service_graph_request_total';
|
||||
export const failedMetric = 'traces_service_graph_request_failed_total';
|
||||
export const histogramMetric = 'traces_service_graph_request_server_seconds_bucket';
|
||||
|
||||
export const serviceMapMetrics = [
|
||||
secondsMetric,
|
||||
totalsMetric,
|
||||
failedMetric,
|
||||
// We don't show histogram in node graph at the moment but we could later add that into a node context menu.
|
||||
// 'traces_service_graph_request_seconds_bucket',
|
||||
// 'traces_service_graph_request_seconds_count',
|
||||
histogramMetric,
|
||||
// These are used for debugging the tempo collection so probably not useful for service map right now.
|
||||
// 'traces_service_graph_unpaired_spans_total',
|
||||
// 'traces_service_graph_untagged_spans_total',
|
||||
|
Loading…
Reference in New Issue
Block a user