74 lines
2.3 KiB
YAML
74 lines
2.3 KiB
YAML
# Grafana datasources, provisioned at start (nothing is clicked by hand). The UIDs are FIXED:
|
|
# the dashboard JSON, the trace->logs and logs->trace links refer to exactly these UIDs
|
|
# (prometheus / loki / tempo). A datasource without a fixed uid gets a random one and every
|
|
# reference to it breaks ("data source not found").
|
|
apiVersion: 1
|
|
|
|
deleteDatasources:
|
|
- {name: Prometheus, orgId: 1}
|
|
- {name: Loki, orgId: 1}
|
|
- {name: Tempo, orgId: 1}
|
|
|
|
datasources:
|
|
- name: Prometheus
|
|
uid: prometheus
|
|
type: prometheus
|
|
access: proxy
|
|
url: http://prometheus:9090
|
|
isDefault: true
|
|
editable: false
|
|
jsonData:
|
|
httpMethod: POST
|
|
timeInterval: 15s # = scrape/evaluation interval: $__rate_interval >= 4 x 15 s
|
|
prometheusType: Prometheus
|
|
prometheusVersion: 3.16.0
|
|
manageAlerts: true # show the Prometheus alert rules in Grafana's alert list
|
|
exemplarTraceIdDestinations: []
|
|
|
|
- name: Loki
|
|
uid: loki
|
|
type: loki
|
|
access: proxy
|
|
url: http://loki:3100
|
|
editable: false
|
|
jsonData:
|
|
maxLines: 1000
|
|
# log line -> its trace in Tempo (trace_id is structured metadata of the OTLP record)
|
|
derivedFields:
|
|
- name: trace_id
|
|
matcherType: label
|
|
matcherRegex: trace_id
|
|
datasourceUid: tempo
|
|
url: "$${__value.raw}"
|
|
urlDisplayLabel: "Trace in Tempo"
|
|
|
|
- name: Tempo
|
|
uid: tempo
|
|
type: tempo
|
|
access: proxy
|
|
url: http://tempo:3200
|
|
editable: false
|
|
jsonData:
|
|
# span -> the log records of the same trace (and service) in Loki
|
|
tracesToLogsV2:
|
|
datasourceUid: loki
|
|
spanStartTimeShift: "-5m"
|
|
spanEndTimeShift: "5m"
|
|
customQuery: true
|
|
query: '{service_name="$${__span.tags["service.name"]}"} | trace_id="$${__trace.traceId}"'
|
|
tracesToMetrics:
|
|
datasourceUid: prometheus
|
|
spanStartTimeShift: "-5m"
|
|
spanEndTimeShift: "5m"
|
|
tags:
|
|
- {key: service.name, value: job}
|
|
queries:
|
|
- name: HTTP p95 of this service
|
|
query: 'histogram_quantile(0.95, sum by (le) (rate(http_server_request_duration_seconds_bucket{$$__tags}[1m])))'
|
|
search:
|
|
hide: false
|
|
nodeGraph:
|
|
enabled: false
|
|
lokiSearch:
|
|
datasourceUid: loki
|