From ab8438fd171d49a87e4960ff7549dda969dd0048 Mon Sep 17 00:00:00 2001 From: James Lawrie Date: Tue, 24 Jan 2023 14:13:49 -0500 Subject: [PATCH] Enable exemplar export/display support (#704) * Enable exemplar export/display support Ensure the collector's prometheus endpoint produces exemplars Ensure that prometheus collects and stores exemplar data Ensure that grafana will display links to exemplars from dashboards/the explore tab * Enable exemplars for latency histogram in demo dashboard --- CHANGELOG.md | 2 + docker-compose.yml | 3 +- docs/demo_features.md | 6 +- docs/metric_service_features.md | 4 +- .../dashboards/general/demo-dashboard.json | 1265 +++++++++-------- .../provisioning/datasources/default.yaml | 8 + src/otelcollector/otelcol-config.yml | 1 + 7 files changed, 652 insertions(+), 637 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2dc4f3f1d..7355c8bf9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -206,3 +206,5 @@ significant modifications will be credited to OpenTelemetry Authors. ([#703](https://github.com/open-telemetry/opentelemetry-demo/pull/703)) * Update dockerfile for adservice to use different base images ([#705](https://github.com/open-telemetry/opentelemetry-demo/pull/705)) +* Enable exemplar support in the metrics exporter, Prometheus, and Grafana +([#704](https://github.com/open-telemetry/opentelemetry-demo/pull/704)) diff --git a/docker-compose.yml b/docker-compose.yml index 430f0ee0ba..5707d19e4f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -625,7 +625,7 @@ services: # OpenTelemetry Collector otelcol: - image: otel/opentelemetry-collector-contrib:0.61.0 + image: otel/opentelemetry-collector-contrib:0.69.0 container_name: otel-col deploy: resources: @@ -657,6 +657,7 @@ services: - --storage.tsdb.path=/prometheus - --web.enable-lifecycle - --web.route-prefix=/ + - --enable-feature=exemplar-storage volumes: - ./src/prometheus/prometheus-config.yaml:/etc/prometheus/prometheus-config.yaml ports: diff --git a/docs/demo_features.md b/docs/demo_features.md index f8086115ff..a4c0067b55 100644 --- a/docs/demo_features.md +++ b/docs/demo_features.md @@ -17,14 +17,14 @@ be added as the relevant SDKs are released. Collector](https://opentelemetry.io/docs/collector/getting-started)**: all services are instrumented and sending the generated traces and metrics to the OpenTelemetry Collector via gRPC. The received traces are then exported to the - logs and to Jaeger. + logs and to Jaeger; received metrics and exemplars are exported to logs and Prometheus. - **[Jaeger](https://www.jaegertracing.io)**: all generated traces are being sent to Jaeger. - **Synthetic Load Generation**: the application demo comes with a background job that creates realistic usage patterns on the website using [Locust](https://locust.io/) load generator. -- **[Prometheus](https://prometheus.io/)**: all generated metrics are scraped by - Prometheus. +- **[Prometheus](https://prometheus.io/)**: all generated metrics and exemplars + are scraped by Prometheus. - **[Grafana](https://grafana.com/)**: all metric dashboards are stored in Grafana. - **[Envoy](https://www.envoyproxy.io/)**: Envoy is used as a reverse proxy for diff --git a/docs/metric_service_features.md b/docs/metric_service_features.md index 14de0ac891..691fb7a463 100644 --- a/docs/metric_service_features.md +++ b/docs/metric_service_features.md @@ -9,7 +9,7 @@ Emoji Legend | Service | Language | Auto-instrumentation | Manual Instrumentation | Multiple Instruments | Views | Custom Attributes | Resource Detection | Trace Exemplars | |-----------------|-----------------|----------------------|------------------------|----------------------|----------------|-------------------|--------------------|-----------------| | Accounting | Go | :construction: | :construction: | :construction: | :construction: | :construction: | :construction: | :construction: | -| Ad | Java | :100: | :100: | :construction: | :construction: | :100: | :100: | :construction: | +| Ad | Java | :100: | :100: | :construction: | :construction: | :100: | :100: | :100: | | Cart | .NET | :100: | :construction: | :construction: | :construction: | :construction: | :construction: | :construction: | | Checkout | Go | :100: | :construction: | :construction: | :construction: | :construction: | :construction: | :construction: | | Currency | C++ | :no_bell: | :construction: | :construction: | :construction: | :construction: | :construction: | :construction: | @@ -17,7 +17,7 @@ Emoji Legend | Feature Flag | Erlang / Elixir | :construction: | :construction: | :construction: | :construction: | :construction: | :construction: | :construction: | | Fraud Detection | Kotlin | :100: | :construction: | :construction: | :construction: | :construction: | :100: | :construction: | | Frontend | TypeScript | :construction: | :construction: | :construction: | :construction: | :construction: | :construction: | :construction: | -| Payment | JavaScript | :construction: | :construction: | :construction: | :construction: | :construction: | :100: | :construction: | +| Payment | JavaScript | :construction: | :100: | :construction: | :construction: | :construction: | :100: | :construction: | | Product Catalog | Go | :construction: | :construction: | :construction: | :construction: | :construction: | :construction: | :construction: | | Quote | PHP | :construction: | :construction: | :construction: | :construction: | :construction: | :construction: | :construction: | | Recommendation | Python | :100: | :100: | :construction: | :construction: | :construction: | :construction: | :construction: | diff --git a/src/grafana/provisioning/dashboards/general/demo-dashboard.json b/src/grafana/provisioning/dashboards/general/demo-dashboard.json index 2d2a66046a..37061e1bda 100644 --- a/src/grafana/provisioning/dashboards/general/demo-dashboard.json +++ b/src/grafana/provisioning/dashboards/general/demo-dashboard.json @@ -1,693 +1,696 @@ { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 1, - "links": [], - "liveNow": false, - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 14, - "panels": [], - "title": "Metrics", - "type": "row" - }, + "annotations": { + "list": [ { + "builtIn": 1, "datasource": { - "type": "prometheus", - "uid": "webstore-metrics" + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 14, + "panels": [], + "title": "Metrics", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" }, - "unit": "percent" + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] }, - "overrides": [] + "unit": "percent" }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 1 + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 1 + }, + "id": 6, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "id": 6, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "editorMode": "code", + "expr": "rate(runtime_cpython_cpu_time{type=~\"system\"}[$__interval])*100", + "legendFormat": "__auto", + "range": true, + "refId": "A" }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "webstore-metrics" - }, - "editorMode": "code", - "expr": "rate(runtime_cpython_cpu_time{type=~\"system\"}[$__interval])*100", - "legendFormat": "__auto", - "range": true, - "refId": "A" + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" }, - { - "datasource": { - "type": "prometheus", - "uid": "webstore-metrics" - }, - "editorMode": "code", - "expr": "rate(runtime_cpython_cpu_time{type=~\"user\"}[$__interval])*100", - "hide": false, - "legendFormat": "__auto", - "range": true, - "refId": "B" - } - ], - "title": "Recommendation Service (CPU%)", - "type": "timeseries" + "editorMode": "code", + "expr": "rate(runtime_cpython_cpu_time{type=~\"user\"}[$__interval])*100", + "hide": false, + "legendFormat": "__auto", + "range": true, + "refId": "B" + } + ], + "title": "Recommendation Service (CPU%)", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" }, - { - "datasource": { - "type": "prometheus", - "uid": "webstore-metrics" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" }, - "unit": "decmbytes" + "thresholdsStyle": { + "mode": "off" + } }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 1 - }, - "id": 8, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "unit": "decmbytes" }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "webstore-metrics" - }, - "editorMode": "code", - "expr": "rate(runtime_cpython_memory{type=~\"rss|vms\"}[$__interval])/1024/1024", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "Recommendation Service (Memory)", - "type": "timeseries" + "overrides": [] }, - { - "datasource": { - "type": "prometheus", - "uid": "webstore-metrics" + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 1 + }, + "id": 8, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" + }, + "editorMode": "code", + "expr": "rate(runtime_cpython_memory{type=~\"rss|vms\"}[$__interval])/1024/1024", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Recommendation Service (Memory)", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "bars", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "bars", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" } }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 9 - }, - "id": 4, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] } }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "webstore-metrics" - }, - "editorMode": "code", - "expr": "rate(app_recommendations_counter{recommendation_type=\"catalog\"}[$__interval])", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "Recommendations Count", - "type": "timeseries" + "overrides": [] }, - { - "datasource": { - "type": "prometheus", - "uid": "webstore-metrics" + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 4, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" + }, + "editorMode": "code", + "expr": "rate(app_recommendations_counter{recommendation_type=\"catalog\"}[$__interval])", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Recommendations Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "thresholdsStyle": { + "mode": "off" } }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 9 - }, - "id": 10, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] } }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "webstore-metrics" - }, - "editorMode": "code", - "expr": "rate(calls_total{status_code=\"STATUS_CODE_ERROR\"}[$__interval])", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "Error Rate", - "type": "timeseries" + "overrides": [] }, - { - "datasource": { - "type": "prometheus", - "uid": "webstore-metrics" + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 10, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" + }, + "editorMode": "code", + "expr": "rate(calls_total{status_code=\"STATUS_CODE_ERROR\"}[$__interval])", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Error Rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" }, - "unit": "dtdurationms" + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] }, - "overrides": [] + "unit": "dtdurationms" }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 17 + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 17 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "editorMode": "code", + "exemplar": true, + "expr": "histogram_quantile(0.50, sum(rate(latency_bucket{service_name=\"${service}\"}[$__rate_interval])) by (le))", + "legendFormat": "__auto", + "range": true, + "refId": "A" }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "webstore-metrics" - }, - "editorMode": "code", - "expr": "histogram_quantile(0.50, sum(rate(latency_bucket{service_name=\"${service}\"}[$__rate_interval])) by (le))", - "legendFormat": "__auto", - "range": true, - "refId": "A" + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" }, - { - "datasource": { - "type": "prometheus", - "uid": "webstore-metrics" - }, - "editorMode": "code", - "expr": "histogram_quantile(0.95, sum(rate(latency_bucket{service_name=\"${service}\"}[$__rate_interval])) by (le))", - "hide": false, - "legendFormat": "__auto", - "range": true, - "refId": "B" + "editorMode": "code", + "exemplar": false, + "expr": "histogram_quantile(0.95, sum(rate(latency_bucket{service_name=\"${service}\"}[$__rate_interval])) by (le))", + "hide": false, + "legendFormat": "__auto", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" }, - { - "datasource": { - "type": "prometheus", - "uid": "webstore-metrics" - }, - "editorMode": "code", - "expr": "histogram_quantile(0.99, sum(rate(latency_bucket{service_name=\"${service}\"}[$__rate_interval])) by (le))", - "hide": false, - "legendFormat": "__auto", - "range": true, - "refId": "C" + "editorMode": "code", + "exemplar": false, + "expr": "histogram_quantile(0.99, sum(rate(latency_bucket{service_name=\"${service}\"}[$__rate_interval])) by (le))", + "hide": false, + "legendFormat": "__auto", + "range": true, + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" }, - { - "datasource": { - "type": "prometheus", - "uid": "webstore-metrics" - }, - "editorMode": "code", - "expr": "histogram_quantile(0.999, sum(rate(latency_bucket{service_name=\"${service}\"}[$__rate_interval])) by (le))", - "hide": false, - "legendFormat": "__auto", - "range": true, - "refId": "D" - } - ], - "title": "Service Latency (from SpanMetrics)", - "type": "timeseries" + "editorMode": "code", + "exemplar": false, + "expr": "histogram_quantile(0.999, sum(rate(latency_bucket{service_name=\"${service}\"}[$__rate_interval])) by (le))", + "hide": false, + "legendFormat": "__auto", + "range": true, + "refId": "D" + } + ], + "title": "Service Latency (from SpanMetrics)", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" }, - { - "datasource": { - "type": "prometheus", - "uid": "webstore-metrics" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" }, - "unit": "reqps" + "thresholdsStyle": { + "mode": "off" + } }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 17 - }, - "id": 12, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "unit": "reqps" }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "webstore-metrics" - }, - "editorMode": "code", - "expr": "rate(latency_count{service_name=\"${service}\"}[$__rate_interval])", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "Endpoint Rate by Service", - "type": "timeseries" - } - ], - "schemaVersion": 37, - "style": "dark", - "tags": [], - "templating": { - "list": [ + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 17 + }, + "id": 12, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ { - "allValue": "", - "current": { - "selected": false, - "text": "recommendationservice", - "value": "recommendationservice" - }, "datasource": { "type": "prometheus", "uid": "webstore-metrics" }, - "definition": "latency_bucket", - "hide": 0, - "includeAll": false, - "multi": false, - "name": "service", - "options": [], - "query": { - "query": "latency_bucket", - "refId": "StandardVariableQuery" - }, - "refresh": 1, - "regex": "/.*service_name=\\\"([^\\\"]+)\\\".*/", - "skipUrlSync": false, - "sort": 1, - "type": "query" + "editorMode": "code", + "expr": "rate(latency_count{service_name=\"${service}\"}[$__rate_interval])", + "legendFormat": "__auto", + "range": true, + "refId": "A" } - ] - }, - "time": { - "from": "now-15m", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "Demo Dashboard", - "uid": "W2gX2zHVk", - "version": 2, - "weekStart": "" - } \ No newline at end of file + ], + "title": "Endpoint Rate by Service", + "type": "timeseries" + } + ], + "schemaVersion": 37, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": "", + "current": { + "selected": false, + "text": "featureflagservice", + "value": "featureflagservice" + }, + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" + }, + "definition": "latency_bucket", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "service", + "options": [], + "query": { + "query": "latency_bucket", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "/.*service_name=\\\"([^\\\"]+)\\\".*/", + "skipUrlSync": false, + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-15m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Demo Dashboard", + "uid": "W2gX2zHVk", + "version": 1, + "weekStart": "" +} diff --git a/src/grafana/provisioning/datasources/default.yaml b/src/grafana/provisioning/datasources/default.yaml index 3efab92b68..ee1dd8c677 100644 --- a/src/grafana/provisioning/datasources/default.yaml +++ b/src/grafana/provisioning/datasources/default.yaml @@ -7,3 +7,11 @@ datasources: url: http://prometheus:9090 editable: true isDefault: true + jsonData: + exemplarTraceIdDestinations: + - datasourceUid: webstore-traces + name: trace_id + + - url: http://localhost:8080/jaeger/ui/trace/$${__value.raw} + name: trace_id + urlDisplayLabel: View in Jaeger UI diff --git a/src/otelcollector/otelcol-config.yml b/src/otelcollector/otelcol-config.yml index fe4c872626..64e12fe0f5 100644 --- a/src/otelcollector/otelcol-config.yml +++ b/src/otelcollector/otelcol-config.yml @@ -18,6 +18,7 @@ exporters: endpoint: "otelcol:9464" resource_to_telemetry_conversion: enabled: true + enable_open_metrics: true processors: batch: spanmetrics: