From 5f57e561c76d9ffd81072b3288dc54e55e49e9d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=99=9F=20Wu=20Sheng?= Date: Thu, 10 Jan 2019 07:27:23 +0800 Subject: [PATCH] Provide grafana settings for telemetry (#2138) * Change a label name for sw instance to avoid confict. * Fix a wrong metric name. * Fix too many counter instances. * Set uptime to second. * Fix format. * Fix format * Remove two unnecessary counter. * Provide grafana dashboard settings and remove unnecessary metric. * Provide a simple UI brief doc. Fix #2137 --- docs/en/concepts-and-designs/README.md | 2 +- docs/en/concepts-and-designs/ui-overview.md | 14 + docs/en/setup/backend/backend-telemetry.md | 16 +- .../backend/telemetry/mesh-mode-grafana.json | 1119 +++++++++++++++ .../backend/telemetry/trace-mode-grafana.json | 1203 +++++++++++++++++ .../server/core/storage/PersistenceTimer.java | 8 - .../server/receiver/mesh/MeshGRPCHandler.java | 4 - .../trace/provider/TraceModuleProvider.java | 2 +- .../TraceSegmentReportServiceHandler.java | 4 - .../trace/provider/parser/SegmentParse.java | 25 +- .../trace/provider/parser/SegmentParseV2.java | 35 +- .../oap/server/starter/OAPServerStartUp.java | 4 +- .../telemetry/prometheus/BaseMetric.java | 2 +- 13 files changed, 2390 insertions(+), 48 deletions(-) create mode 100644 docs/en/concepts-and-designs/ui-overview.md create mode 100644 docs/en/setup/backend/telemetry/mesh-mode-grafana.json create mode 100644 docs/en/setup/backend/telemetry/trace-mode-grafana.json diff --git a/docs/en/concepts-and-designs/README.md b/docs/en/concepts-and-designs/README.md index a3404c9ab..271e20ccc 100644 --- a/docs/en/concepts-and-designs/README.md +++ b/docs/en/concepts-and-designs/README.md @@ -20,4 +20,4 @@ SkyWalking already support. - [Observability Analysis Language](oal.md). Introduces the core languages, which is designed for aggregation behaviour definition. - [Query in OAP](../protocols/README.md#query-protocol). A set of query protocol provided, based on the Observability Analysis Language metric definition. - UI - - [Overview](ui-overview.md). + - [Overview](ui-overview.md). A simple brief about SkyWalking UI. diff --git a/docs/en/concepts-and-designs/ui-overview.md b/docs/en/concepts-and-designs/ui-overview.md new file mode 100644 index 000000000..c9fd9562b --- /dev/null +++ b/docs/en/concepts-and-designs/ui-overview.md @@ -0,0 +1,14 @@ +# Visualization +SkyWalking native UI provides the default visualization solution. +It provides observability related graphs +about overview, service, service instance, endpoint, trace and alarm, +including topology, dependency graph, heatmap, etc. + +For most open source users, this UI solution should be good enough to use. +And you have other open source options in visualization. +See [UI setup](../setup/backend/ui-setup.md). + +Also, we have already known, many of our users have integrated SkyWalking +into their products. +If you want to do that too, please use [SkyWalking query protocol](../protocols/README.md#query-protocol). + \ No newline at end of file diff --git a/docs/en/setup/backend/backend-telemetry.md b/docs/en/setup/backend/backend-telemetry.md index 842f8d258..f60f405bb 100644 --- a/docs/en/setup/backend/backend-telemetry.md +++ b/docs/en/setup/backend/backend-telemetry.md @@ -5,16 +5,26 @@ telemetry: none: ``` -In order to open, we should set `prometheus` to provider. The endpoint open at http://0.0.0.0:1234/ +## Prometheus +Prometheus is supported as telemetry implementor. +By using this, prometheus collects metric from skywalking backend. + +Set `prometheus` to provider. The endpoint open at `http://0.0.0.0:1234/` and `http://0.0.0.0:1234/metrics`. ```yaml telemetry: prometheus: ``` -You could set host and port +Set host and port if needed. ```yaml telemetry: prometheus: host: 127.0.0.1 port: 1543 -``` \ No newline at end of file +``` + +### Grafana Visualization +Provide two grafana dashboard settings. +1. Use [SkyWalking trace-mode dashboard](telemetry/trace-mode-grafana.json) when SkyWalking is used with tracing agent. +1. Use [SkyWalking mesh-mode dashboard](telemetry/mesh-mode-grafana.json) when SkyWalking is used with service mesh +telemetry, including istio, envoy. \ No newline at end of file diff --git a/docs/en/setup/backend/telemetry/mesh-mode-grafana.json b/docs/en/setup/backend/telemetry/mesh-mode-grafana.json new file mode 100644 index 000000000..95baf57eb --- /dev/null +++ b/docs/en/setup/backend/telemetry/mesh-mode-grafana.json @@ -0,0 +1,1119 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Metric for skywalking backend", + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 3, + "links": [], + "panels": [ + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 6, + "x": 0, + "y": 0 + }, + "id": 13, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "count(uptime)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "", + "title": "instances number", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 6, + "x": 6, + "y": 0 + }, + "id": 20, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "%", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "expr": "sum(increase(process_cpu_seconds_total[1m])) * 100 / 60", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "CPU", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 6, + "x": 12, + "y": 0 + }, + "id": 21, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "s", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "expr": "sum(jvm_gc_collection_seconds_sum) / sum(jvm_gc_collection_seconds_count)", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "GC time", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 6, + "x": 18, + "y": 0 + }, + "id": 22, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "Mb", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "expr": "sum(jvm_memory_bytes_used) / 1000 / 1000", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Memory", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "fill": 1, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 2 + }, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(mesh_grpc_in_latency_count[1m])", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Mesh telemetry received", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "cards": { + "cardPadding": null, + "cardRound": null + }, + "color": { + "cardColor": "#70dbed", + "colorScale": "linear", + "colorScheme": "interpolateBlues", + "exponent": 0.5, + "mode": "opacity" + }, + "dataFormat": "tsbuckets", + "datasource": "Prometheus", + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 2 + }, + "heatmap": {}, + "highlightCards": true, + "id": 6, + "legend": { + "show": false + }, + "links": [], + "targets": [ + { + "expr": "rate(mesh_grpc_in_latency_bucket[10m])", + "format": "heatmap", + "hide": false, + "instant": false, + "interval": "15s", + "intervalFactor": 1, + "legendFormat": "{{le}}", + "refId": "A" + } + ], + "title": "mesh telemetry latency", + "tooltip": { + "show": true, + "showHistogram": false + }, + "type": "heatmap", + "xAxis": { + "show": true + }, + "xBucketNumber": null, + "xBucketSize": null, + "yAxis": { + "decimals": null, + "format": "s", + "logBase": 1, + "max": null, + "min": null, + "show": true, + "splitFactor": null + }, + "yBucketBound": "auto", + "yBucketNumber": null, + "yBucketSize": null + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "fill": 1, + "gridPos": { + "h": 6, + "w": 8, + "x": 0, + "y": 8 + }, + "id": 8, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(mesh_buffer_file_in[1m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "mesh telemetry buffer file in", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "fill": 1, + "gridPos": { + "h": 6, + "w": 8, + "x": 8, + "y": 8 + }, + "id": 9, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(mesh_buffer_file_retry[1m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "mesh telemetry retry buffer file", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "fill": 1, + "gridPos": { + "h": 6, + "w": 8, + "x": 16, + "y": 8 + }, + "id": 10, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(mesh_buffer_file_out[1m]) ", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "mesh telemetry out of buffer file", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "fill": 1, + "gridPos": { + "h": 6, + "w": 8, + "x": 0, + "y": 14 + }, + "id": 18, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(persistence_timer_bulk_prepare_latency_count[1m])", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}-prepare", + "refId": "A" + }, + { + "expr": "rate(persistence_timer_bulk_error_count[1m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}-error", + "refId": "B" + }, + { + "expr": "rate(persistence_timer_bulk_execute_latency_count[1m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}-execute", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Persistence execution count", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "cards": { + "cardPadding": null, + "cardRound": null + }, + "color": { + "cardColor": "#aea2e0", + "colorScale": "sqrt", + "colorScheme": "interpolateOranges", + "exponent": 0.5, + "mode": "opacity" + }, + "dataFormat": "tsbuckets", + "datasource": "Prometheus", + "gridPos": { + "h": 6, + "w": 8, + "x": 8, + "y": 14 + }, + "heatmap": {}, + "highlightCards": true, + "id": 17, + "legend": { + "show": false + }, + "links": [], + "targets": [ + { + "expr": "rate(persistence_timer_bulk_execute_latency_bucket[10m])", + "format": "heatmap", + "hide": false, + "instant": false, + "interval": "15s", + "intervalFactor": 1, + "legendFormat": "{{le}}", + "refId": "A" + } + ], + "title": "persistent latency", + "tooltip": { + "show": true, + "showHistogram": false + }, + "type": "heatmap", + "xAxis": { + "show": true + }, + "xBucketNumber": null, + "xBucketSize": null, + "yAxis": { + "decimals": null, + "format": "s", + "logBase": 1, + "max": null, + "min": null, + "show": true, + "splitFactor": null + }, + "yBucketBound": "auto", + "yBucketNumber": null, + "yBucketSize": null + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "fill": 1, + "gridPos": { + "h": 6, + "w": 8, + "x": 16, + "y": 14 + }, + "id": 16, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "persistence_timer_bulk_prepare_latency_sum / persistence_timer_bulk_prepare_latency_count", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}-prepare", + "refId": "A" + }, + { + "expr": "persistence_timer_bulk_execute_latency_sum / persistence_timer_bulk_execute_latency_count", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}-execute", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Persistence time", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "fill": 1, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 20 + }, + "id": 23, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(indicator_aggregation {dimensionality=\"min\"} [1m])) by (level)", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Aggregation", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": false, + "schemaVersion": 16, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "SkyWalking mesh-mode dashboard", + "uid": "P9nAI98mz", + "version": 4 +} \ No newline at end of file diff --git a/docs/en/setup/backend/telemetry/trace-mode-grafana.json b/docs/en/setup/backend/telemetry/trace-mode-grafana.json new file mode 100644 index 000000000..5ae652b38 --- /dev/null +++ b/docs/en/setup/backend/telemetry/trace-mode-grafana.json @@ -0,0 +1,1203 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Metric for skywalking backend", + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 2, + "links": [], + "panels": [ + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 6, + "x": 0, + "y": 0 + }, + "id": 13, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "count(uptime)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "", + "title": "instances number", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 6, + "x": 6, + "y": 0 + }, + "id": 20, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "%", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "expr": "sum(increase(process_cpu_seconds_total[1m])) * 100 / 60", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "CPU", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 6, + "x": 12, + "y": 0 + }, + "id": 21, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "s", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "expr": "sum(jvm_gc_collection_seconds_sum) / sum(jvm_gc_collection_seconds_count)", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "GC time", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 6, + "x": 18, + "y": 0 + }, + "id": 22, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "Mb", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "expr": "sum(jvm_memory_bytes_used) / 1000 / 1000", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Memory", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "fill": 1, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 2 + }, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(trace_grpc_v6_in_latency_count[1m])", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Trace received in v6 format", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "cards": { + "cardPadding": null, + "cardRound": null + }, + "color": { + "cardColor": "#70dbed", + "colorScale": "linear", + "colorScheme": "interpolateBlues", + "exponent": 0.5, + "mode": "opacity" + }, + "dataFormat": "tsbuckets", + "datasource": "Prometheus", + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 2 + }, + "heatmap": {}, + "highlightCards": true, + "id": 6, + "legend": { + "show": false + }, + "links": [], + "targets": [ + { + "expr": "rate(trace_grpc_v6_in_latency_bucket[10m])", + "format": "heatmap", + "hide": false, + "instant": false, + "interval": "15s", + "intervalFactor": 1, + "legendFormat": "{{le}}", + "refId": "A" + } + ], + "title": "v6 format trace latency", + "tooltip": { + "show": true, + "showHistogram": false + }, + "type": "heatmap", + "xAxis": { + "show": true + }, + "xBucketNumber": null, + "xBucketSize": null, + "yAxis": { + "decimals": null, + "format": "s", + "logBase": 1, + "max": null, + "min": null, + "show": true, + "splitFactor": null + }, + "yBucketBound": "auto", + "yBucketNumber": null, + "yBucketSize": null + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "fill": 1, + "gridPos": { + "h": 6, + "w": 6, + "x": 0, + "y": 8 + }, + "id": 8, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(v6_trace_buffer_file_in[1m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "trace into buffer file", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "fill": 1, + "gridPos": { + "h": 6, + "w": 6, + "x": 6, + "y": 8 + }, + "id": 9, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(v6_trace_buffer_file_retry[1m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "trace retry into buffer file", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "fill": 1, + "gridPos": { + "h": 6, + "w": 6, + "x": 12, + "y": 8 + }, + "id": 10, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(v6_trace_buffer_file_out[1m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "trace out of buffer file", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "fill": 1, + "gridPos": { + "h": 6, + "w": 6, + "x": 18, + "y": 8 + }, + "id": 11, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(v6_trace_parse_error[1m]) ", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "trace parse error", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "fill": 1, + "gridPos": { + "h": 6, + "w": 8, + "x": 0, + "y": 14 + }, + "id": 18, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(persistence_timer_bulk_prepare_latency_count[1m])", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}-prepare", + "refId": "A" + }, + { + "expr": "rate(persistence_timer_bulk_error_count[1m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}-error", + "refId": "B" + }, + { + "expr": "rate(persistence_timer_bulk_execute_latency_count[1m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}-execute", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Persistence execution count", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "cards": { + "cardPadding": null, + "cardRound": null + }, + "color": { + "cardColor": "#aea2e0", + "colorScale": "sqrt", + "colorScheme": "interpolateOranges", + "exponent": 0.5, + "mode": "opacity" + }, + "dataFormat": "tsbuckets", + "datasource": "Prometheus", + "gridPos": { + "h": 6, + "w": 8, + "x": 8, + "y": 14 + }, + "heatmap": {}, + "highlightCards": true, + "id": 17, + "legend": { + "show": false + }, + "links": [], + "targets": [ + { + "expr": "rate(persistence_timer_bulk_execute_latency_bucket[10m])", + "format": "heatmap", + "hide": false, + "instant": false, + "interval": "15s", + "intervalFactor": 1, + "legendFormat": "{{le}}", + "refId": "A" + } + ], + "title": "persistent latency", + "tooltip": { + "show": true, + "showHistogram": false + }, + "type": "heatmap", + "xAxis": { + "show": true + }, + "xBucketNumber": null, + "xBucketSize": null, + "yAxis": { + "decimals": null, + "format": "s", + "logBase": 1, + "max": null, + "min": null, + "show": true, + "splitFactor": null + }, + "yBucketBound": "auto", + "yBucketNumber": null, + "yBucketSize": null + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "fill": 1, + "gridPos": { + "h": 6, + "w": 8, + "x": 16, + "y": 14 + }, + "id": 16, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "persistence_timer_bulk_prepare_latency_sum / persistence_timer_bulk_prepare_latency_count", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}-prepare", + "refId": "A" + }, + { + "expr": "persistence_timer_bulk_execute_latency_sum / persistence_timer_bulk_execute_latency_count", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{sw_backend_instance}}-execute", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Persistence time", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "fill": 1, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 20 + }, + "id": 23, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(indicator_aggregation {dimensionality=\"min\"} [1m])) by (level)", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Aggregation", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": false, + "schemaVersion": 16, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "SkyWalking trace-mode dashboard", + "uid": "7NEmel8mk", + "version": 17 +} \ No newline at end of file diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/PersistenceTimer.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/PersistenceTimer.java index 522f9d591..367bd9e42 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/PersistenceTimer.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/PersistenceTimer.java @@ -38,9 +38,7 @@ public enum PersistenceTimer { private Boolean isStarted = false; private final Boolean debug; private CounterMetric errorCounter; - private CounterMetric prepareCounter; private HistogramMetric prepareLatency; - private CounterMetric executeCounter; private HistogramMetric executeLatency; PersistenceTimer() { @@ -57,12 +55,8 @@ public enum PersistenceTimer { MetricCreator metricCreator = moduleManager.find(TelemetryModule.NAME).provider().getService(MetricCreator.class); errorCounter = metricCreator.createCounter("persistence_timer_bulk_error_count", "Error execution of the prepare stage in persistence timer", MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE); - prepareCounter = metricCreator.createCounter("persistence_timer_bulk_prepare_count", "Execution of the prepare stage in persistence timer", - MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE); prepareLatency = metricCreator.createHistogramMetric("persistence_timer_bulk_prepare_latency", "Latency of the prepare stage in persistence timer", MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE); - executeCounter = metricCreator.createCounter("persistence_timer_bulk_execute_count", "Execution of the execute stage in persistence timer", - MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE); executeLatency = metricCreator.createHistogramMetric("persistence_timer_bulk_execute_latency", "Latency of the execute stage in persistence timer", MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE); @@ -83,7 +77,6 @@ public enum PersistenceTimer { long startTime = System.currentTimeMillis(); try { - prepareCounter.inc(); HistogramMetric.Timer timer = prepareLatency.createTimer(); List batchAllCollection = new LinkedList(); @@ -114,7 +107,6 @@ public enum PersistenceTimer { timer.finish(); } - executeCounter.inc(); HistogramMetric.Timer executeLatencyTimer = executeLatency.createTimer(); try { batchDAO.batchPersistence(batchAllCollection); diff --git a/oap-server/server-receiver-plugin/skywalking-mesh-receiver-plugin/src/main/java/org/apache/skywalking/aop/server/receiver/mesh/MeshGRPCHandler.java b/oap-server/server-receiver-plugin/skywalking-mesh-receiver-plugin/src/main/java/org/apache/skywalking/aop/server/receiver/mesh/MeshGRPCHandler.java index 496fbbaac..4658d3d39 100644 --- a/oap-server/server-receiver-plugin/skywalking-mesh-receiver-plugin/src/main/java/org/apache/skywalking/aop/server/receiver/mesh/MeshGRPCHandler.java +++ b/oap-server/server-receiver-plugin/skywalking-mesh-receiver-plugin/src/main/java/org/apache/skywalking/aop/server/receiver/mesh/MeshGRPCHandler.java @@ -28,13 +28,10 @@ import org.slf4j.*; public class MeshGRPCHandler extends ServiceMeshMetricServiceGrpc.ServiceMeshMetricServiceImplBase { private static final Logger logger = LoggerFactory.getLogger(MeshGRPCHandler.class); - private CounterMetric counter; private HistogramMetric histogram; public MeshGRPCHandler(ModuleManager moduleManager) { MetricCreator metricCreator = moduleManager.find(TelemetryModule.NAME).provider().getService(MetricCreator.class); - counter = metricCreator.createCounter("mesh_grpc_in_count", "The count of service mesh telemetry", - MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE); histogram = metricCreator.createHistogramMetric("mesh_grpc_in_latency", "The process latency of service mesh telemetry", MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE); } @@ -46,7 +43,6 @@ public class MeshGRPCHandler extends ServiceMeshMetricServiceGrpc.ServiceMeshMet if (logger.isDebugEnabled()) { logger.debug("Received mesh metric: {}", metric); } - counter.inc(); HistogramMetric.Timer timer = histogram.createTimer(); try { TelemetryDataDispatcher.preProcess(metric); diff --git a/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/TraceModuleProvider.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/TraceModuleProvider.java index 09fb31050..baa027ffb 100644 --- a/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/TraceModuleProvider.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/TraceModuleProvider.java @@ -101,7 +101,7 @@ public class TraceModuleProvider extends ModuleProvider { SegmentStandardizationWorker standardizationWorker2 = new SegmentStandardizationWorker(getManager(), segmentProducer, moduleConfig.getBufferPath(), moduleConfig.getBufferOffsetMaxFileSize(), moduleConfig.getBufferDataMaxFileSize(), moduleConfig.isBufferFileCleanWhenRestart(), - false); + true); segmentProducerV2.setStandardizationWorker(standardizationWorker2); } catch (IOException e) { throw new ModuleStartException(e.getMessage(), e); diff --git a/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/handler/v6/grpc/TraceSegmentReportServiceHandler.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/handler/v6/grpc/TraceSegmentReportServiceHandler.java index 22bc0ec56..e411d0e58 100644 --- a/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/handler/v6/grpc/TraceSegmentReportServiceHandler.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/handler/v6/grpc/TraceSegmentReportServiceHandler.java @@ -37,14 +37,11 @@ public class TraceSegmentReportServiceHandler extends TraceSegmentReportServiceG private static final Logger logger = LoggerFactory.getLogger(TraceSegmentServiceHandler.class); private final SegmentParseV2.Producer segmentProducer; - private CounterMetric counter; private HistogramMetric histogram; public TraceSegmentReportServiceHandler(SegmentParseV2.Producer segmentProducer, ModuleManager moduleManager) { this.segmentProducer = segmentProducer; MetricCreator metricCreator = moduleManager.find(TelemetryModule.NAME).provider().getService(MetricCreator.class); - counter = metricCreator.createCounter("trace_grpc_v6_in_count", "The count of service mesh telemetry", - MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE); histogram = metricCreator.createHistogramMetric("trace_grpc_v6_in_latency", "The process latency of service mesh telemetry", MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE); } @@ -56,7 +53,6 @@ public class TraceSegmentReportServiceHandler extends TraceSegmentReportServiceG logger.debug("receive segment"); } - counter.inc(); HistogramMetric.Timer timer = histogram.createTimer(); try { segmentProducer.send(segment, SegmentSource.Agent); diff --git a/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/SegmentParse.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/SegmentParse.java index 24839017d..eb8c692e3 100644 --- a/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/SegmentParse.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/SegmentParse.java @@ -44,9 +44,9 @@ public class SegmentParse { private final SegmentParserListenerManager listenerManager; private final SegmentCoreInfo segmentCoreInfo; @Setter private SegmentStandardizationWorker standardizationWorker; - private CounterMetric traceBufferFileRetry; - private CounterMetric traceBufferFileOut; - private CounterMetric traceParseError; + private volatile static CounterMetric TRACE_BUFFER_FILE_RETRY; + private volatile static CounterMetric TRACE_BUFFER_FILE_OUT; + private volatile static CounterMetric TRACE_PARSE_ERROR; private SegmentParse(ModuleManager moduleManager, SegmentParserListenerManager listenerManager) { this.moduleManager = moduleManager; @@ -58,11 +58,11 @@ public class SegmentParse { this.segmentCoreInfo.setV2(false); MetricCreator metricCreator = moduleManager.find(TelemetryModule.NAME).provider().getService(MetricCreator.class); - traceBufferFileRetry = metricCreator.createCounter("v5_trace_buffer_file_retry", "The number of retry trace segment from the buffer file, but haven't registered successfully.", + TRACE_BUFFER_FILE_RETRY = metricCreator.createCounter("v5_trace_buffer_file_retry", "The number of retry trace segment from the buffer file, but haven't registered successfully.", MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE); - traceBufferFileOut = metricCreator.createCounter("v5_trace_buffer_file_out", "The number of trace segment out of the buffer file", + TRACE_BUFFER_FILE_OUT = metricCreator.createCounter("v5_trace_buffer_file_out", "The number of trace segment out of the buffer file", MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE); - traceParseError = metricCreator.createCounter("v5_trace_parse_error", "The number of trace segment out of the buffer file", + TRACE_PARSE_ERROR = metricCreator.createCounter("v5_trace_parse_error", "The number of trace segment out of the buffer file", MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE); } @@ -84,19 +84,19 @@ public class SegmentParse { writeToBufferFile(segmentCoreInfo.getSegmentId(), segment); } else { // from SegmentSource.Buffer - traceBufferFileRetry.inc(); + TRACE_BUFFER_FILE_RETRY.inc(); } return false; } else { if (logger.isDebugEnabled()) { logger.debug("This segment id exchange success, id: {}", segmentCoreInfo.getSegmentId()); } - traceBufferFileOut.inc(); + TRACE_BUFFER_FILE_OUT.inc(); notifyListenerToBuild(); return true; } } catch (Throwable e) { - traceParseError.inc(); + TRACE_PARSE_ERROR.inc(); logger.error(e.getMessage(), e); return true; } @@ -257,7 +257,12 @@ public class SegmentParse { @Override public boolean call(UpstreamSegment segment) { SegmentParse segmentParse = new SegmentParse(moduleManager, listenerManager); segmentParse.setStandardizationWorker(standardizationWorker); - return segmentParse.parse(segment, Source.Buffer); + boolean parseResult = segmentParse.parse(segment, Source.Buffer); + if (parseResult) { + segmentParse.TRACE_BUFFER_FILE_OUT.inc(); + } + + return parseResult; } } } diff --git a/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/SegmentParseV2.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/SegmentParseV2.java index 13c478392..be074edb7 100644 --- a/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/SegmentParseV2.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/SegmentParseV2.java @@ -47,9 +47,9 @@ public class SegmentParseV2 { private final SegmentParserListenerManager listenerManager; private final SegmentCoreInfo segmentCoreInfo; @Setter private SegmentStandardizationWorker standardizationWorker; - private CounterMetric traceBufferFileRetry; - private CounterMetric traceBufferFileOut; - private CounterMetric traceParseError; + private volatile static CounterMetric TRACE_BUFFER_FILE_RETRY; + private volatile static CounterMetric TRACE_BUFFER_FILE_OUT; + private volatile static CounterMetric TRACE_PARSE_ERROR; private SegmentParseV2(ModuleManager moduleManager, SegmentParserListenerManager listenerManager) { this.moduleManager = moduleManager; @@ -60,13 +60,15 @@ public class SegmentParseV2 { this.segmentCoreInfo.setEndTime(Long.MIN_VALUE); this.segmentCoreInfo.setV2(true); - MetricCreator metricCreator = moduleManager.find(TelemetryModule.NAME).provider().getService(MetricCreator.class); - traceBufferFileRetry = metricCreator.createCounter("v6_trace_buffer_file_retry", "The number of retry trace segment from the buffer file, but haven't registered successfully.", - MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE); - traceBufferFileOut = metricCreator.createCounter("v6_trace_buffer_file_out", "The number of trace segment out of the buffer file", - MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE); - traceParseError = metricCreator.createCounter("v6_trace_parse_error", "The number of trace segment out of the buffer file", - MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE); + if (TRACE_BUFFER_FILE_RETRY == null) { + MetricCreator metricCreator = moduleManager.find(TelemetryModule.NAME).provider().getService(MetricCreator.class); + TRACE_BUFFER_FILE_RETRY = metricCreator.createCounter("v6_trace_buffer_file_retry", "The number of retry trace segment from the buffer file, but haven't registered successfully.", + MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE); + TRACE_BUFFER_FILE_OUT = metricCreator.createCounter("v6_trace_buffer_file_out", "The number of trace segment out of the buffer file", + MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE); + TRACE_PARSE_ERROR = metricCreator.createCounter("v6_trace_parse_error", "The number of trace segment out of the buffer file", + MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE); + } } public boolean parse(UpstreamSegment segment, SegmentSource source) { @@ -87,19 +89,19 @@ public class SegmentParseV2 { writeToBufferFile(segmentCoreInfo.getSegmentId(), segment); } else { // from SegmentSource.Buffer - traceBufferFileRetry.inc(); + TRACE_BUFFER_FILE_RETRY.inc(); } return false; } else { if (logger.isDebugEnabled()) { logger.debug("This segment id exchange success, id: {}", segmentCoreInfo.getSegmentId()); } - traceBufferFileOut.inc(); + notifyListenerToBuild(); return true; } } catch (Throwable e) { - traceParseError.inc(); + TRACE_PARSE_ERROR.inc(); logger.error(e.getMessage(), e); return true; } @@ -256,7 +258,12 @@ public class SegmentParseV2 { @Override public boolean call(UpstreamSegment segment) { SegmentParseV2 segmentParse = new SegmentParseV2(moduleManager, listenerManager); segmentParse.setStandardizationWorker(standardizationWorker); - return segmentParse.parse(segment, SegmentSource.Buffer); + boolean parseResult = segmentParse.parse(segment, SegmentSource.Buffer); + if (parseResult) { + segmentParse.TRACE_BUFFER_FILE_OUT.inc(); + } + + return parseResult; } } } diff --git a/oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/OAPServerStartUp.java b/oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/OAPServerStartUp.java index 5e008be01..8c16043b6 100644 --- a/oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/OAPServerStartUp.java +++ b/oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/OAPServerStartUp.java @@ -20,7 +20,6 @@ package org.apache.skywalking.oap.server.starter; import org.apache.skywalking.oap.server.core.RunningMode; import org.apache.skywalking.oap.server.library.module.*; -import org.apache.skywalking.oap.server.library.util.TimeBucketUtils; import org.apache.skywalking.oap.server.starter.config.*; import org.apache.skywalking.oap.server.telemetry.TelemetryModule; import org.apache.skywalking.oap.server.telemetry.api.*; @@ -45,7 +44,8 @@ public class OAPServerStartUp { manager.find(TelemetryModule.NAME).provider().getService(MetricCreator.class).createGauge("uptime", "oap server start up time", MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE) - .setValue(TimeBucketUtils.INSTANCE.getMinuteTimeBucket(System.currentTimeMillis())); + // Set uptime to second + .setValue(System.currentTimeMillis() / 1000); if (RunningMode.isInitMode()) { logger.info("OAP starts up in init mode successfully, exit now..."); diff --git a/oap-server/server-telemetry/telemetry-prometheus/src/main/java/org/apache/skywalking/oap/server/telemetry/prometheus/BaseMetric.java b/oap-server/server-telemetry/telemetry-prometheus/src/main/java/org/apache/skywalking/oap/server/telemetry/prometheus/BaseMetric.java index 536154da2..e7d6a0024 100644 --- a/oap-server/server-telemetry/telemetry-prometheus/src/main/java/org/apache/skywalking/oap/server/telemetry/prometheus/BaseMetric.java +++ b/oap-server/server-telemetry/telemetry-prometheus/src/main/java/org/apache/skywalking/oap/server/telemetry/prometheus/BaseMetric.java @@ -57,7 +57,7 @@ public abstract class BaseMetric { try { if (metricInstance == null) { String[] labelNames = new String[labels.getKeys().length + 1]; - labelNames[0] = "instance"; + labelNames[0] = "sw_backend_instance"; for (int i = 0; i < labels.getKeys().length; i++) { labelNames[i + 1] = labels.getKeys()[i]; }