Skip to content

Commit 34e2fa7

Browse files
authored
Merge pull request #8920 from sbueringer/pr-add-tempo
🌱 hack/observability: add tempo (for traces)
2 parents 520d7ba + 2f88d84 commit 34e2fa7

File tree

8 files changed

+358
-248
lines changed

8 files changed

+358
-248
lines changed

Tiltfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,12 @@ def deploy_observability():
432432
],
433433
)
434434

435+
if "tempo" in settings.get("deploy_observability", []):
436+
k8s_yaml(read_file("./.tiltbuild/yaml/tempo.observability.yaml"), allow_duplicates = True)
437+
438+
# Port-forward the tracing port to localhost, so we can also send traces from local.
439+
k8s_resource(workload = "tempo", port_forwards = "4317:4317", extra_pod_selectors = [{"app": "tempo"}], labels = ["observability"])
440+
435441
if "grafana" in settings.get("deploy_observability", []):
436442
k8s_yaml(read_file("./.tiltbuild/yaml/grafana.observability.yaml"), allow_duplicates = True)
437443
k8s_resource(workload = "grafana", port_forwards = "3001:3000", extra_pod_selectors = [{"app": "grafana"}], labels = ["observability"], objects = ["grafana:serviceaccount"])

docs/book/src/developer/tilt.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,13 @@ Important! This feature requires the `helm` command to be available in the user'
200200

201201
Supported values are:
202202

203-
* `grafana`*: To create dashboards and query `loki` as well as `prometheus`.
203+
* `grafana`*: To create dashboards and query `loki`, `prometheus` and `tempo`.
204204
* `kube-state-metrics`: For exposing metrics for Kubernetes and CAPI resources to `prometheus`.
205205
* `loki`: To receive and store logs.
206206
* `prometheus`*: For collecting metrics from Kubernetes.
207207
* `promtail`: For providing pod logs to `loki`.
208208
* `parca`*: For visualizing profiling data.
209+
* `tempo`: To store traces.
209210
* `visualizer`*: Visualize Cluster API resources for each cluster, provide quick access to the specs and status of any resource.
210211

211212
\*: Note: the UI will be accessible via a link in the tilt console

hack/observability/grafana/chart/values.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,67 @@ grafana.ini:
1313
enabled: true
1414
org_name: Main Org.
1515
org_role: Admin
16+
feature_toggles:
17+
enable: "tempoSearch tempoBackendSearch"
1618

1719
# Adds loki as a datasource.
1820
datasources:
1921
datasources.yaml:
2022
apiVersion: 1
2123
datasources:
24+
# https://grafana.com/docs/grafana/latest/datasources/loki/
2225
- name: Loki
2326
type: loki
27+
uid: loki
28+
orgId: 1
2429
url: http://loki:3100
30+
isDefault: true
31+
editable: true
2532
# This header has to be set as we had to set an OrgID
2633
# in promtail to be able to push the logs to Loki.
2734
jsonData:
35+
maxLines: 1000
36+
derivedFields:
37+
- datasourceUid: tempo
38+
matcherRegex: '"traceID":"(\w+)"'
39+
name: TraceID
40+
url: $${__value.raw}
41+
urlDisplayLabel: Trace
2842
httpHeaderName1: 'X-Scope-OrgID'
2943
secureJsonData:
3044
httpHeaderValue1: '1'
3145
- name: Prometheus
3246
type: prometheus
47+
uid: prometheus
3348
url: http://prometheus-server
49+
editable: true
50+
jsonData:
51+
httpMethod: 'GET'
52+
exemplarTraceIdDestinations:
53+
- name: 'TraceID'
54+
datasourceUid: 'tempo'
55+
# https://grafana.com/docs/grafana/latest/datasources/tempo/
56+
- name: Tempo
57+
type: tempo
58+
uid: tempo
59+
url: http://tempo:3100
60+
editable: true
61+
jsonData:
62+
tracesToLogs:
63+
datasourceUid: 'loki'
64+
tags: [ 'app' ]
65+
spanEndTimeShift: 1h
66+
spanStartTimeShift: -1h
67+
filterByTraceID: true
68+
filterBySpanID: false
69+
lokiSearch: true
70+
71+
serviceMap:
72+
datasourceUid: 'prometheus'
73+
search:
74+
hide: false
75+
nodeGraph:
76+
enabled: true
3477

3578
dashboardProviders:
3679
dashboardproviders.yaml:

0 commit comments

Comments
 (0)