From 3e2bdf035ddc8a8f062f4048310feeb48e1d37f7 Mon Sep 17 00:00:00 2001 From: Aleksandr Razumov Date: Mon, 11 Dec 2023 00:37:39 +0300 Subject: [PATCH] feat(demo): traces to logs --- .../ch-demo/grafana/dashboards/oteldb.json | 3 +- dev/local/ch-demo/grafana/datasources.yml | 36 +++++++++++++++++-- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/dev/local/ch-demo/grafana/dashboards/oteldb.json b/dev/local/ch-demo/grafana/dashboards/oteldb.json index 3783c1a3..01d90786 100644 --- a/dev/local/ch-demo/grafana/dashboards/oteldb.json +++ b/dev/local/ch-demo/grafana/dashboards/oteldb.json @@ -501,7 +501,8 @@ "type": "loki", "uid": "loki-oteldb" }, - "expr": "{service_name=\"go-faster.oteldb\", level!=\"DEBUG\"}", + "editorMode": "code", + "expr": "{service_name=\"oteldb\", level!=\"DEBUG\"}", "queryType": "range", "refId": "A" } diff --git a/dev/local/ch-demo/grafana/datasources.yml b/dev/local/ch-demo/grafana/datasources.yml index d7e1ee19..5af155a5 100644 --- a/dev/local/ch-demo/grafana/datasources.yml +++ b/dev/local/ch-demo/grafana/datasources.yml @@ -9,8 +9,30 @@ datasources: uid: tempo-oteldb jsonData: httpMethod: GET + tracesToLogsV2: + # Field with an internal link pointing to a logs data source in Grafana. + # datasourceUid value must match the uid value of the logs data source. + datasourceUid: 'loki-oteldb' + spanStartTimeShift: '1h' + spanEndTimeShift: '-1h' + filterByTraceID: true + filterBySpanID: false + tags: + - key: service.name + value: service_name + tracesToMetrics: + datasourceUid: 'prom-oteldb' + spanStartTimeShift: '1h' + spanEndTimeShift: '-1h' + tags: + - key: service.name + value: service_name + nodeGraph: + enabled: true serviceMap: datasourceUid: prom-oteldb + lokiSearch: + datasourceUid: 'loki-oteldb' - name: "LogQL" type: loki @@ -19,9 +41,19 @@ datasources: url: http://oteldb:3100 uid: loki-oteldb jsonData: - httpMethod: GET serviceMap: - datasourceUid: prometheus + datasourceUid: prom-oteldb + maxLines: 500 + derivedFields: + # Field with internal link pointing to data source in Grafana. + # datasourceUid value can be anything, but it should be unique across all defined data source uids. + - datasourceUid: tempo-oteldb + matcherRegex: '"trace_id":"([0-9a-f]+)"' + name: trace + # url will be interpreted as query for the datasource + url: '$${__value.raw}' + # optional for URL Label to set a custom display label for the link. + urlDisplayLabel: 'View Trace' - name: "PromQL" type: prometheus