From 979b7e0fc7b512ad033fb1b6dd863135cb9e684f Mon Sep 17 00:00:00 2001 From: Juliano Costa Date: Fri, 13 Dec 2024 12:08:34 +0100 Subject: [PATCH 1/8] [grafana] Add Exemplars Dashboard --- .../dashboards/demo/exemplars-dashboard.json | 253 ++++++++++++++++++ 1 file changed, 253 insertions(+) create mode 100644 src/grafana/provisioning/dashboards/demo/exemplars-dashboard.json diff --git a/src/grafana/provisioning/dashboards/demo/exemplars-dashboard.json b/src/grafana/provisioning/dashboards/demo/exemplars-dashboard.json new file mode 100644 index 0000000000..15e4f0d972 --- /dev/null +++ b/src/grafana/provisioning/dashboards/demo/exemplars-dashboard.json @@ -0,0 +1,253 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 6, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 3, + "panels": [], + "title": "Cart Service Exemplars", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.3.0", + "targets": [ + { + "disableTextWrap": false, + "editorMode": "builder", + "exemplar": true, + "expr": "app_cart_get_cart_latency_bucket", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": true, + "legendFormat": "{{le}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "GetCart Exemplars", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 1, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" + }, + "disableTextWrap": false, + "editorMode": "builder", + "exemplar": true, + "expr": "app_cart_add_item_latency_bucket", + "fullMetaSearch": false, + "includeNullMetadata": true, + "legendFormat": "{{le}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "AddItem Exemplars", + "type": "timeseries" + } + ], + "preload": false, + "schemaVersion": 40, + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "Cart Service Exemplars", + "uid": "ce6sd46kfkglca", + "version": 1, + "weekStart": "" +} From 6b2406f9048070b52a921839f39aaddfe4524651 Mon Sep 17 00:00:00 2001 From: Juliano Costa Date: Fri, 13 Dec 2024 12:11:08 +0100 Subject: [PATCH 2/8] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e8cdde9c8..29d55b3d81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ the release. ([#1797](https://github.com/open-telemetry/opentelemetry-demo/pull/1797)) * [accounting] rename accountingservice to accounting ([#1827](https://github.com/open-telemetry/opentelemetry-demo/pull/1827)) +* [grafana] Add Exemplars Dashboard + ([#1836](https://github.com/open-telemetry/opentelemetry-demo/pull/1836)) ## 1.12.0 From a4f0113d8f7759fccc36e65c05600744fd083211 Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Fri, 13 Dec 2024 20:13:34 -0500 Subject: [PATCH 3/8] use heatmap and 95th pct chart --- .../dashboards/demo/exemplars-dashboard.json | 93 ++++++++----------- 1 file changed, 39 insertions(+), 54 deletions(-) diff --git a/src/grafana/provisioning/dashboards/demo/exemplars-dashboard.json b/src/grafana/provisioning/dashboards/demo/exemplars-dashboard.json index 15e4f0d972..b65c933c51 100644 --- a/src/grafana/provisioning/dashboards/demo/exemplars-dashboard.json +++ b/src/grafana/provisioning/dashboards/demo/exemplars-dashboard.json @@ -18,7 +18,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 6, + "id": 4, "links": [], "panels": [ { @@ -41,55 +41,15 @@ }, "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, "scaleDistribution": { "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] } }, "overrides": [] @@ -101,16 +61,39 @@ "y": 1 }, "id": 2, + "interval": "2m", "options": { + "calculate": false, + "cellGap": 1, + "color": { + "exponent": 0.5, + "fill": "dark-orange", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "Oranges", + "steps": 64 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "show": true + }, + "rowsFrame": { + "layout": "auto" }, "tooltip": { "mode": "single", - "sort": "none" + "showColorScale": false, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "reverse": false } }, "pluginVersion": "11.3.0", @@ -119,9 +102,10 @@ "disableTextWrap": false, "editorMode": "builder", "exemplar": true, - "expr": "app_cart_get_cart_latency_bucket", + "expr": "sum by(le) (rate(app_cart_get_cart_latency_bucket[$__rate_interval]))", + "format": "heatmap", "fullMetaSearch": false, - "includeNullMetadata": true, + "includeNullMetadata": false, "instant": true, "legendFormat": "{{le}}", "range": true, @@ -129,8 +113,8 @@ "useBackend": false } ], - "title": "GetCart Exemplars", - "type": "timeseries" + "title": "GetCart Latency Heatmap with Exemplars", + "type": "heatmap" }, { "datasource": { @@ -199,6 +183,7 @@ "y": 10 }, "id": 1, + "interval": "2m", "options": { "legend": { "calcs": [], @@ -221,16 +206,16 @@ "disableTextWrap": false, "editorMode": "builder", "exemplar": true, - "expr": "app_cart_add_item_latency_bucket", + "expr": "histogram_quantile(0.95, sum by(le) (rate(app_cart_add_item_latency_bucket[$__rate_interval])))", "fullMetaSearch": false, - "includeNullMetadata": true, + "includeNullMetadata": false, "legendFormat": "{{le}}", "range": true, "refId": "A", "useBackend": false } ], - "title": "AddItem Exemplars", + "title": "95th Pct Cart AddItem Latency with Exemplars", "type": "timeseries" } ], @@ -250,4 +235,4 @@ "uid": "ce6sd46kfkglca", "version": 1, "weekStart": "" -} +} \ No newline at end of file From 337cf9ed680c4c18e1a0b6e80b5f44fd75d6ad7b Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Fri, 13 Dec 2024 20:13:50 -0500 Subject: [PATCH 4/8] decrease user load to 5 --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 844e885c5a..dc076d0741 100644 --- a/.env +++ b/.env @@ -94,7 +94,7 @@ IMAGE_PROVIDER_DOCKERFILE=./src/imageprovider/Dockerfile # Load Generator LOCUST_WEB_PORT=8089 -LOCUST_USERS=10 +LOCUST_USERS=5 LOCUST_HOST=http://${FRONTEND_PROXY_ADDR} LOCUST_WEB_HOST=loadgenerator LOCUST_AUTOSTART=true From d6aeb22d9bcf81ead26bc0d9f90cb2323e54714a Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Fri, 13 Dec 2024 20:14:03 -0500 Subject: [PATCH 5/8] increase Jaeger capacity --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 984d4c8858..e3873ae40e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -689,7 +689,7 @@ services: image: ${JAEGERTRACING_IMAGE} container_name: jaeger command: - - "--memory.max-traces=5000" + - "--memory.max-traces=25000" - "--query.base-path=/jaeger/ui" - "--prometheus.server-url=http://${PROMETHEUS_ADDR}" - "--prometheus.query.normalize-calls=true" @@ -697,7 +697,7 @@ services: deploy: resources: limits: - memory: 400M + memory: 1200M restart: unless-stopped ports: - "${JAEGER_SERVICE_PORT}" # Jaeger UI From 419147becc6955ec2c14a34a63b4545ad7f29026 Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Fri, 13 Dec 2024 20:43:31 -0500 Subject: [PATCH 6/8] use heatmap for histogram --- .../provisioning/dashboards/demo/exemplars-dashboard.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/grafana/provisioning/dashboards/demo/exemplars-dashboard.json b/src/grafana/provisioning/dashboards/demo/exemplars-dashboard.json index b65c933c51..f54ad535e2 100644 --- a/src/grafana/provisioning/dashboards/demo/exemplars-dashboard.json +++ b/src/grafana/provisioning/dashboards/demo/exemplars-dashboard.json @@ -18,7 +18,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 4, + "id": 9, "links": [], "panels": [ { @@ -71,7 +71,7 @@ "mode": "scheme", "reverse": false, "scale": "exponential", - "scheme": "Oranges", + "scheme": "Spectral", "steps": 64 }, "exemplars": { From bbd8693cd08a22bc92e73f2a11778dff68add6c0 Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Fri, 13 Dec 2024 21:27:36 -0500 Subject: [PATCH 7/8] linter fix --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff840f2da9..2455618914 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,7 +34,7 @@ the release. ([#1830](https://github.com/open-telemetry/opentelemetry-demo/pull/1830)) * [grafana] Add Exemplars Dashboard ([#1836](https://github.com/open-telemetry/opentelemetry-demo/pull/1836)) - + ## 1.12.0 * [accountingservice] allow running the container with non root user From 974a7021e35dd1313a3b7ae3e588334301833581 Mon Sep 17 00:00:00 2001 From: Juliano Costa Date: Mon, 16 Dec 2024 09:28:37 +0100 Subject: [PATCH 8/8] Add extra row --- .../dashboards/demo/exemplars-dashboard.json | 209 +++++++++++++++++- 1 file changed, 203 insertions(+), 6 deletions(-) diff --git a/src/grafana/provisioning/dashboards/demo/exemplars-dashboard.json b/src/grafana/provisioning/dashboards/demo/exemplars-dashboard.json index f54ad535e2..9d8ed82061 100644 --- a/src/grafana/provisioning/dashboards/demo/exemplars-dashboard.json +++ b/src/grafana/provisioning/dashboards/demo/exemplars-dashboard.json @@ -18,7 +18,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 9, + "id": 5, "links": [], "panels": [ { @@ -29,11 +29,113 @@ "x": 0, "y": 0 }, - "id": 3, + "id": 4, "panels": [], - "title": "Cart Service Exemplars", + "title": "GetCart Exemplars", "type": "row" }, + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 5, + "interval": "2m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" + }, + "disableTextWrap": false, + "editorMode": "builder", + "exemplar": true, + "expr": "histogram_quantile(0.95, sum by(le) (rate(app_cart_get_cart_latency_bucket[$__rate_interval])))", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "p95 GetCart", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "95th Pct Cart GetCart Latency with Exemplars", + "type": "timeseries" + }, { "datasource": { "type": "prometheus", @@ -116,6 +218,101 @@ "title": "GetCart Latency Heatmap with Exemplars", "type": "heatmap" }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 20 + }, + "id": 3, + "panels": [], + "title": "AddItem Exemplars", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "webstore-metrics" + }, + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 21 + }, + "id": 6, + "interval": "2m", + "options": { + "calculate": false, + "cellGap": 1, + "color": { + "exponent": 0.5, + "fill": "dark-orange", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "Spectral", + "steps": 64 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": true + }, + "rowsFrame": { + "layout": "auto" + }, + "tooltip": { + "mode": "single", + "showColorScale": false, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "reverse": false + } + }, + "pluginVersion": "11.3.0", + "targets": [ + { + "disableTextWrap": false, + "editorMode": "builder", + "exemplar": true, + "expr": "sum by(le) (rate(app_cart_add_item_latency_bucket[$__rate_interval]))", + "format": "heatmap", + "fullMetaSearch": false, + "includeNullMetadata": false, + "instant": true, + "legendFormat": "{{le}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "AddItem Latency Heatmap with Exemplars", + "type": "heatmap" + }, { "datasource": { "type": "prometheus", @@ -180,7 +377,7 @@ "h": 10, "w": 24, "x": 0, - "y": 10 + "y": 30 }, "id": 1, "interval": "2m", @@ -209,7 +406,7 @@ "expr": "histogram_quantile(0.95, sum by(le) (rate(app_cart_add_item_latency_bucket[$__rate_interval])))", "fullMetaSearch": false, "includeNullMetadata": false, - "legendFormat": "{{le}}", + "legendFormat": "p95 AddItem", "range": true, "refId": "A", "useBackend": false @@ -235,4 +432,4 @@ "uid": "ce6sd46kfkglca", "version": 1, "weekStart": "" -} \ No newline at end of file +}