From f0c0a772c34415f89f1e42c432d8e9a2a85fab48 Mon Sep 17 00:00:00 2001 From: vijayg10 <33152110+vijayg10@users.noreply.github.com> Date: Wed, 27 Sep 2023 17:11:16 +0530 Subject: [PATCH 1/3] feat(mojaloop/3520): rebaseline with position prepare batching (#32) * feat: added new batch handler * fix: added batch handlers to prom * fix: test * fix: notification payee disable * fix: versions * fix: doc --- .env | 5 ++- README.md | 5 +++ docker-compose-perf.yml | 41 +++++++++++++++++++ .../configs/central-handlers.js | 10 +++++ docker/prometheus/prometheus.yml | 8 ++++ perf.env | 8 +++- 6 files changed, 74 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 7dd2ad1a..11a8ce8d 100644 --- a/.env +++ b/.env @@ -8,9 +8,11 @@ ACCOUNT_LOOKUP_SERVICE_VERSION=v14.2.3 # ACCOUNT_LOOKUP_SERVICE_VERSION=v14.2.4-snapshot.3 QUOTING_SERVICE_VERSION=v15.0.2 ## CL initial baseline with version included in Mojaloop v15.1.0 Helm Release -CENTRAL_LEDGER_VERSION=v17.0.3 +CENTRAL_LEDGER_VERSION=v17.2.0 ## CL snapshot release with included fix: JSON.stringify disabled in logResponse function # CENTRAL_LEDGER_VERSION=v17.0.4-snapshot.0 +## Central Ledger version with batch processing capability +CENTRAL_LEDGER_BATCH_VERSION=v17.3.0-snapshot.5 ## Testing & Sims TEST_SIMULATOR_VERSION=v11.1.3 @@ -41,5 +43,6 @@ K6_VERSION=0.45.0 ALS_REPLICAS=1 CENTRAL_LEDGER_GENERAL_REPLICAS=4 CENTRAL_LEDGER_POSITION_REPLICAS=8 +CENTRAL_LEDGER_POSITION_BATCH_REPLICAS=0 ML_API_ADAPTER_REPLICAS=4 ML_NOTIFICATION_REPLICAS=4 diff --git a/README.md b/README.md index 2d7f667e..cb7b9d4d 100644 --- a/README.md +++ b/README.md @@ -211,6 +211,11 @@ docker compose --project-name ml-core -f docker-compose-perf.yml --profile trans > NOTE: `-v` argument is optional, and it will delete any volume data created by the monitoring docker compose +### Configuration for Transfers with batch support +- Set CENTRAL_LEDGER_POSITION_BATCH_REPLICAS to desired count in `.env` file +- Enable line `CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__PREPARE=topic-transfer-position-batch` in `perf.env` file +- Set `CENTRAL_LEDGER_VERSION` to `v17.2.0` or higher + ### Monitoring Start Monitoring Services stack which uses: diff --git a/docker-compose-perf.yml b/docker-compose-perf.yml index 556f3a5a..3b507189 100644 --- a/docker-compose-perf.yml +++ b/docker-compose-perf.yml @@ -266,6 +266,46 @@ services: - all-services - transfers-test + central-handler-position-batch: + image: mojaloop/central-ledger:${CENTRAL_LEDGER_BATCH_VERSION} + env_file: + - .env + - perf.env + deploy: + mode: replicated + replicas: ${CENTRAL_LEDGER_POSITION_BATCH_REPLICAS} + command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/central-handlers.js /opt/app/config/default.json && /opt/app/wait4/wait4.js central-ledger && node src/handlers/index.js handler --positionbatch" + # ports: + # - "3001:3001" + volumes: + - ./docker/wait4:/opt/app/wait4 + - ./docker/config-modifier:/opt/app/config-modifier + environment: + # - LOG_LEVEL=error + - CLEDG_MONGODB__DISABLED=true + - EVENT_SDK_TRACEID_PER_VENDOR=false + networks: + - mojaloop-net + depends_on: + central-ledger-migrator: + condition: service_completed_successfully + mysql-cl: + condition: service_healthy + kafka: + condition: service_started + healthcheck: + test: wget -q http://localhost:3001/health -O /dev/null || exit 1 + timeout: 20s + retries: 30 + interval: 30s + start_period: 30s + user: root + profiles: + - central-ledger + - transfer + - all-services + - transfers-test + central-handler-fulfil: image: mojaloop/central-ledger:${CENTRAL_LEDGER_VERSION} env_file: @@ -469,6 +509,7 @@ services: echo -e 'Creating kafka topics' kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-transfer-prepare --replication-factor 1 --partitions $$KAFKA_GENERAL_PARTITIONS_NUM kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-transfer-position --replication-factor 1 --partitions $$KAFKA_POSITION_PARTITIONS_NUM + kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-transfer-position-batch --replication-factor 1 --partitions $$KAFKA_POSITION_BATCH_PARTITIONS_NUM kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-transfer-fulfil --replication-factor 1 --partitions $$KAFKA_GENERAL_PARTITIONS_NUM kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-notification-event --replication-factor 1 --partitions $$KAFKA_NOTIFICATION_PARTITIONS_NUM kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-transfer-get --replication-factor 1 --partitions $$KAFKA_GENERAL_PARTITIONS_NUM diff --git a/docker/config-modifier/configs/central-handlers.js b/docker/config-modifier/configs/central-handlers.js index ca464ac7..5b7d36c1 100644 --- a/docker/config-modifier/configs/central-handlers.js +++ b/docker/config-modifier/configs/central-handlers.js @@ -75,6 +75,16 @@ module.exports = { "metadata.broker.list": "kafka:29092" } } + }, + "POSITION_BATCH": { + "config": { + "options": { + "batchSize": 50 + }, + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } } }, "ADMIN": { diff --git a/docker/prometheus/prometheus.yml b/docker/prometheus/prometheus.yml index b2e26024..4aa3945c 100644 --- a/docker/prometheus/prometheus.yml +++ b/docker/prometheus/prometheus.yml @@ -88,6 +88,14 @@ scrape_configs: 'ml-core-central-handler-position-6:3001', 'ml-core-central-handler-position-7:3001', 'ml-core-central-handler-position-8:3001', + 'ml-core-central-handler-position-batch-1:3001', + 'ml-core-central-handler-position-batch-2:3001', + 'ml-core-central-handler-position-batch-3:3001', + 'ml-core-central-handler-position-batch-4:3001', + 'ml-core-central-handler-position-batch-5:3001', + 'ml-core-central-handler-position-batch-6:3001', + 'ml-core-central-handler-position-batch-7:3001', + 'ml-core-central-handler-position-batch-8:3001', 'ml-core-central-handler-fulfil-1:3001', 'ml-core-central-handler-fulfil-2:3001', 'ml-core-central-handler-fulfil-3:3001', diff --git a/perf.env b/perf.env index 32129a0d..efb7e1bd 100644 --- a/perf.env +++ b/perf.env @@ -11,7 +11,7 @@ K6_OUT=experimental-prometheus-rw # Ref: https://k6.io/docs/results-output/real- # K6_SCRIPT_PAUSE_MIN=5 # K6_SCRIPT_PAUSE_MAX=15 # K6_SCRIPT_WS_TIMEOUT_MS=10000 -K6_SCRIPT_WS_TIMEOUT_MS=2000 +K6_SCRIPT_WS_TIMEOUT_MS=50000 #### Use this if we want to hit the ALS K6_SCRIPT_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 #### Use this if we want to bypass ALS @@ -60,6 +60,7 @@ LOG_LEVEL=info KAFKA_GENERAL_PARTITIONS_NUM=19 KAFKA_POSITION_PARTITIONS_NUM=19 +KAFKA_POSITION_BATCH_PARTITIONS_NUM=19 KAFKA_NOTIFICATION_PARTITIONS_NUM=19 ALS_DATABASE__HOST=mysql-als @@ -81,5 +82,8 @@ CLEDG_DATABASE__PASSWORD=password CLEDG_DATABASE__SCHEMA=central_ledger ## MLAPI - ML API Adapter API/Handler Config -MLAPI_TRANSFERS__SEND_TRANSFER_CONFIRMATION_TO_PAYEE=false # MLAPI_ENDPOINT_SOURCE_URL=http://callback-handler-svc-cl-sim:3001/admin + +## Batching - Enable following only when position batch handlers are enabled +## To enable position batch handlers, set CENTRAL_LEDGER_POSITION_BATCH_REPLICAS to desired count +# CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__PREPARE=topic-transfer-position-batch From 2af14663027a8917d31b5571502442e17a357fd8 Mon Sep 17 00:00:00 2001 From: Kevin Leyow Date: Mon, 2 Oct 2023 12:09:23 -0500 Subject: [PATCH 2/3] feat(mojaloop/#3532): add test harness and profile for quote characterization (#33) * feat(mojaloop/#3532): add test harness and profile for quote characterization * chore: address comments * chore: remove * chore: update version --- .env | 3 +- README.md | 27 +- docker-compose-monitoring.yml | 1 + docker-compose-perf.yml | 62 +- .../configs/quoting-service-perf.js | 8 + .../dashboards/dashboard-quoting-service.json | 1553 +++++++++++++++++ docker/prometheus/prometheus.yml | 4 + envs/perffsp1.env | 7 +- envs/perffsp2.env | 5 + envs/perffsp3.env | 5 + envs/perffsp4.env | 5 + envs/perffsp5.env | 5 + envs/perffsp6.env | 5 + envs/perffsp7.env | 5 + envs/perffsp8.env | 5 + .../callback-handler-svc/handlers/admin.js | 158 +- .../callback-handler-svc/handlers/fspiop.js | 86 +- .../callback-handler-svc/package-lock.json | 29 +- packages/callback-handler-svc/package.json | 2 +- packages/k6-tests/config/fspiopQuotes.json | 21 + packages/k6-tests/index.js | 1 + packages/k6-tests/scenarios/fspiopQuotes.js | 6 + packages/k6-tests/scripts/postQuotes.js | 130 ++ perf.env | 4 + 24 files changed, 2033 insertions(+), 104 deletions(-) create mode 100644 docker/config-modifier/configs/quoting-service-perf.js create mode 100644 docker/grafana/provisioning/dashboards/dashboard-quoting-service.json create mode 100644 packages/k6-tests/config/fspiopQuotes.json create mode 100644 packages/k6-tests/scenarios/fspiopQuotes.js create mode 100644 packages/k6-tests/scripts/postQuotes.js diff --git a/.env b/.env index 11a8ce8d..7ebfae11 100644 --- a/.env +++ b/.env @@ -6,7 +6,7 @@ ML_API_ADAPTER_VERSION=v14.0.1 ACCOUNT_LOOKUP_SERVICE_VERSION=v14.2.3 ## ALS snapshot release with fix: v14.2.3 + caching for validateParticipant and resolve Participants via Oracles # ACCOUNT_LOOKUP_SERVICE_VERSION=v14.2.4-snapshot.3 -QUOTING_SERVICE_VERSION=v15.0.2 +QUOTING_SERVICE_VERSION=v15.1.0 ## CL initial baseline with version included in Mojaloop v15.1.0 Helm Release CENTRAL_LEDGER_VERSION=v17.2.0 ## CL snapshot release with included fix: JSON.stringify disabled in logResponse function @@ -40,6 +40,7 @@ CADVISER_VERSION=latest K6_VERSION=0.45.0 ## Performance Testing Replicas +QS_REPLICAS=1 ALS_REPLICAS=1 CENTRAL_LEDGER_GENERAL_REPLICAS=4 CENTRAL_LEDGER_POSITION_REPLICAS=8 diff --git a/README.md b/README.md index cb7b9d4d..6a3079ea 100644 --- a/README.md +++ b/README.md @@ -211,6 +211,21 @@ docker compose --project-name ml-core -f docker-compose-perf.yml --profile trans > NOTE: `-v` argument is optional, and it will delete any volume data created by the monitoring docker compose + +### Running Services for Quotes characterization + +```bash +docker compose --project-name ml-core -f docker-compose-perf.yml --profile quotes-test --profile 8dfsp --profile ttk-provisioning-quotes up -d +``` + +Stop Services + +```bash +docker compose --project-name ml-core -f docker-compose-perf.yml --profile quotes-test --profile 8dfsp down -v +``` + +> NOTE: `-v` argument is optional, and it will delete any volume data created by the monitoring docker compose + ### Configuration for Transfers with batch support - Set CENTRAL_LEDGER_POSITION_BATCH_REPLICAS to desired count in `.env` file - Enable line `CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__PREPARE=topic-transfer-position-batch` in `perf.env` file @@ -247,6 +262,14 @@ Start monitoring with central ledger mysql exporter docker compose --project-name monitoring --profile transfers-test -f docker-compose-monitoring.yml up -d ``` +or + +```bash +docker compose --project-name monitoring --profile quotes-test -f docker-compose-monitoring.yml up -d +``` + +since the quoting service uses the central ledger database. + > NOTE: `-v` argument is optional, and it will delete any volume data created by the monitoring docker compose TODO: @@ -261,7 +284,7 @@ Tests can be defined in the [./packages/k6-tests/scripts/test.js](./packages/k6- Env configs are stored in the [./perf.env](./perf.env) environment configuration file.. -Note: Transfer testing +Note: Transfer testing and quote testing Depending on the profile you started the performance docker compose with i.e `--profile transfers-test --profile {2/4/8}dfsp` You will need to edit `K6_SCRIPT_FSPIOP_FSP_POOL` json string in `./perf.env` to contain 2/4/8 dfsps depending on your test. @@ -288,6 +311,8 @@ env K6_SCRIPT_CONFIG_FILE_NAME=fspiopTransfers.json docker compose --project-nam env K6_SCRIPT_CONFIG_FILE_NAME=fspiopTransfersUnidirectional.json docker compose --project-name load -f docker-compose-load.yml up ( or ) env K6_SCRIPT_CONFIG_FILE_NAME=fspiopDiscovery.json docker compose --project-name load -f docker-compose-load.yml up +( or ) +env K6_SCRIPT_CONFIG_FILE_NAME=fspiopQuotes.json docker compose --project-name load -f docker-compose-load.yml up ``` Cleanup tests diff --git a/docker-compose-monitoring.yml b/docker-compose-monitoring.yml index 2d1a2d5d..fc2eb285 100644 --- a/docker-compose-monitoring.yml +++ b/docker-compose-monitoring.yml @@ -169,6 +169,7 @@ services: - --mysqld.username=exporter profiles: - transfers-test + - quotes-test kafka-exporter: image: danielqsj/kafka-exporter:${KAFKA_EXPORTER_VERSION} diff --git a/docker-compose-perf.yml b/docker-compose-perf.yml index 3b507189..8d379afe 100644 --- a/docker-compose-perf.yml +++ b/docker-compose-perf.yml @@ -118,8 +118,6 @@ services: depends_on: mysql-cl: condition: service_healthy - kafka: - condition: service_started # objstore: # condition: service_started user: root @@ -130,6 +128,7 @@ services: - agreement - all-services - transfers-test + - quotes-test central-ledger: image: mojaloop/central-ledger:${CENTRAL_LEDGER_VERSION} @@ -177,6 +176,7 @@ services: - agreement - all-services - transfers-test + - quotes-test central-handler-prepare: image: mojaloop/central-ledger:${CENTRAL_LEDGER_VERSION} @@ -471,6 +471,35 @@ services: - all-services - transfers-test + quoting-service: + image: "mojaloop/quoting-service:${QUOTING_SERVICE_VERSION}" + command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/quoting-service-perf.js /opt/app/config/default.json && node src/index.js" + deploy: + mode: replicated + replicas: ${QS_REPLICAS} + networks: + - mojaloop-net + # ports: + # - "3002:3002" + depends_on: + mysql-cl: + condition: service_started + central-ledger: + condition: service_started + environment: + ## Allows TraceID to be propogated - https://github.com/mojaloop/event-sdk#configuration + - EVENT_SDK_TRACEID_PER_VENDOR=false + volumes: + - ./docker/config-modifier:/opt/app/config-modifier + healthcheck: + test: wget -q http://localhost:3002/health -O /dev/null || exit 1 + timeout: 20s + retries: 30 + interval: 15s + user: root + profiles: + - quotes-test + # objstore: # image: mongo:${DEP_MONGO_VERSION} # container_name: objstore @@ -564,6 +593,7 @@ services: - agreement - all-services - transfers-test + - quotes-test mysql-cl: image: mysql/mysql-server:${DEP_MYSQL_VERSION} @@ -595,6 +625,7 @@ services: - agreement - all-services - transfers-test + - quotes-test ## In memory storage - Ref: https://docs.docker.com/storage/tmpfs/ tmpfs: - /var/lib/mysql @@ -705,6 +736,7 @@ services: - all-services - als-test - transfers-test + - quotes-test mojaloop-testing-toolkit-ui: image: mojaloop/ml-testing-toolkit-ui:${TEST_TTK_UI_VERSION} @@ -726,6 +758,7 @@ services: - all-services - als-test - transfers-test + - quotes-test ttk-provisioning-als: image: mojaloop/ml-testing-toolkit-client-lib:${TEST_TTK_CLI_VERSION} @@ -789,6 +822,30 @@ services: profiles: - ttk-provisioning-transfers + ttk-provisioning-quotes: + image: mojaloop/ml-testing-toolkit-client-lib:${TEST_TTK_CLI_VERSION} + env_file: + - .env + - perf.env + volumes: + - "./docker/ml-testing-toolkit/test-cases/collections:/opt/app/collections" + - "./docker/ml-testing-toolkit/test-cases/environments:/opt/app/environments" + - "./reports:/opt/app/reports" + depends_on: + mojaloop-testing-toolkit: + condition: service_healthy + central-ledger: + condition: service_healthy + networks: + - mojaloop-net + command: + - sh + - -c + - "npm run cli -- -u http://mojaloop-testing-toolkit:5050 -l 2 -i collections/provisioning -e environments/default-env.json --save-report --report-format html --report-target file://reports/ttk-provisioning-report.html" + user: root + profiles: + - ttk-provisioning-quotes + callback-handler-svc-oracle-sim: image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} deploy: @@ -855,6 +912,7 @@ services: - all-services - als-test - transfers-test + - quotes-test sim-perffsp1: image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} diff --git a/docker/config-modifier/configs/quoting-service-perf.js b/docker/config-modifier/configs/quoting-service-perf.js new file mode 100644 index 00000000..35391458 --- /dev/null +++ b/docker/config-modifier/configs/quoting-service-perf.js @@ -0,0 +1,8 @@ +module.exports = { + "HOSTNAME": "http://quoting-service", + "DATABASE": { + "HOST": "mysql-cl" + }, + "SIMPLE_ROUTING_MODE": false, + "SWITCH_ENDPOINT": "http://central-ledger:3001" +} diff --git a/docker/grafana/provisioning/dashboards/dashboard-quoting-service.json b/docker/grafana/provisioning/dashboards/dashboard-quoting-service.json new file mode 100644 index 00000000..251d4dba --- /dev/null +++ b/docker/grafana/provisioning/dashboards/dashboard-quoting-service.json @@ -0,0 +1,1553 @@ +{ + "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": 12, + "links": [ + { + "asDropdown": false, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [], + "targetBlank": true, + "title": "Image render", + "tooltip": "Image Render", + "type": "link", + "url": "/render/d/${__dashboard.uid}/${__dashboard}?height=4000&width=2000" + } + ], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 59, + "panels": [], + "title": "Quote Resource Metric Totals", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "text", + "mode": "palette-classic" + }, + "mappings": [ + { + "options": { + "match": "null+nan", + "result": { + "index": 0, + "text": "0" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "reqs" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 5, + "x": 1, + "y": 1 + }, + "id": 17, + "interval": "1s", + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "max" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(moja_qs_quotes_id_get_count)", + "format": "time_series", + "hide": false, + "instant": false, + "interval": "", + "legendFormat": "", + "range": true, + "refId": "A" + } + ], + "title": "Ing GET /quotes/* requests", + "transformations": [ + { + "id": "calculateField", + "options": { + "binary": { + "left": "sum(moja_qs_ing_getQuotesByTypeAndID_count)", + "reducer": "sum", + "right": "sum(moja_qs_ing_getQuotesByTypeIDAndSubID_count)" + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + }, + "replaceFields": true + } + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "text", + "mode": "palette-classic" + }, + "mappings": [ + { + "options": { + "match": "null+nan", + "result": { + "index": 0, + "text": "0" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "reqs" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 6, + "y": 1 + }, + "id": 26, + "interval": "1s", + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "max" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(moja_qs_quotes_id_put_count)", + "format": "time_series", + "hide": false, + "instant": false, + "interval": "", + "legendFormat": "", + "range": true, + "refId": "A" + } + ], + "title": "Ing PUT /quotes/* requests", + "transformations": [ + { + "id": "calculateField", + "options": { + "binary": { + "left": "sum(moja_qs_ing_getQuotesByTypeAndID_count)", + "reducer": "sum", + "right": "sum(moja_qs_ing_getQuotesByTypeIDAndSubID_count)" + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + }, + "replaceFields": true + } + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "text", + "mode": "palette-classic" + }, + "mappings": [ + { + "options": { + "match": "null+nan", + "result": { + "index": 0, + "text": "0" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "reqs" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 5, + "x": 12, + "y": 1 + }, + "id": 31, + "interval": "1s", + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "max" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(moja_qs_quotes_id_put_error_count)", + "hide": false, + "instant": false, + "range": true, + "refId": "A" + } + ], + "title": "Ing PUT /quotes/*/error requests", + "transformations": [ + { + "id": "calculateField", + "options": { + "binary": { + "left": "sum(moja_qs_ing_putQuotesErrorByTypeAndID_count)", + "reducer": "sum", + "right": "sum(moja_qs_ing_putQuotesErrorByTypeIDAndSubID_count)" + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + }, + "replaceFields": true + } + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "text", + "mode": "palette-classic" + }, + "mappings": [ + { + "options": { + "match": "null+nan", + "result": { + "index": 0, + "text": "0" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "reqs" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 5, + "x": 17, + "y": 1 + }, + "id": 60, + "interval": "1s", + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "max" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(moja_qs_quotes_post_count)", + "hide": false, + "instant": false, + "range": true, + "refId": "A" + } + ], + "title": "Ing POST /quotes requests", + "transformations": [ + { + "id": "calculateField", + "options": { + "binary": { + "left": "sum(moja_qs_ing_putQuotesErrorByTypeAndID_count)", + "reducer": "sum", + "right": "sum(moja_qs_ing_putQuotesErrorByTypeIDAndSubID_count)" + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + }, + "replaceFields": true + } + } + ], + "type": "stat" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 4 + }, + "id": 9, + "panels": [], + "title": "Quote Resource Performance Metrics", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "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 + }, + "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 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 5 + }, + "id": 1, + "options": { + "legend": { + "calcs": [ + "min", + "mean", + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "avg(rate(moja_qs_quotes_post_sum[$__rate_interval]) / rate(moja_qs_quotes_post_count[$__rate_interval]) >=0) by (success)", + "instant": false, + "legendFormat": "postQuotes success:{{success}}", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "avg(rate(moja_qs_quotes_id_put_sum[$__rate_interval]) / rate(moja_qs_quotes_id_put_count[$__rate_interval]) >=0) by (success)", + "hide": false, + "instant": false, + "legendFormat": "putQuotesByID success:{{success}}", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "avg(rate(moja_qs_quotes_id_get_sum[$__rate_interval]) / rate(moja_qs_quotes_id_get_count[$__rate_interval]) >=0) by (success)", + "hide": false, + "instant": false, + "legendFormat": "getQuotesByID success:{{success}}", + "range": true, + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "avg(rate(moja_qs_quotes_id_put_error_sum[$__rate_interval]) / rate(moja_qs_quotes_id_put_error_count[$__rate_interval]) >=0) by (success)", + "hide": false, + "instant": false, + "legendFormat": "putQuotesByIDError success:{{success}}", + "range": true, + "refId": "D" + } + ], + "title": "Quote Handlers Ingress - Processing Time", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "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 + }, + "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 + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 5 + }, + "id": 2, + "options": { + "legend": { + "calcs": [ + "min", + "mean", + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(rate(moja_qs_quotes_id_put_error_count[$__rate_interval])) by (success)", + "instant": false, + "interval": "", + "legendFormat": "putQuotesIDError success:{{success}}", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(rate(moja_qs_quotes_id_get_count[$__rate_interval])) by (success)", + "hide": false, + "instant": false, + "legendFormat": "getQuotesByID success:{{success}}", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(rate(moja_qs_quotes_id_put_count[$__rate_interval])) by (success)", + "hide": false, + "instant": false, + "legendFormat": "putQuotesByID success:{{success}}", + "range": true, + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(rate(moja_qs_quotes_post_count[$__rate_interval])) by (success)", + "hide": false, + "instant": false, + "legendFormat": "postQuotes success:{{success}}", + "range": true, + "refId": "D" + } + ], + "title": "Quote Handler Ingress - Processing Per Second", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "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 + }, + "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 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 13, + "w": 24, + "x": 0, + "y": 13 + }, + "id": 5, + "options": { + "legend": { + "calcs": [ + "min", + "mean", + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "exemplar": false, + "expr": "avg(rate(moja_qs_model_quote_sum[$__rate_interval]) / rate(moja_qs_model_quote_count[$__rate_interval]) >=0) by (success, queryName)", + "hide": false, + "instant": false, + "legendFormat": "{{queryName}} success:{{success}}", + "range": true, + "refId": "A" + } + ], + "title": "Quote Model - Processing Time", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "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 + }, + "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 + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 24, + "x": 0, + "y": 26 + }, + "id": 6, + "options": { + "legend": { + "calcs": [ + "min", + "mean", + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(rate(moja_qs_model_quote_count[$__rate_interval])) by (success, queryName)", + "instant": false, + "interval": "", + "legendFormat": "{{queryName}} success:{{success}}", + "range": true, + "refId": "A" + } + ], + "title": "Quote Model - Processing Per Second", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 38 + }, + "id": 25, + "panels": [], + "title": "CPU Usage", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "QS Total CPU Usage", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#299c46", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 50 + }, + { + "color": "#d44a3a", + "value": 80 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 0, + "y": 39 + }, + "id": 24, + "links": [], + "maxDataPoints": 100, + "options": { + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum (irate (container_cpu_usage_seconds_total{pod_name=~'.*quoting-service.*'}[2m])) * 100", + "format": "time_series", + "hide": true, + "instant": true, + "intervalFactor": 1, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(irate (container_cpu_usage_seconds_total{pod_name=~'.*quoting-service.*'}[2m]))", + "range": true, + "refId": "B" + } + ], + "title": "QS Total CPU Usage", + "type": "gauge" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 42 + }, + "id": 21, + "panels": [], + "title": "Resource Usage by Pods", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 43 + }, + "id": 22, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "moja_qs_nodejs_heap_size_total_bytes{serviceName=~\"quoting-service.*\"}", + "legendFormat": "heap_total-{{instance}} {{kubernetes_pod_name}}", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "moja_qs_nodejs_heap_size_used_bytes{serviceName=~\"quoting-service.*\"}", + "legendFormat": "heap_used-{{instance}} {{kubernetes_pod_name}}", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "moja_qs_nodejs_external_memory_bytes{serviceName=~\"quoting-service.*\"}", + "legendFormat": "ext_memory-{{instance}} {{kubernetes_pod_name}}", + "range": true, + "refId": "C" + } + ], + "title": "QS - Memory Usage by Pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "QS - CPU Usage in Seconds by Pod", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 51 + }, + "id": 23, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum (rate (moja_qs_process_cpu_seconds_total{serviceName=~\"account-lookup.*\"}[2m])) by (kubernetes_pod_name)", + "format": "time_series", + "hide": true, + "intervalFactor": 1, + "legendFormat": "{{kubernetes_pod_name}}", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(\n rate(container_cpu_usage_seconds_total{pod_name=~'.*account-lookup.*'}[2m]))\nby (pod_name)", + "format": "time_series", + "hide": true, + "intervalFactor": 1, + "legendFormat": "{{pod_name}}", + "range": true, + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(rate(container_cpu_usage_seconds_total{pod_name=~'.*account-lookup.*'}[2m]))", + "format": "time_series", + "hide": true, + "intervalFactor": 1, + "legendFormat": "All Total", + "range": true, + "refId": "D" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(moja_qs_process_cpu_seconds_total{serviceName=~\"account-lookup.*\"}[30s]) * 100", + "legendFormat": "{{kubernetes_pod_name}}", + "range": true, + "refId": "B" + } + ], + "title": "QS - CPU Usage in Seconds by Pod", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 58 + }, + "id": 18, + "panels": [], + "title": "Misc", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 0, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 24, + "x": 0, + "y": 59 + }, + "id": 19, + "links": [], + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "kube_deployment_spec_replicas{deployment=~\".*quoting-service.*\"}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "{{deployment}}", + "range": true, + "refId": "A" + } + ], + "title": "QS - # Nodes for each Components", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 63 + }, + "id": 20, + "links": [], + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "avg(moja_qs_nodejs_eventloop_lag_seconds{serviceName=~\"quoting-service.*\"}) by (app)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{app}}", + "range": true, + "refId": "A" + } + ], + "title": "QS - Event Loop Lag in Seconds", + "type": "timeseries" + } + ], + "refresh": "5s", + "schemaVersion": 38, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Mojaloop - Quoting Service", + "uid": "a4373cfa-5295-430d-9e53-a59c008ffa6c", + "version": 2, + "weekStart": "" +} diff --git a/docker/prometheus/prometheus.yml b/docker/prometheus/prometheus.yml index 4aa3945c..986cfacb 100644 --- a/docker/prometheus/prometheus.yml +++ b/docker/prometheus/prometheus.yml @@ -108,6 +108,10 @@ scrape_configs: 'ml-core-central-handler-timeout-2:3001', 'ml-core-central-handler-timeout-3:3001', 'ml-core-central-handler-timeout-4:3001', + 'ml-core-quoting-service-1:3002', + 'ml-core-quoting-service-2:3002', + 'ml-core-quoting-service-3:3002', + 'ml-core-quoting-service-4:3002', # 'central-handler-get:3001', ] diff --git a/envs/perffsp1.env b/envs/perffsp1.env index 1518cee4..09733013 100644 --- a/envs/perffsp1.env +++ b/envs/perffsp1.env @@ -8,4 +8,9 @@ CBH_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 # CBH_FSPIOP_ALS_ENDPOINT_URL=http://sim-perffsp1:3001/fspiop CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://ml-api-adapter:3000 -# CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://sim-perffsp2:3001/fspiop \ No newline at end of file +# CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://sim-perffsp2:3001/fspiop + +CBH_FSPIOP_QUOTES_ENDPOINT_URL=http://quoting-service:3002 +CBH_FSPIOP_QUOTES_ILPPACKET='AYIDGQAAAAAAACcQIWcuZ3JlZW5iYW5rZnNwLm1zaXNkbi4yNzcxMzgwMzkxMoIC62V5SjBjbUZ1YzJGamRHbHZia2xrSWpvaU1ERXhaR1EyTldZdE5UQXpNeTAwTVdNMkxUazFaR1l0T1RFeFl6WTRPVFExWWpobUlpd2ljWFZ2ZEdWSlpDSTZJbVF3TXpJMU1EVTJMVE0xTldFdE5EUmxNUzFpT1RnMExXWXdZVFExTmpFMFkyRXpPQ0lzSW5CaGVXVmxJanA3SW5CaGNuUjVTV1JKYm1adklqcDdJbkJoY25SNVNXUlVlWEJsSWpvaVRWTkpVMFJPSWl3aWNHRnlkSGxKWkdWdWRHbG1hV1Z5SWpvaU1qYzNNVE00TURNNU1USWlMQ0ptYzNCSlpDSTZJbWR5WldWdVltRnVhMlp6Y0NKOWZTd2ljR0Y1WlhJaU9uc2ljR0Z5ZEhsSlpFbHVabThpT25zaWNHRnlkSGxKWkZSNWNHVWlPaUpOVTBsVFJFNGlMQ0p3WVhKMGVVbGtaVzUwYVdacFpYSWlPaUkwTkRFeU16UTFOamM0T1NJc0ltWnpjRWxrSWpvaWNHbHVhMkpoYm10bWMzQWlmU3dpY0dWeWMyOXVZV3hKYm1adklqcDdJbU52YlhCc1pYaE9ZVzFsSWpwN0ltWnBjbk4wVG1GdFpTSTZJa1pwY25OMGJtRnRaUzFVWlhOMElpd2liR0Z6ZEU1aGJXVWlPaUpNWVhOMGJtRnRaUzFVWlhOMEluMHNJbVJoZEdWUFprSnBjblJvSWpvaU1UazROQzB3TVMwd01TSjlmU3dpWVcxdmRXNTBJanA3SW1OMWNuSmxibU41SWpvaVZWTkVJaXdpWVcxdmRXNTBJam9pTVRBd0luMHNJblJ5WVc1ellXTjBhVzl1Vkhsd1pTSTZleUp6WTJWdVlYSnBieUk2SWxSU1FVNVRSa1ZTSWl3aWFXNXBkR2xoZEc5eUlqb2lVRUZaUlZJaUxDSnBibWwwYVdGMGIzSlVlWEJsSWpvaVEwOU9VMVZOUlZJaWZYMAA' +CBH_FSPIOP_QUOTES_CONDITION='5m0gq_5dLQlTSSRKQmLpj0MZ1MtWLWgSu1oLGVTJyYs' +CBH_QUOTE_EXPIRATION_WINDOW=60000 diff --git a/envs/perffsp2.env b/envs/perffsp2.env index 9b20f1a6..b39eb159 100644 --- a/envs/perffsp2.env +++ b/envs/perffsp2.env @@ -9,3 +9,8 @@ CBH_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://ml-api-adapter:3000 # CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://sim-perffsp1:3001/fspiop + +CBH_FSPIOP_QUOTES_ENDPOINT_URL=http://quoting-service:3002 +CBH_FSPIOP_QUOTES_ILPPACKET='AYIDGQAAAAAAACcQIWcuZ3JlZW5iYW5rZnNwLm1zaXNkbi4yNzcxMzgwMzkxMoIC62V5SjBjbUZ1YzJGamRHbHZia2xrSWpvaU1ERXhaR1EyTldZdE5UQXpNeTAwTVdNMkxUazFaR1l0T1RFeFl6WTRPVFExWWpobUlpd2ljWFZ2ZEdWSlpDSTZJbVF3TXpJMU1EVTJMVE0xTldFdE5EUmxNUzFpT1RnMExXWXdZVFExTmpFMFkyRXpPQ0lzSW5CaGVXVmxJanA3SW5CaGNuUjVTV1JKYm1adklqcDdJbkJoY25SNVNXUlVlWEJsSWpvaVRWTkpVMFJPSWl3aWNHRnlkSGxKWkdWdWRHbG1hV1Z5SWpvaU1qYzNNVE00TURNNU1USWlMQ0ptYzNCSlpDSTZJbWR5WldWdVltRnVhMlp6Y0NKOWZTd2ljR0Y1WlhJaU9uc2ljR0Z5ZEhsSlpFbHVabThpT25zaWNHRnlkSGxKWkZSNWNHVWlPaUpOVTBsVFJFNGlMQ0p3WVhKMGVVbGtaVzUwYVdacFpYSWlPaUkwTkRFeU16UTFOamM0T1NJc0ltWnpjRWxrSWpvaWNHbHVhMkpoYm10bWMzQWlmU3dpY0dWeWMyOXVZV3hKYm1adklqcDdJbU52YlhCc1pYaE9ZVzFsSWpwN0ltWnBjbk4wVG1GdFpTSTZJa1pwY25OMGJtRnRaUzFVWlhOMElpd2liR0Z6ZEU1aGJXVWlPaUpNWVhOMGJtRnRaUzFVWlhOMEluMHNJbVJoZEdWUFprSnBjblJvSWpvaU1UazROQzB3TVMwd01TSjlmU3dpWVcxdmRXNTBJanA3SW1OMWNuSmxibU41SWpvaVZWTkVJaXdpWVcxdmRXNTBJam9pTVRBd0luMHNJblJ5WVc1ellXTjBhVzl1Vkhsd1pTSTZleUp6WTJWdVlYSnBieUk2SWxSU1FVNVRSa1ZTSWl3aWFXNXBkR2xoZEc5eUlqb2lVRUZaUlZJaUxDSnBibWwwYVdGMGIzSlVlWEJsSWpvaVEwOU9VMVZOUlZJaWZYMAA' +CBH_FSPIOP_QUOTES_CONDITION='5m0gq_5dLQlTSSRKQmLpj0MZ1MtWLWgSu1oLGVTJyYs' +CBH_QUOTE_EXPIRATION_WINDOW=60000 diff --git a/envs/perffsp3.env b/envs/perffsp3.env index 41ee037f..3df3ad06 100644 --- a/envs/perffsp3.env +++ b/envs/perffsp3.env @@ -8,3 +8,8 @@ CBH_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 # CBH_FSPIOP_ALS_ENDPOINT_URL=http://sim-perffsp3:3001/fspiop CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://ml-api-adapter:3000 + +CBH_FSPIOP_QUOTES_ENDPOINT_URL=http://quoting-service:3002 +CBH_FSPIOP_QUOTES_ILPPACKET='AYIDGQAAAAAAACcQIWcuZ3JlZW5iYW5rZnNwLm1zaXNkbi4yNzcxMzgwMzkxMoIC62V5SjBjbUZ1YzJGamRHbHZia2xrSWpvaU1ERXhaR1EyTldZdE5UQXpNeTAwTVdNMkxUazFaR1l0T1RFeFl6WTRPVFExWWpobUlpd2ljWFZ2ZEdWSlpDSTZJbVF3TXpJMU1EVTJMVE0xTldFdE5EUmxNUzFpT1RnMExXWXdZVFExTmpFMFkyRXpPQ0lzSW5CaGVXVmxJanA3SW5CaGNuUjVTV1JKYm1adklqcDdJbkJoY25SNVNXUlVlWEJsSWpvaVRWTkpVMFJPSWl3aWNHRnlkSGxKWkdWdWRHbG1hV1Z5SWpvaU1qYzNNVE00TURNNU1USWlMQ0ptYzNCSlpDSTZJbWR5WldWdVltRnVhMlp6Y0NKOWZTd2ljR0Y1WlhJaU9uc2ljR0Z5ZEhsSlpFbHVabThpT25zaWNHRnlkSGxKWkZSNWNHVWlPaUpOVTBsVFJFNGlMQ0p3WVhKMGVVbGtaVzUwYVdacFpYSWlPaUkwTkRFeU16UTFOamM0T1NJc0ltWnpjRWxrSWpvaWNHbHVhMkpoYm10bWMzQWlmU3dpY0dWeWMyOXVZV3hKYm1adklqcDdJbU52YlhCc1pYaE9ZVzFsSWpwN0ltWnBjbk4wVG1GdFpTSTZJa1pwY25OMGJtRnRaUzFVWlhOMElpd2liR0Z6ZEU1aGJXVWlPaUpNWVhOMGJtRnRaUzFVWlhOMEluMHNJbVJoZEdWUFprSnBjblJvSWpvaU1UazROQzB3TVMwd01TSjlmU3dpWVcxdmRXNTBJanA3SW1OMWNuSmxibU41SWpvaVZWTkVJaXdpWVcxdmRXNTBJam9pTVRBd0luMHNJblJ5WVc1ellXTjBhVzl1Vkhsd1pTSTZleUp6WTJWdVlYSnBieUk2SWxSU1FVNVRSa1ZTSWl3aWFXNXBkR2xoZEc5eUlqb2lVRUZaUlZJaUxDSnBibWwwYVdGMGIzSlVlWEJsSWpvaVEwOU9VMVZOUlZJaWZYMAA' +CBH_FSPIOP_QUOTES_CONDITION='5m0gq_5dLQlTSSRKQmLpj0MZ1MtWLWgSu1oLGVTJyYs' +CBH_QUOTE_EXPIRATION_WINDOW=60000 diff --git a/envs/perffsp4.env b/envs/perffsp4.env index d5e70138..951a8952 100644 --- a/envs/perffsp4.env +++ b/envs/perffsp4.env @@ -8,3 +8,8 @@ CBH_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 # CBH_FSPIOP_ALS_ENDPOINT_URL=http://sim-perffsp4:3001/fspiop CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://ml-api-adapter:3000 + +CBH_FSPIOP_QUOTES_ENDPOINT_URL=http://quoting-service:3002 +CBH_FSPIOP_QUOTES_ILPPACKET='AYIDGQAAAAAAACcQIWcuZ3JlZW5iYW5rZnNwLm1zaXNkbi4yNzcxMzgwMzkxMoIC62V5SjBjbUZ1YzJGamRHbHZia2xrSWpvaU1ERXhaR1EyTldZdE5UQXpNeTAwTVdNMkxUazFaR1l0T1RFeFl6WTRPVFExWWpobUlpd2ljWFZ2ZEdWSlpDSTZJbVF3TXpJMU1EVTJMVE0xTldFdE5EUmxNUzFpT1RnMExXWXdZVFExTmpFMFkyRXpPQ0lzSW5CaGVXVmxJanA3SW5CaGNuUjVTV1JKYm1adklqcDdJbkJoY25SNVNXUlVlWEJsSWpvaVRWTkpVMFJPSWl3aWNHRnlkSGxKWkdWdWRHbG1hV1Z5SWpvaU1qYzNNVE00TURNNU1USWlMQ0ptYzNCSlpDSTZJbWR5WldWdVltRnVhMlp6Y0NKOWZTd2ljR0Y1WlhJaU9uc2ljR0Z5ZEhsSlpFbHVabThpT25zaWNHRnlkSGxKWkZSNWNHVWlPaUpOVTBsVFJFNGlMQ0p3WVhKMGVVbGtaVzUwYVdacFpYSWlPaUkwTkRFeU16UTFOamM0T1NJc0ltWnpjRWxrSWpvaWNHbHVhMkpoYm10bWMzQWlmU3dpY0dWeWMyOXVZV3hKYm1adklqcDdJbU52YlhCc1pYaE9ZVzFsSWpwN0ltWnBjbk4wVG1GdFpTSTZJa1pwY25OMGJtRnRaUzFVWlhOMElpd2liR0Z6ZEU1aGJXVWlPaUpNWVhOMGJtRnRaUzFVWlhOMEluMHNJbVJoZEdWUFprSnBjblJvSWpvaU1UazROQzB3TVMwd01TSjlmU3dpWVcxdmRXNTBJanA3SW1OMWNuSmxibU41SWpvaVZWTkVJaXdpWVcxdmRXNTBJam9pTVRBd0luMHNJblJ5WVc1ellXTjBhVzl1Vkhsd1pTSTZleUp6WTJWdVlYSnBieUk2SWxSU1FVNVRSa1ZTSWl3aWFXNXBkR2xoZEc5eUlqb2lVRUZaUlZJaUxDSnBibWwwYVdGMGIzSlVlWEJsSWpvaVEwOU9VMVZOUlZJaWZYMAA' +CBH_FSPIOP_QUOTES_CONDITION='5m0gq_5dLQlTSSRKQmLpj0MZ1MtWLWgSu1oLGVTJyYs' +CBH_QUOTE_EXPIRATION_WINDOW=60000 diff --git a/envs/perffsp5.env b/envs/perffsp5.env index e158ef6d..6533cf89 100644 --- a/envs/perffsp5.env +++ b/envs/perffsp5.env @@ -8,3 +8,8 @@ CBH_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 # CBH_FSPIOP_ALS_ENDPOINT_URL=http://sim-perffsp5:3001/fspiop CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://ml-api-adapter:3000 + +CBH_FSPIOP_QUOTES_ENDPOINT_URL=http://quoting-service:3002 +CBH_FSPIOP_QUOTES_ILPPACKET='AYIDGQAAAAAAACcQIWcuZ3JlZW5iYW5rZnNwLm1zaXNkbi4yNzcxMzgwMzkxMoIC62V5SjBjbUZ1YzJGamRHbHZia2xrSWpvaU1ERXhaR1EyTldZdE5UQXpNeTAwTVdNMkxUazFaR1l0T1RFeFl6WTRPVFExWWpobUlpd2ljWFZ2ZEdWSlpDSTZJbVF3TXpJMU1EVTJMVE0xTldFdE5EUmxNUzFpT1RnMExXWXdZVFExTmpFMFkyRXpPQ0lzSW5CaGVXVmxJanA3SW5CaGNuUjVTV1JKYm1adklqcDdJbkJoY25SNVNXUlVlWEJsSWpvaVRWTkpVMFJPSWl3aWNHRnlkSGxKWkdWdWRHbG1hV1Z5SWpvaU1qYzNNVE00TURNNU1USWlMQ0ptYzNCSlpDSTZJbWR5WldWdVltRnVhMlp6Y0NKOWZTd2ljR0Y1WlhJaU9uc2ljR0Z5ZEhsSlpFbHVabThpT25zaWNHRnlkSGxKWkZSNWNHVWlPaUpOVTBsVFJFNGlMQ0p3WVhKMGVVbGtaVzUwYVdacFpYSWlPaUkwTkRFeU16UTFOamM0T1NJc0ltWnpjRWxrSWpvaWNHbHVhMkpoYm10bWMzQWlmU3dpY0dWeWMyOXVZV3hKYm1adklqcDdJbU52YlhCc1pYaE9ZVzFsSWpwN0ltWnBjbk4wVG1GdFpTSTZJa1pwY25OMGJtRnRaUzFVWlhOMElpd2liR0Z6ZEU1aGJXVWlPaUpNWVhOMGJtRnRaUzFVWlhOMEluMHNJbVJoZEdWUFprSnBjblJvSWpvaU1UazROQzB3TVMwd01TSjlmU3dpWVcxdmRXNTBJanA3SW1OMWNuSmxibU41SWpvaVZWTkVJaXdpWVcxdmRXNTBJam9pTVRBd0luMHNJblJ5WVc1ellXTjBhVzl1Vkhsd1pTSTZleUp6WTJWdVlYSnBieUk2SWxSU1FVNVRSa1ZTSWl3aWFXNXBkR2xoZEc5eUlqb2lVRUZaUlZJaUxDSnBibWwwYVdGMGIzSlVlWEJsSWpvaVEwOU9VMVZOUlZJaWZYMAA' +CBH_FSPIOP_QUOTES_CONDITION='5m0gq_5dLQlTSSRKQmLpj0MZ1MtWLWgSu1oLGVTJyYs' +CBH_QUOTE_EXPIRATION_WINDOW=60000 diff --git a/envs/perffsp6.env b/envs/perffsp6.env index 0292a532..598001a8 100644 --- a/envs/perffsp6.env +++ b/envs/perffsp6.env @@ -8,3 +8,8 @@ CBH_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 # CBH_FSPIOP_ALS_ENDPOINT_URL=http://sim-perffsp6:3001/fspiop CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://ml-api-adapter:3000 + +CBH_FSPIOP_QUOTES_ENDPOINT_URL=http://quoting-service:3002 +CBH_FSPIOP_QUOTES_ILPPACKET='AYIDGQAAAAAAACcQIWcuZ3JlZW5iYW5rZnNwLm1zaXNkbi4yNzcxMzgwMzkxMoIC62V5SjBjbUZ1YzJGamRHbHZia2xrSWpvaU1ERXhaR1EyTldZdE5UQXpNeTAwTVdNMkxUazFaR1l0T1RFeFl6WTRPVFExWWpobUlpd2ljWFZ2ZEdWSlpDSTZJbVF3TXpJMU1EVTJMVE0xTldFdE5EUmxNUzFpT1RnMExXWXdZVFExTmpFMFkyRXpPQ0lzSW5CaGVXVmxJanA3SW5CaGNuUjVTV1JKYm1adklqcDdJbkJoY25SNVNXUlVlWEJsSWpvaVRWTkpVMFJPSWl3aWNHRnlkSGxKWkdWdWRHbG1hV1Z5SWpvaU1qYzNNVE00TURNNU1USWlMQ0ptYzNCSlpDSTZJbWR5WldWdVltRnVhMlp6Y0NKOWZTd2ljR0Y1WlhJaU9uc2ljR0Z5ZEhsSlpFbHVabThpT25zaWNHRnlkSGxKWkZSNWNHVWlPaUpOVTBsVFJFNGlMQ0p3WVhKMGVVbGtaVzUwYVdacFpYSWlPaUkwTkRFeU16UTFOamM0T1NJc0ltWnpjRWxrSWpvaWNHbHVhMkpoYm10bWMzQWlmU3dpY0dWeWMyOXVZV3hKYm1adklqcDdJbU52YlhCc1pYaE9ZVzFsSWpwN0ltWnBjbk4wVG1GdFpTSTZJa1pwY25OMGJtRnRaUzFVWlhOMElpd2liR0Z6ZEU1aGJXVWlPaUpNWVhOMGJtRnRaUzFVWlhOMEluMHNJbVJoZEdWUFprSnBjblJvSWpvaU1UazROQzB3TVMwd01TSjlmU3dpWVcxdmRXNTBJanA3SW1OMWNuSmxibU41SWpvaVZWTkVJaXdpWVcxdmRXNTBJam9pTVRBd0luMHNJblJ5WVc1ellXTjBhVzl1Vkhsd1pTSTZleUp6WTJWdVlYSnBieUk2SWxSU1FVNVRSa1ZTSWl3aWFXNXBkR2xoZEc5eUlqb2lVRUZaUlZJaUxDSnBibWwwYVdGMGIzSlVlWEJsSWpvaVEwOU9VMVZOUlZJaWZYMAA' +CBH_FSPIOP_QUOTES_CONDITION='5m0gq_5dLQlTSSRKQmLpj0MZ1MtWLWgSu1oLGVTJyYs' +CBH_QUOTE_EXPIRATION_WINDOW=60000 diff --git a/envs/perffsp7.env b/envs/perffsp7.env index e6059fe2..5c98fa8f 100644 --- a/envs/perffsp7.env +++ b/envs/perffsp7.env @@ -8,3 +8,8 @@ CBH_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 # CBH_FSPIOP_ALS_ENDPOINT_URL=http://sim-perffsp7:3001/fspiop CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://ml-api-adapter:3000 + +CBH_FSPIOP_QUOTES_ENDPOINT_URL=http://quoting-service:3002 +CBH_FSPIOP_QUOTES_ILPPACKET='AYIDGQAAAAAAACcQIWcuZ3JlZW5iYW5rZnNwLm1zaXNkbi4yNzcxMzgwMzkxMoIC62V5SjBjbUZ1YzJGamRHbHZia2xrSWpvaU1ERXhaR1EyTldZdE5UQXpNeTAwTVdNMkxUazFaR1l0T1RFeFl6WTRPVFExWWpobUlpd2ljWFZ2ZEdWSlpDSTZJbVF3TXpJMU1EVTJMVE0xTldFdE5EUmxNUzFpT1RnMExXWXdZVFExTmpFMFkyRXpPQ0lzSW5CaGVXVmxJanA3SW5CaGNuUjVTV1JKYm1adklqcDdJbkJoY25SNVNXUlVlWEJsSWpvaVRWTkpVMFJPSWl3aWNHRnlkSGxKWkdWdWRHbG1hV1Z5SWpvaU1qYzNNVE00TURNNU1USWlMQ0ptYzNCSlpDSTZJbWR5WldWdVltRnVhMlp6Y0NKOWZTd2ljR0Y1WlhJaU9uc2ljR0Z5ZEhsSlpFbHVabThpT25zaWNHRnlkSGxKWkZSNWNHVWlPaUpOVTBsVFJFNGlMQ0p3WVhKMGVVbGtaVzUwYVdacFpYSWlPaUkwTkRFeU16UTFOamM0T1NJc0ltWnpjRWxrSWpvaWNHbHVhMkpoYm10bWMzQWlmU3dpY0dWeWMyOXVZV3hKYm1adklqcDdJbU52YlhCc1pYaE9ZVzFsSWpwN0ltWnBjbk4wVG1GdFpTSTZJa1pwY25OMGJtRnRaUzFVWlhOMElpd2liR0Z6ZEU1aGJXVWlPaUpNWVhOMGJtRnRaUzFVWlhOMEluMHNJbVJoZEdWUFprSnBjblJvSWpvaU1UazROQzB3TVMwd01TSjlmU3dpWVcxdmRXNTBJanA3SW1OMWNuSmxibU41SWpvaVZWTkVJaXdpWVcxdmRXNTBJam9pTVRBd0luMHNJblJ5WVc1ellXTjBhVzl1Vkhsd1pTSTZleUp6WTJWdVlYSnBieUk2SWxSU1FVNVRSa1ZTSWl3aWFXNXBkR2xoZEc5eUlqb2lVRUZaUlZJaUxDSnBibWwwYVdGMGIzSlVlWEJsSWpvaVEwOU9VMVZOUlZJaWZYMAA' +CBH_FSPIOP_QUOTES_CONDITION='5m0gq_5dLQlTSSRKQmLpj0MZ1MtWLWgSu1oLGVTJyYs' +CBH_QUOTE_EXPIRATION_WINDOW=60000 diff --git a/envs/perffsp8.env b/envs/perffsp8.env index 58bfa1c9..e180ddce 100644 --- a/envs/perffsp8.env +++ b/envs/perffsp8.env @@ -8,3 +8,8 @@ CBH_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 # CBH_FSPIOP_ALS_ENDPOINT_URL=http://sim-perffsp8:3001/fspiop CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://ml-api-adapter:3000 + +CBH_FSPIOP_QUOTES_ENDPOINT_URL=http://quoting-service:3002 +CBH_FSPIOP_QUOTES_ILPPACKET='AYIDGQAAAAAAACcQIWcuZ3JlZW5iYW5rZnNwLm1zaXNkbi4yNzcxMzgwMzkxMoIC62V5SjBjbUZ1YzJGamRHbHZia2xrSWpvaU1ERXhaR1EyTldZdE5UQXpNeTAwTVdNMkxUazFaR1l0T1RFeFl6WTRPVFExWWpobUlpd2ljWFZ2ZEdWSlpDSTZJbVF3TXpJMU1EVTJMVE0xTldFdE5EUmxNUzFpT1RnMExXWXdZVFExTmpFMFkyRXpPQ0lzSW5CaGVXVmxJanA3SW5CaGNuUjVTV1JKYm1adklqcDdJbkJoY25SNVNXUlVlWEJsSWpvaVRWTkpVMFJPSWl3aWNHRnlkSGxKWkdWdWRHbG1hV1Z5SWpvaU1qYzNNVE00TURNNU1USWlMQ0ptYzNCSlpDSTZJbWR5WldWdVltRnVhMlp6Y0NKOWZTd2ljR0Y1WlhJaU9uc2ljR0Z5ZEhsSlpFbHVabThpT25zaWNHRnlkSGxKWkZSNWNHVWlPaUpOVTBsVFJFNGlMQ0p3WVhKMGVVbGtaVzUwYVdacFpYSWlPaUkwTkRFeU16UTFOamM0T1NJc0ltWnpjRWxrSWpvaWNHbHVhMkpoYm10bWMzQWlmU3dpY0dWeWMyOXVZV3hKYm1adklqcDdJbU52YlhCc1pYaE9ZVzFsSWpwN0ltWnBjbk4wVG1GdFpTSTZJa1pwY25OMGJtRnRaUzFVWlhOMElpd2liR0Z6ZEU1aGJXVWlPaUpNWVhOMGJtRnRaUzFVWlhOMEluMHNJbVJoZEdWUFprSnBjblJvSWpvaU1UazROQzB3TVMwd01TSjlmU3dpWVcxdmRXNTBJanA3SW1OMWNuSmxibU41SWpvaVZWTkVJaXdpWVcxdmRXNTBJam9pTVRBd0luMHNJblJ5WVc1ellXTjBhVzl1Vkhsd1pTSTZleUp6WTJWdVlYSnBieUk2SWxSU1FVNVRSa1ZTSWl3aWFXNXBkR2xoZEc5eUlqb2lVRUZaUlZJaUxDSnBibWwwYVdGMGIzSlVlWEJsSWpvaVEwOU9VMVZOUlZJaWZYMAA' +CBH_FSPIOP_QUOTES_CONDITION='5m0gq_5dLQlTSSRKQmLpj0MZ1MtWLWgSu1oLGVTJyYs' +CBH_QUOTE_EXPIRATION_WINDOW=60000 diff --git a/packages/callback-handler-svc/handlers/admin.js b/packages/callback-handler-svc/handlers/admin.js index ebffc2a1..183b38d7 100644 --- a/packages/callback-handler-svc/handlers/admin.js +++ b/packages/callback-handler-svc/handlers/admin.js @@ -44,7 +44,7 @@ const init = (config, logger, options = undefined) => { 'ing_callbackHandler', 'Ingress - Operation handler', ['success', 'operation'] - ).startTimer() + ).startTimer() const id = req.params.id const fspMap = JSON.parse(FSP_ENDPOINT_MAP) @@ -52,86 +52,86 @@ const init = (config, logger, options = undefined) => { res.status(200).json( [ - { + { "type":"FSPIOP_CALLBACK_URL_PARTICIPANT_PUT", "value":`${ADMIN_FSPIOP_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}` - }, - { - "type":"FSPIOP_CALLBACK_URL_PARTICIPANT_PUT_ERROR", - "value":`${ADMIN_FSPIOP_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/error` - }, - { - "type":"FSPIOP_CALLBACK_URL_PARTIES_GET", - "value":`${ADMIN_FSPIOP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}` - }, - { - "type":"FSPIOP_CALLBACK_URL_PARTIES_PUT", - "value":`${ADMIN_FSPIOP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}` - }, - { - "type":"FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT", - "value":`${ADMIN_FSPIOP_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}` - }, - { - "type":"FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT_ERROR", - "value":`${ADMIN_FSPIOP_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error` - }, - { - "type":"FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_GET", - "value":`${ADMIN_FSPIOP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}` - }, - { - "type":"FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT", - "value":`${ADMIN_FSPIOP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}` - }, - { - "type":"FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT_ERROR", - "value":`${ADMIN_FSPIOP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error` - }, - { - "type":"NET_DEBIT_CAP_ADJUSTMENT_EMAIL", - "value":"test@test.test" - }, - { - "type":"SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", - "value":"test@test.test" - }, - { - "type":"NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", - "value":"test@test.test" - }, - { - "type":"FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT", - "value":`${ADMIN_FSPIOP_CALLBACK_URL}/participants/{{requestId}}` - }, - { - "type":"FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT_ERROR", - "value":`${ADMIN_FSPIOP_CALLBACK_URL}/participants/{{requestId}}/error` - }, - { - "type":"FSPIOP_CALLBACK_URL_PARTIES_PUT_ERROR", - "value":`${ADMIN_FSPIOP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/error` - }, - { - "type":"FSPIOP_CALLBACK_URL_QUOTES", - "value":`${ADMIN_FSPIOP_CALLBACK_URL}` - }, - { - "type":"FSPIOP_CALLBACK_URL_TRANSFER_POST", - "value":`${ADMIN_FSPIOP_CALLBACK_URL}/transfers` - }, - { - "type":"FSPIOP_CALLBACK_URL_TRANSFER_PUT", - "value":`${ADMIN_FSPIOP_CALLBACK_URL}/transfers/{{transferId}}` - }, - { - "type":"FSPIOP_CALLBACK_URL_TRANSFER_ERROR", - "value":`${ADMIN_FSPIOP_CALLBACK_URL}/transfers/{{transferId}}/error` - }, - ] - ) - histTimerEnd({ success: true, operation: 'admin_get_participants_endpoints'}) - }) + }, + { + "type":"FSPIOP_CALLBACK_URL_PARTICIPANT_PUT_ERROR", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/error` + }, + { + "type":"FSPIOP_CALLBACK_URL_PARTIES_GET", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}` + }, + { + "type":"FSPIOP_CALLBACK_URL_PARTIES_PUT", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}` + }, + { + "type":"FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}` + }, + { + "type":"FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT_ERROR", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error` + }, + { + "type":"FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_GET", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}` + }, + { + "type":"FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}` + }, + { + "type":"FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT_ERROR", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error` + }, + { + "type":"NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "value":"test@test.test" + }, + { + "type":"SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "value":"test@test.test" + }, + { + "type":"NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "value":"test@test.test" + }, + { + "type":"FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}/participants/{{requestId}}` + }, + { + "type":"FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT_ERROR", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}/participants/{{requestId}}/error` + }, + { + "type":"FSPIOP_CALLBACK_URL_PARTIES_PUT_ERROR", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/error` + }, + { + "type":"FSPIOP_CALLBACK_URL_QUOTES", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}` + }, + { + "type":"FSPIOP_CALLBACK_URL_TRANSFER_POST", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}/transfers` + }, + { + "type":"FSPIOP_CALLBACK_URL_TRANSFER_PUT", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}/transfers/{{transferId}}` + }, + { + "type":"FSPIOP_CALLBACK_URL_TRANSFER_ERROR", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}/transfers/{{transferId}}/error` + }, + ] + ) + histTimerEnd({ success: true, operation: 'admin_get_participants_endpoints'}) + }) return { diff --git a/packages/callback-handler-svc/handlers/fspiop.js b/packages/callback-handler-svc/handlers/fspiop.js index 830cacc6..713f9fda 100644 --- a/packages/callback-handler-svc/handlers/fspiop.js +++ b/packages/callback-handler-svc/handlers/fspiop.js @@ -10,14 +10,18 @@ const TRACESTATE_KEY_CALLBACK_START_TS = 'tx_callback_start_ts' // ILP Packet: AYIDGQAAAAAAACcQIWcuZ3JlZW5iYW5rZnNwLm1zaXNkbi4yNzcxMzgwMzkxMoIC62V5SjBjbUZ1YzJGamRHbHZia2xrSWpvaU1ERXhaR1EyTldZdE5UQXpNeTAwTVdNMkxUazFaR1l0T1RFeFl6WTRPVFExWWpobUlpd2ljWFZ2ZEdWSlpDSTZJbVF3TXpJMU1EVTJMVE0xTldFdE5EUmxNUzFpT1RnMExXWXdZVFExTmpFMFkyRXpPQ0lzSW5CaGVXVmxJanA3SW5CaGNuUjVTV1JKYm1adklqcDdJbkJoY25SNVNXUlVlWEJsSWpvaVRWTkpVMFJPSWl3aWNHRnlkSGxKWkdWdWRHbG1hV1Z5SWpvaU1qYzNNVE00TURNNU1USWlMQ0ptYzNCSlpDSTZJbWR5WldWdVltRnVhMlp6Y0NKOWZTd2ljR0Y1WlhJaU9uc2ljR0Z5ZEhsSlpFbHVabThpT25zaWNHRnlkSGxKWkZSNWNHVWlPaUpOVTBsVFJFNGlMQ0p3WVhKMGVVbGtaVzUwYVdacFpYSWlPaUkwTkRFeU16UTFOamM0T1NJc0ltWnpjRWxrSWpvaWNHbHVhMkpoYm10bWMzQWlmU3dpY0dWeWMyOXVZV3hKYm1adklqcDdJbU52YlhCc1pYaE9ZVzFsSWpwN0ltWnBjbk4wVG1GdFpTSTZJa1pwY25OMGJtRnRaUzFVWlhOMElpd2liR0Z6ZEU1aGJXVWlPaUpNWVhOMGJtRnRaUzFVWlhOMEluMHNJbVJoZEdWUFprSnBjblJvSWpvaU1UazROQzB3TVMwd01TSjlmU3dpWVcxdmRXNTBJanA3SW1OMWNuSmxibU41SWpvaVZWTkVJaXdpWVcxdmRXNTBJam9pTVRBd0luMHNJblJ5WVc1ellXTjBhVzl1Vkhsd1pTSTZleUp6WTJWdVlYSnBieUk2SWxSU1FVNVRSa1ZTSWl3aWFXNXBkR2xoZEc5eUlqb2lVRUZaUlZJaUxDSnBibWwwYVdGMGIzSlVlWEJsSWpvaVEwOU9VMVZOUlZJaWZYMAA // Condition: 5m0gq_5dLQlTSSRKQmLpj0MZ1MtWLWgSu1oLGVTJyYs const FULFILMENT = 'lnYe4rYwLthWbzhVyX5cAuDfL1Ulw4WdaTgyGDREysw' +const instance = axios.create() const init = (config, logger, options = undefined) => { const FSPIOP_ALS_ENDPOINT_URL = env.get('CBH_FSPIOP_ALS_ENDPOINT_URL').default('http://account-lookup-service:4002').asString() const FSPIOP_TRANSFERS_ENDPOINT_URL = env.get('CBH_FSPIOP_TRANSFERS_ENDPOINT_URL').default('http://ml-api-adapter:3000').asString() + const FSPIOP_QUOTES_ENDPOINT_URL = env.get('CBH_FSPIOP_QUOTES_ENDPOINT_URL').default('http://quoting-service:3002').asString() const FSP_ID = env.get('CBH_FSPIOP_FSP_ID').default('perffsp2').asString() const HTTP_KEEPALIVE = env.get('CBH_FSPIOP_CALLBACK_HTTP_KEEPALIVE').default('true').asBool() const router = express.Router() - + const ilpPacket = env.get('CBH_FSPIOP_QUOTES_ILPPACKET').asString() + const condition = env.get('CBH_FSPIOP_QUOTES_CONDITION').asString() + const quoteExpirationWindow = env.get('CBH_QUOTE_EXPIRATION_WINDOW').asInt() const httpAgent = new http.Agent({ keepAlive: HTTP_KEEPALIVE }) // Handle Payee GET Party @@ -46,7 +50,7 @@ const init = (config, logger, options = undefined) => { 'Egress - Operation handler', ['success', 'operation'] ).startTimer() - await axios.put(`${FSPIOP_ALS_ENDPOINT_URL}/parties/${type}/${id}`, { + await instance.put(`${FSPIOP_ALS_ENDPOINT_URL}/parties/${type}/${id}`, { "party": { "partyIdInfo": { "partyIdType": "MSISDN", @@ -106,7 +110,7 @@ const init = (config, logger, options = undefined) => { 'Egress - Operation handler', ['success', 'operation'] ).startTimer() - await axios.put(`${FSPIOP_ALS_ENDPOINT_URL}/participants/${type}/${id}`, { + await instance.put(`${FSPIOP_ALS_ENDPOINT_URL}/participants/${type}/${id}`, { "fspId": "" }, { @@ -149,7 +153,7 @@ const init = (config, logger, options = undefined) => { ['success', 'operation'] ).startTimer() try { - await axios.put(`${FSPIOP_TRANSFERS_ENDPOINT_URL}/transfers/${transferId}`, { + await instance.put(`${FSPIOP_TRANSFERS_ENDPOINT_URL}/transfers/${transferId}`, { "transferState": "COMMITTED", "fulfilment": FULFILMENT, "completedTimestamp": (new Date()).toISOString() @@ -178,7 +182,7 @@ const init = (config, logger, options = undefined) => { })(); // Sync 202 res.status(202).end() - histTimerEnd({ success: true, operation: 'fspiop_put_transfers'}) + histTimerEnd({ success: true, operation: 'fspiop_post_transfers'}) }) const handleCallback = (resource, req, res) => { @@ -239,6 +243,7 @@ const init = (config, logger, options = undefined) => { ) const traceId = TraceUtils.getTraceId(req.headers) const channel = '/' + traceId + '/' + req.method + req.path + logger.info(channel) options.wsServer.notify(channel, isErrorOperation ? 'ERROR_CALLBACK_RECEIVED' : 'SUCCESS_CALLBACK_RECEIVED') histTimerEnd({ success: true, operation }) return res.status(202).end() @@ -259,6 +264,77 @@ const init = (config, logger, options = undefined) => { return handleCallback('transfers', req, res) }) + + // Handle Payee POST /quotes + router.post('/quotes', (req, res) => { + const histTimerEnd = options.metrics.getHistogram( + 'ing_callbackHandler', + 'Ingress - Operation handler', + ['success', 'operation'] + ).startTimer() + + delete instance.defaults.headers.common.Accept + + // Async callback + const fspiopSourceHeader = req.headers['fspiop-source'] + const traceparentHeader = req.headers['traceparent'] + const tracestateHeader = req.headers['tracestate']; + const quoteId = req.body.quoteId; + + (async () => { + const egressHistTimerEnd = options.metrics.getHistogram( + 'egress_callbackHandler', + 'Egress - Operation handler', + ['success', 'operation'] + ).startTimer() + try { + const quoteBody = req.body + const quoteTransferAmount = quoteBody.amount.amount + const quoteExpiration = new Date(new Date().getTime() + quoteExpirationWindow).toISOString() + + // Important to remove the Accept header, otherwise axios will add a default one to the request + // and the validation will fail + await instance.put(`${FSPIOP_QUOTES_ENDPOINT_URL}/quotes/${quoteId}`, { + "transferAmount": { + "currency": `${quoteBody.amount.currency}`, + "amount": `${quoteTransferAmount}` + }, + "ilpPacket": ilpPacket, + "condition": condition, + "expiration": quoteExpiration + }, + { + headers: { + 'Content-Type': 'application/vnd.interoperability.quotes+json;version=1.0', + Date: (new Date()).toUTCString(), + 'FSPIOP-Source': FSP_ID, + 'FSPIOP-Destination': fspiopSourceHeader, + 'traceparent': traceparentHeader, + 'tracestate': tracestateHeader + `,${TRACESTATE_KEY_CALLBACK_START_TS}=${Date.now()}` + }, + httpAgent + }) + egressHistTimerEnd({ success: true, operation: 'fspiop_put_quotes'}) + } catch(err) { + logger.error(JSON.stringify(err)) + logger.error({ + traceparent: req.headers.traceparent, + operation: 'fspiop_put_quotes', + err, + }) + egressHistTimerEnd({ success: false, operation: 'fspiop_put_quotes'}) + } + })(); + // Sync 202 + res.status(202).end() + histTimerEnd({ success: true, operation: 'fspiop_post_quotes'}) + }) + + // Handle Payer PUT Quotes callback + router.put('/quotes/*', (req, res) => { + return handleCallback('quotes', req, res) + }) + return { name: 'fspiop', basepath: '/fspiop', diff --git a/packages/callback-handler-svc/package-lock.json b/packages/callback-handler-svc/package-lock.json index 04165d27..c28ff324 100644 --- a/packages/callback-handler-svc/package-lock.json +++ b/packages/callback-handler-svc/package-lock.json @@ -9,10 +9,10 @@ "version": "0.0.1", "license": "Apache-2.0", "dependencies": { - "@callback-handler-svc/utils": "file:./src/local-packages/utils", + "@callback-handler-svc/utils": "file:./dist/local-packages/utils", "@mojaloop/central-services-logger": "11.2.0", "@mojaloop/central-services-metrics": "12.0.5", - "axios": "^1.4.0", + "axios": "1.5.0", "convict": "^6.2.4", "env-var": "^7.3.1", "express": "^4.17.2", @@ -61,9 +61,7 @@ "node": "=18.x" } }, - "dist/local-packages/utils": { - "extraneous": true - }, + "dist/local-packages/utils": {}, "local-packages/utils": { "extraneous": true }, @@ -670,7 +668,7 @@ "dev": true }, "node_modules/@callback-handler-svc/utils": { - "resolved": "src/local-packages/utils", + "resolved": "dist/local-packages/utils", "link": true }, "node_modules/@colors/colors": { @@ -2251,9 +2249,9 @@ "dev": true }, "node_modules/axios": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", - "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz", + "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==", "dependencies": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", @@ -11028,7 +11026,10 @@ "src/local-pacakages/utils": { "extraneous": true }, - "src/local-packages/utils": {} + "src/local-packages/utils": { + "name": "@callback-handler-svc/utils", + "extraneous": true + } }, "dependencies": { "@aashutoshrathi/word-wrap": { @@ -11491,7 +11492,7 @@ "dev": true }, "@callback-handler-svc/utils": { - "version": "file:src/local-packages/utils" + "version": "file:dist/local-packages/utils" }, "@colors/colors": { "version": "1.5.0", @@ -12790,9 +12791,9 @@ "dev": true }, "axios": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", - "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz", + "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==", "requires": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", diff --git a/packages/callback-handler-svc/package.json b/packages/callback-handler-svc/package.json index 2149450a..513d9e44 100644 --- a/packages/callback-handler-svc/package.json +++ b/packages/callback-handler-svc/package.json @@ -36,7 +36,7 @@ "@callback-handler-svc/utils": "file:./dist/local-packages/utils", "@mojaloop/central-services-logger": "11.2.0", "@mojaloop/central-services-metrics": "12.0.5", - "axios": "^1.4.0", + "axios": "1.5.0", "convict": "^6.2.4", "env-var": "^7.3.1", "express": "^4.17.2", diff --git a/packages/k6-tests/config/fspiopQuotes.json b/packages/k6-tests/config/fspiopQuotes.json new file mode 100644 index 00000000..ab7f0ec0 --- /dev/null +++ b/packages/k6-tests/config/fspiopQuotes.json @@ -0,0 +1,21 @@ +{ + "scenarios": { + "fspiopQuotes": { + "executor": "ramping-vus", + "exec": "fspiopQuotesScenarios", + "env": { + "UNIDIRECTIONAL": "false" + }, + "startVUs": 1, + "stages": [ + { "duration": "30s", "target": 30 }, + { "duration": "5m", "target": 30 } + ] + } + }, + "thresholds": { + "iteration_duration": [ "p(95)<1000" ], + "http_req_failed": [ "rate<0.01" ], + "http_req_duration": [ "p(95)<1000" ] + } +} diff --git a/packages/k6-tests/index.js b/packages/k6-tests/index.js index f9f54e85..528f9ff0 100644 --- a/packages/k6-tests/index.js +++ b/packages/k6-tests/index.js @@ -1,6 +1,7 @@ export { fspiopDiscoveryScenarios } from './scenarios/fspiopDiscovery.js'; export { fspiopTransfersScenarios } from './scenarios/fspiopTransfers.js'; export { fspiopTransfersNoCallbackScenarios } from './scenarios/fspiopTransfersNoCallback.js'; +export { fspiopQuotesScenarios } from './scenarios/fspiopQuotes.js'; const configFile = __ENV.K6_SCRIPT_CONFIG_FILE_NAME ? './config/' + __ENV.K6_SCRIPT_CONFIG_FILE_NAME : './config/test.json'; const testConfig = JSON.parse(open(configFile)); diff --git a/packages/k6-tests/scenarios/fspiopQuotes.js b/packages/k6-tests/scenarios/fspiopQuotes.js new file mode 100644 index 00000000..3c731b6b --- /dev/null +++ b/packages/k6-tests/scenarios/fspiopQuotes.js @@ -0,0 +1,6 @@ +import { postQuotes } from "../scripts/postQuotes.js"; + + +export function fspiopQuotesScenarios() { + postQuotes(); +} diff --git a/packages/k6-tests/scripts/postQuotes.js b/packages/k6-tests/scripts/postQuotes.js new file mode 100644 index 00000000..eced5d12 --- /dev/null +++ b/packages/k6-tests/scripts/postQuotes.js @@ -0,0 +1,130 @@ +import http from 'k6/http'; +import { crypto } from "k6/experimental/webcrypto"; +import { check, fail, sleep, group } from 'k6'; +import { WebSocket } from 'k6/experimental/websockets'; +import { setTimeout, clearTimeout, setInterval, clearInterval } from 'k6/experimental/timers'; +import { Trace } from "../common/trace.js"; +import { getTwoItemsFromArray } from "../common/utils.js"; + +console.log(`Env Vars --> + K6_SCRIPT_WS_TIMEOUT_MS=${__ENV.K6_SCRIPT_WS_TIMEOUT_MS}, + K6_SCRIPT_FSPIOP_QUOTES_ENDPOINT_URL=${__ENV.K6_SCRIPT_FSPIOP_QUOTES_ENDPOINT_URL}, + K6_SCRIPT_FSPIOP_FSP_POOL=${__ENV.K6_SCRIPT_FSPIOP_FSP_POOL} +`); + +const fspList = JSON.parse(__ENV.K6_SCRIPT_FSPIOP_FSP_POOL) +const amount = __ENV.K6_SCRIPT_FSPIOP_QUOTES_AMOUNT.toString() +const currency = __ENV.K6_SCRIPT_FSPIOP_QUOTES_CURRENCY + +export function postQuotes() { + group("Post Quotes", function () { + let payerFsp + let payeeFsp + + if (__ENV.UNIDIRECTIONAL === "true" || __ENV.UNIDIRECTIONAL === "TRUE") { + payerFsp = fspList[0] + payeeFsp = fspList[1] + } else { + const selectedFsps = getTwoItemsFromArray(fspList) + payerFsp = selectedFsps[0] + payeeFsp = selectedFsps[1] + } + + const startTs = Date.now(); + const quoteId = crypto.randomUUID(); + const transactionId = crypto.randomUUID(); + const payerFspId = payerFsp['fspId']; + const payeeFspId = payeeFsp['fspId']; + const wsUrl = payerFsp['wsUrl']; + const traceParent = Trace(); + const traceId = traceParent.traceId; + const wsChannel = `${traceParent.traceId}/PUT/quotes/${quoteId}`; + const wsURL = `${wsUrl}/${wsChannel}` + const ws = new WebSocket(wsURL); + const wsTimeoutMs = Number(__ENV.K6_SCRIPT_WS_TIMEOUT_MS) || 2000; // user session between 5s and 1m + + var wsTimeoutId = null; + + const clearTimers = () => { + if (wsTimeoutId) { clearTimeout(wsTimeoutId); wsTimeoutId=null } + } + + ws.onclose(() => { + clearTimers(); + }); + + ws.onerror((err) => { + console.error(traceId, err); + check(err, { 'QUOTES_E2E_FSPIOP_POST_QUOTES_SUCCESS': (cbMessage) => false }); + clearTimers(); + ws.close(); + }); + + ws.onmessage = (event) => { + console.info(traceId, `WS message received [${wsChannel}]: ${event.data}`); + check(event.data, { 'QUOTES_E2E_FSPIOP_POST_QUOTES_SUCCESS': (cbMessage) => cbMessage == 'SUCCESS_CALLBACK_RECEIVED' }); + clearTimers(); + ws.close(); + // sleep(1); + }; + + ws.onopen = () => { + console.info(traceId, `WS open on URL: ${wsURL}`); + const params = { + tags: { + payerFspId, + payeeFspId + }, + headers: { + 'accept': 'application/vnd.interoperability.quotes+json;version=1.0', + 'Content-Type': 'application/vnd.interoperability.quotes+json;version=1.0', + 'FSPIOP-Source': payerFspId, + 'FSPIOP-Destination': payeeFspId, + 'Date': (new Date()).toUTCString(), + 'traceparent': traceParent.toString(), + 'tracestate': `tx_end2end_start_ts=${startTs}` + }, + }; + + const body = { + "quoteId": quoteId, + "transactionId": transactionId, + "payer": { + "partyIdInfo": { + "partyIdType": "MSISDN", + "partyIdentifier": `${payerFsp['partyId']}`, + "fspId": payerFspId + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "MSISDN", + "partyIdentifier": `${payeeFsp['partyId']}`, + "fspId": payeeFspId + } + }, + "amountType": "SEND", + "amount": { + "amount": `${amount}`, + "currency": `${currency}` + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + } + } + + // Lets send the FSPIOP POST /quotes request + const res = http.post(`${__ENV.K6_SCRIPT_FSPIOP_QUOTES_ENDPOINT_URL}/quotes`, JSON.stringify(body), params); + check(res, { 'QUOTES_FSPIOP_POST_QUOTES_RESPONSE_IS_202' : (r) => r.status == 202 }); + + wsTimeoutId = setTimeout(() => { + const errorMsg = `WS timed-out on URL: ${wsURL}` + console.error(traceId, errorMsg); + check(res, { 'QUOTES_E2E_FSPIOP_POST_QUOTES_SUCCESS': (cbMessage) => false }); + ws.close(); + }, wsTimeoutMs); + }; + }); +} diff --git a/perf.env b/perf.env index efb7e1bd..7bbaf2b5 100644 --- a/perf.env +++ b/perf.env @@ -44,6 +44,10 @@ K6_SCRIPT_ORACLE_ENDPOINT_URL=http://callback-handler-svc-oracle-sim:3001/oracle K6_SCRIPT_FSPIOP_TRANSFERS_ENDPOINT_URL=http://ml-api-adapter:3000 # K6_SCRIPT_FSPIOP_TRANSFERS_ENDPOINT_URL=http://sim-perffsp2:3001/fspiop +K6_SCRIPT_FSPIOP_QUOTES_ENDPOINT_URL=http://quoting-service:3002 +K6_SCRIPT_FSPIOP_QUOTES_AMOUNT=2 +K6_SCRIPT_FSPIOP_QUOTES_CURRENCY=USD + K6_SCRIPT_FSPIOP_TRANSFERS_ILPPACKET='AYIDGQAAAAAAACcQIWcuZ3JlZW5iYW5rZnNwLm1zaXNkbi4yNzcxMzgwMzkxMoIC62V5SjBjbUZ1YzJGamRHbHZia2xrSWpvaU1ERXhaR1EyTldZdE5UQXpNeTAwTVdNMkxUazFaR1l0T1RFeFl6WTRPVFExWWpobUlpd2ljWFZ2ZEdWSlpDSTZJbVF3TXpJMU1EVTJMVE0xTldFdE5EUmxNUzFpT1RnMExXWXdZVFExTmpFMFkyRXpPQ0lzSW5CaGVXVmxJanA3SW5CaGNuUjVTV1JKYm1adklqcDdJbkJoY25SNVNXUlVlWEJsSWpvaVRWTkpVMFJPSWl3aWNHRnlkSGxKWkdWdWRHbG1hV1Z5SWpvaU1qYzNNVE00TURNNU1USWlMQ0ptYzNCSlpDSTZJbWR5WldWdVltRnVhMlp6Y0NKOWZTd2ljR0Y1WlhJaU9uc2ljR0Z5ZEhsSlpFbHVabThpT25zaWNHRnlkSGxKWkZSNWNHVWlPaUpOVTBsVFJFNGlMQ0p3WVhKMGVVbGtaVzUwYVdacFpYSWlPaUkwTkRFeU16UTFOamM0T1NJc0ltWnpjRWxrSWpvaWNHbHVhMkpoYm10bWMzQWlmU3dpY0dWeWMyOXVZV3hKYm1adklqcDdJbU52YlhCc1pYaE9ZVzFsSWpwN0ltWnBjbk4wVG1GdFpTSTZJa1pwY25OMGJtRnRaUzFVWlhOMElpd2liR0Z6ZEU1aGJXVWlPaUpNWVhOMGJtRnRaUzFVWlhOMEluMHNJbVJoZEdWUFprSnBjblJvSWpvaU1UazROQzB3TVMwd01TSjlmU3dpWVcxdmRXNTBJanA3SW1OMWNuSmxibU41SWpvaVZWTkVJaXdpWVcxdmRXNTBJam9pTVRBd0luMHNJblJ5WVc1ellXTjBhVzl1Vkhsd1pTSTZleUp6WTJWdVlYSnBieUk2SWxSU1FVNVRSa1ZTSWl3aWFXNXBkR2xoZEc5eUlqb2lVRUZaUlZJaUxDSnBibWwwYVdGMGIzSlVlWEJsSWpvaVEwOU9VMVZOUlZJaWZYMAA' K6_SCRIPT_FSPIOP_TRANSFERS_CONDITION='5m0gq_5dLQlTSSRKQmLpj0MZ1MtWLWgSu1oLGVTJyYs' K6_SCRIPT_FSPIOP_TRANSFERS_AMOUNT=2 From 0385a3a8448bd78634bbde175d7e80541c0fb23a Mon Sep 17 00:00:00 2001 From: Kevin Leyow Date: Thu, 5 Oct 2023 08:13:23 -0500 Subject: [PATCH 3/3] chore(mojaloop/#3537): add quote testing dash improvement and config (#34) --- .../configs/quoting-service-perf.js | 2 +- .../dashboards/dashboard-mysql.json | 4685 ++--------------- 2 files changed, 430 insertions(+), 4257 deletions(-) diff --git a/docker/config-modifier/configs/quoting-service-perf.js b/docker/config-modifier/configs/quoting-service-perf.js index 35391458..8c6a32f5 100644 --- a/docker/config-modifier/configs/quoting-service-perf.js +++ b/docker/config-modifier/configs/quoting-service-perf.js @@ -4,5 +4,5 @@ module.exports = { "HOST": "mysql-cl" }, "SIMPLE_ROUTING_MODE": false, - "SWITCH_ENDPOINT": "http://central-ledger:3001" + "SWITCH_ENDPOINT": "http://callback-handler-svc-cl-sim:3001/admin" } diff --git a/docker/grafana/provisioning/dashboards/dashboard-mysql.json b/docker/grafana/provisioning/dashboards/dashboard-mysql.json index fc905874..4ff6532c 100644 --- a/docker/grafana/provisioning/dashboards/dashboard-mysql.json +++ b/docker/grafana/provisioning/dashboards/dashboard-mysql.json @@ -4,142 +4,22 @@ { "builtIn": 1, "datasource": { - "type": "datasource", - "uid": "grafana" - }, - "enable": true, - "hide": false, - "iconColor": "#e0752d", - "limit": 100, - "name": "PMM Annotations", - "showIn": 0, - "tags": [ - "pmm_annotation" - ], - "type": "tags" - }, - { - "builtIn": 1, - "datasource": { - "type": "datasource", - "uid": "grafana" + "type": "grafana", + "uid": "-- Grafana --" }, "enable": true, "hide": true, - "iconColor": "#6ed0e0", - "limit": 100, + "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", - "showIn": 0, - "tags": [], "type": "dashboard" } ] }, "editable": true, "fiscalYearStartMonth": 0, - "graphTooltip": 1, - "id": 10, + "graphTooltip": 0, + "id": 14, "links": [ - { - "icon": "dashboard", - "includeVars": true, - "keepTime": true, - "tags": [ - "QAN" - ], - "targetBlank": false, - "title": "Query Analytics", - "type": "link", - "url": "/graph/dashboard/db/_pmm-query-analytics" - }, - { - "asDropdown": true, - "includeVars": true, - "keepTime": true, - "tags": [ - "OS" - ], - "targetBlank": false, - "title": "OS", - "type": "dashboards" - }, - { - "asDropdown": true, - "includeVars": true, - "keepTime": true, - "tags": [ - "MySQL" - ], - "targetBlank": false, - "title": "MySQL", - "type": "dashboards" - }, - { - "asDropdown": true, - "includeVars": true, - "keepTime": true, - "tags": [ - "MongoDB" - ], - "targetBlank": false, - "title": "MongoDB", - "type": "dashboards" - }, - { - "asDropdown": true, - "includeVars": true, - "keepTime": true, - "tags": [ - "PostgreSQL" - ], - "targetBlank": false, - "title": "PostgreSQL", - "type": "dashboards" - }, - { - "asDropdown": true, - "includeVars": true, - "keepTime": true, - "tags": [ - "HA" - ], - "targetBlank": false, - "title": "HA", - "type": "dashboards" - }, - { - "asDropdown": true, - "includeVars": true, - "keepTime": true, - "tags": [ - "Cloud" - ], - "targetBlank": false, - "title": "Cloud", - "type": "dashboards" - }, - { - "asDropdown": true, - "includeVars": true, - "keepTime": true, - "tags": [ - "Insight" - ], - "targetBlank": false, - "title": "Insight", - "type": "dashboards" - }, - { - "asDropdown": true, - "includeVars": true, - "keepTime": true, - "tags": [ - "PMM" - ], - "targetBlank": false, - "title": "PMM", - "type": "dashboards" - }, { "asDropdown": false, "icon": "external link", @@ -150,85 +30,46 @@ "title": "Image render", "tooltip": "Image Render", "type": "link", - "url": "/render/d/${__dashboard.uid}/${__dashboard}?height=6500&width=2000" + "url": "/render/d/${__dashboard.uid}/${__dashboard}?height=1000&width=2000" } ], "liveNow": false, "panels": [ - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 382, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "refId": "A" - } - ], - "type": "row" - }, { "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" }, - "description": "**MySQL Uptime**\n\nThe amount of time since the last restart of the MySQL server process.", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, - "decimals": 1, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { - "color": "rgba(245, 54, 54, 0.9)", + "color": "green", "value": null - }, - { - "color": "rgba(237, 129, 40, 0.89)", - "value": 300 - }, - { - "color": "rgba(50, 172, 45, 0.97)", - "value": 3600 } ] - }, - "unit": "s" + } }, "overrides": [] }, "gridPos": { - "h": 2, - "w": 6, + "h": 4, + "w": 12, "x": 0, - "y": 1 + "y": 0 }, - "id": 12, - "interval": "$interval", - "links": [], - "maxDataPoints": 100, + "id": 1, "options": { "colorMode": "value", - "graphMode": "none", + "graphMode": "area", "justifyMode": "auto", - "orientation": "horizontal", + "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" @@ -241,82 +82,81 @@ "pluginVersion": "10.0.2", "targets": [ { - "calculatedInterval": "10m", + "dataset": "central_ledger", "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" }, - "datasourceErrors": {}, - "errors": {}, - "expr": "mysql_global_status_uptime{instance=~\"$host\"}", - "format": "time_series", - "interval": "5m", - "intervalFactor": 1, - "legendFormat": "", - "metric": "", + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT COUNT(t1.transferId) \nFROM central_ledger.transferStateChange t1 \nWHERE transferStateId = 'COMMITTED' \nAND createdDate between $__timeFrom() \nAND $__timeTo() AND t1.createdDate = (\n SELECT MAX(t2.createdDate)\n FROM central_ledger.transferStateChange t2\n WHERE t2.transferId = t1.transferId\n)\n ", "refId": "A", - "step": 300 + "sql": { + "columns": [ + { + "name": "COUNT", + "parameters": [ + { + "name": "transferStateId", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "name": "transferStateId", + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "transferStateChange" } ], - "title": "MySQL Uptime", + "title": "COMMITED State Changes In DB between time range", "type": "stat" }, { "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" }, - "description": "**Current QPS**\n\nBased on the queries reported by MySQL's ``SHOW STATUS`` command, it is the number of statements executed by the server within the last second. This variable includes statements executed within stored programs, unlike the Questions variable. It does not count \n``COM_PING`` or ``COM_STATISTICS`` commands.", "fieldConfig": { "defaults": { "color": { - "fixedColor": "rgb(31, 120, 193)", - "mode": "fixed" + "mode": "thresholds" }, - "decimals": 2, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { - "color": "rgba(245, 54, 54, 0.9)", + "color": "green", "value": null - }, - { - "color": "rgba(237, 129, 40, 0.89)", - "value": 35 - }, - { - "color": "rgba(50, 172, 45, 0.97)", - "value": 75 } ] - }, - "unit": "short" + } }, "overrides": [] }, "gridPos": { - "h": 2, - "w": 6, - "x": 6, - "y": 1 + "h": 4, + "w": 12, + "x": 12, + "y": 0 }, - "id": 13, - "interval": "$interval", - "links": [ - { - "targetBlank": true, - "title": "MySQL Server Status Variables", - "url": "https://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html#statvar_Queries" - } - ], - "maxDataPoints": 100, + "id": 2, "options": { - "colorMode": "none", + "colorMode": "value", "graphMode": "area", "justifyMode": "auto", - "orientation": "horizontal", + "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" @@ -329,4135 +169,468 @@ "pluginVersion": "10.0.2", "targets": [ { - "calculatedInterval": "10m", "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_queries{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_queries{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "", - "metric": "", + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT COUNT(transferId) FROM central_ledger.transferStateChange WHERE transferStateId != 'COMMITTED' AND createdDate between $__timeFrom() AND $__timeTo()", "refId": "A", - "step": 20 + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } } ], - "title": "Current QPS", + "title": "Transfer state changes excluding COMMITTED between time range", "type": "stat" }, { "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" }, - "description": "**InnoDB Buffer Pool Size**\n\nInnoDB maintains a storage area called the buffer pool for caching data and indexes in memory. Knowing how the InnoDB buffer pool works, and taking advantage of it to keep frequently accessed data in memory, is one of the most important aspects of MySQL tuning. The goal is to keep the working set in memory. In most cases, this should be between 60%-90% of available memory on a dedicated database host, but depends on many factors.", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, - "decimals": 0, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { - "color": "rgba(50, 172, 45, 0.97)", + "color": "green", "value": null - }, - { - "color": "rgba(237, 129, 40, 0.89)", - "value": 90 - }, - { - "color": "rgba(245, 54, 54, 0.9)", - "value": 95 } ] - }, - "unit": "bytes" + } }, "overrides": [] }, "gridPos": { - "h": 2, - "w": 6, - "x": 12, - "y": 1 + "h": 8, + "w": 12, + "x": 0, + "y": 4 }, - "id": 51, - "interval": "$interval", - "links": [ - { - "targetBlank": true, - "title": "Tuning the InnoDB Buffer Pool Size", - "url": "https://www.percona.com/blog/2015/06/02/80-ram-tune-innodb_buffer_pool_size/" - } - ], - "maxDataPoints": 100, + "id": 3, "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], + "cellHeight": "sm", + "footer": { + "countRows": false, "fields": "", - "values": false + "reducer": [ + "sum" + ], + "show": false }, - "textMode": "auto" + "frameIndex": 2, + "showHeader": true }, "pluginVersion": "10.0.2", "targets": [ { - "calculatedInterval": "10m", "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" }, - "datasourceErrors": {}, - "errors": {}, - "expr": "mysql_global_variables_innodb_buffer_pool_size{instance=~\"$host\"}", - "format": "time_series", - "interval": "5m", - "intervalFactor": 1, - "legendFormat": "", - "metric": "", + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "ANALYZE TABLE transfer;", "refId": "A", - "step": 300 + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "datasource": { + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "ANALYZE TABLE quote;", + "refId": "C", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "datasource": { + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "ANALYZE TABLE quoteResponse;", + "refId": "D", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "dataset": "performance_schema", + "datasource": { + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT table_schema \"DB Name\",\n ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) \"DB Size in MB\" \nFROM information_schema.tables \nGROUP BY table_schema; ", + "refId": "B", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } } ], - "title": "InnoDB Buffer Pool Size", - "type": "stat" + "title": "Panel Title", + "type": "table" }, { - "colorBackground": false, - "colorValue": true, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" }, - "decimals": 0, - "description": "**InnoDB Buffer Pool Size % of Total RAM**\n\nInnoDB maintains a storage area called the buffer pool for caching data and indexes in memory. Knowing how the InnoDB buffer pool works, and taking advantage of it to keep frequently accessed data in memory, is one of the most important aspects of MySQL tuning. The goal is to keep the working set in memory. In most cases, this should be between 60%-90% of available memory on a dedicated database host, but depends on many factors.", - "editable": true, - "error": false, - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] }, "gridPos": { - "h": 2, - "w": 6, - "x": 18, - "y": 1 + "h": 8, + "w": 12, + "x": 12, + "y": 4 }, - "height": "125px", - "id": 52, - "interval": "$interval", - "links": [ - { - "targetBlank": true, - "title": "Tuning the InnoDB Buffer Pool Size", - "url": "https://www.percona.com/blog/2015/06/02/80-ram-tune-innodb_buffer_pool_size/" - } - ], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 + "id": 4, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "80%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "maxValue": 100, - "minValue": 0, - "show": true + "showHeader": true }, - "tableColumn": "", + "pluginVersion": "10.0.2", "targets": [ { - "calculatedInterval": "10m", "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" }, - "datasourceErrors": {}, - "errors": {}, - "expr": "(mysql_global_variables_innodb_buffer_pool_size{instance=~\"$host\"} * 100) / on (instance) node_memory_MemTotal{instance=~\"$host\"}", - "format": "time_series", - "interval": "5m", - "intervalFactor": 1, - "legendFormat": "", - "metric": "", + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT COUNT(central_ledger.transfer.transferId), central_ledger.transferStateChange.transferStateId\nFROM central_ledger.transfer \nLEFT JOIN central_ledger.transferStateChange ON central_ledger.transfer.transferId=central_ledger.transferStateChange.transferId \nWHERE central_ledger.transferStateChange.transferStateChangeId IN (\n SELECT MAX(central_ledger.transferStateChange.transferStateChangeId)\n FROM central_ledger.transfer \n LEFT JOIN central_ledger.transferStateChange ON central_ledger.transfer.transferId=central_ledger.transferStateChange.transferId \n WHERE central_ledger.transferStateChange.createdDate between $__timeFrom() AND $__timeTo() \n GROUP BY central_ledger.transfer.transferId\n) \nGROUP BY central_ledger.transferStateChange.transferStateId", "refId": "A", - "step": 300 + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } } ], - "thresholds": "40,80", - "title": "Buffer Pool Size of Total RAM", - "type": "pmm-singlestat-panel", - "valueFontSize": "80%", - "valueMaps": [], - "valueName": "current" + "title": "Last Transfer State Count", + "type": "table" }, { - "collapsed": false, "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] }, "gridPos": { - "h": 1, - "w": 24, + "h": 5, + "w": 12, "x": 0, - "y": 3 + "y": 12 + }, + "id": 5, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" }, - "id": 383, - "panels": [], + "pluginVersion": "10.0.2", "targets": [ { "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" }, - "refId": "A" + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT COUNT(quoteId) FROM central_ledger.quote WHERE createdDate between $__timeFrom() AND $__timeTo()", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } } ], - "title": "Connections", - "type": "row" + "title": "Quote count between time range", + "type": "stat" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] }, - "decimals": 0, - "description": "**Max Connections** \n\nMax Connections is the maximum permitted number of simultaneous client connections. By default, this is 151. Increasing this value increases the number of file descriptors that mysqld requires. If the required number of descriptors are not available, the server reduces the value of Max Connections.\n\nmysqld actually permits Max Connections + 1 clients to connect. The extra connection is reserved for use by accounts that have the SUPER privilege, such as root.\n\nMax Used Connections is the maximum number of connections that have been in use simultaneously since the server started.\n\nConnections is the number of connection attempts (successful or not) to the MySQL server.", - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { - "h": 9, + "h": 5, "w": 12, - "x": 0, - "y": 4 + "x": 12, + "y": 12 }, - "height": "250px", - "hiddenSeries": false, - "id": 92, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [ - { - "targetBlank": true, - "title": "MySQL Server System Variables", - "url": "https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_max_connections" - } - ], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Max Connections", - "fill": 0 - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "max(max_over_time(mysql_global_status_threads_connected{instance=~\"$host\"}[$interval]) or mysql_global_status_threads_connected{instance=~\"$host\"} )", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Connections", - "metric": "", - "refId": "A", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "mysql_global_status_max_used_connections{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Max Used Connections", - "metric": "", - "refId": "C", - "step": 20, - "target": "" - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "mysql_global_variables_max_connections{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Max Connections", - "metric": "", - "refId": "B", - "step": 20, - "target": "" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Connections", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "label": "", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "description": "**MySQL Active Threads**\n\nThreads Connected is the number of open connections, while Threads Running is the number of threads not sleeping.", - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 4 - }, - "hiddenSeries": false, - "id": 10, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Peak Threads Running", - "color": "#E24D42", - "lines": false, - "pointradius": 1, - "points": true - }, - { - "alias": "Peak Threads Connected", - "color": "#1F78C1" - }, - { - "alias": "Avg Threads Running", - "color": "#EAB839" - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "max_over_time(mysql_global_status_threads_connected{instance=~\"$host\"}[$interval]) or\nmax_over_time(mysql_global_status_threads_connected{instance=~\"$host\"}[5m])", - "format": "time_series", - "hide": false, - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Peak Threads Connected", - "metric": "", - "refId": "A", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "max_over_time(mysql_global_status_threads_running{instance=~\"$host\"}[$interval]) or\nmax_over_time(mysql_global_status_threads_running{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Peak Threads Running", - "metric": "", - "refId": "B", - "step": 20 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "avg_over_time(mysql_global_status_threads_running{instance=~\"$host\"}[$interval]) or \navg_over_time(mysql_global_status_threads_running{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Avg Threads Running", - "refId": "C", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Client Thread Activity", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [ - "total" - ] - }, - "yaxes": [ - { - "format": "short", - "label": "Threads", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "label": "", - "logBase": 1, - "min": 0, - "show": false - } - ], - "yaxis": { - "align": false - } - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 13 - }, - "id": 384, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "refId": "A" - } - ], - "title": "Table Locks", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "description": "**MySQL Questions**\n\nThe number of statements executed by the server. This includes only statements sent to the server by clients and not statements executed within stored programs, unlike the Queries used in the QPS calculation. \n\nThis variable does not count the following commands:\n* ``COM_PING``\n* ``COM_STATISTICS``\n* ``COM_STMT_PREPARE``\n* ``COM_STMT_CLOSE``\n* ``COM_STMT_RESET``", - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 14 - }, - "hiddenSeries": false, - "id": 53, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [ - { - "targetBlank": true, - "title": "MySQL Queries and Questions", - "url": "https://www.percona.com/blog/2014/05/29/how-mysql-queries-and-questions-are-measured/" - } - ], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_questions{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_questions{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Questions", - "metric": "", - "refId": "A", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Questions", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "description": "**MySQL Thread Cache**\n\nThe thread_cache_size variable sets how many threads the server should cache to reuse. When a client disconnects, the client's threads are put in the cache if the cache is not full. It is autosized in MySQL 5.6.8 and above (capped to 100). Requests for threads are satisfied by reusing threads taken from the cache if possible, and only when the cache is empty is a new thread created.\n\n* *Threads_created*: The number of threads created to handle connections.\n* *Threads_cached*: The number of threads in the thread cache.", - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 14 - }, - "hiddenSeries": false, - "id": 11, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [ - { - "title": "Tuning information", - "url": "https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_thread_cache_size" - } - ], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Threads Created", - "fill": 0 - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "mysql_global_variables_thread_cache_size{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Thread Cache Size", - "metric": "", - "refId": "B", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "mysql_global_status_threads_cached{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Threads Cached", - "metric": "", - "refId": "C", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_threads_created{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_threads_created{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Threads Created", - "metric": "", - "refId": "A", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Thread Cache", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 23 - }, - "id": 385, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "refId": "A" - } - ], - "title": "Temporary Objects", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 24 - }, - "hiddenSeries": false, - "id": 22, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_created_tmp_tables{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_created_tmp_tables{instance=~\"$host\"}[5m])", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Created Tmp Tables", - "metric": "", - "refId": "A", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_created_tmp_disk_tables{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_created_tmp_disk_tables{instance=~\"$host\"}[5m])", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Created Tmp Disk Tables", - "metric": "", - "refId": "B", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_created_tmp_files{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_created_tmp_files{instance=~\"$host\"}[5m])", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Created Tmp Files", - "metric": "", - "refId": "C", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Temporary Objects", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "description": "**MySQL Select Types**\n\nAs with most relational databases, selecting based on indexes is more efficient than scanning an entire table's data. Here we see the counters for selects not done with indexes.\n\n* ***Select Scan*** is how many queries caused full table scans, in which all the data in the table had to be read and either discarded or returned.\n* ***Select Range*** is how many queries used a range scan, which means MySQL scanned all rows in a given range.\n* ***Select Full Join*** is the number of joins that are not joined on an index, this is usually a huge performance hit.", - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 24 - }, - "height": "250px", - "hiddenSeries": false, - "id": 311, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_select_full_join{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_select_full_join{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Select Full Join", - "metric": "", - "refId": "A", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_select_full_range_join{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_select_full_range_join{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Select Full Range Join", - "metric": "", - "refId": "B", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_select_range{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_select_range{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Select Range", - "metric": "", - "refId": "C", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_select_range_check{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_select_range_check{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Select Range Check", - "metric": "", - "refId": "D", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_select_scan{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_select_scan{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Select Scan", - "metric": "", - "refId": "E", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Select Types", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 33 - }, - "id": 386, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "refId": "A" - } - ], - "title": "Sorts", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "description": "**MySQL Sorts**\n\nDue to a query's structure, order, or other requirements, MySQL sorts the rows before returning them. For example, if a table is ordered 1 to 10 but you want the results reversed, MySQL then has to sort the rows to return 10 to 1.\n\nThis graph also shows when sorts had to scan a whole table or a given range of a table in order to return the results and which could not have been sorted via an index.", - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 34 - }, - "hiddenSeries": false, - "id": 30, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_sort_rows{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_sort_rows{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Sort Rows", - "metric": "", - "refId": "A", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_sort_range{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_sort_range{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Sort Range", - "metric": "", - "refId": "B", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_sort_merge_passes{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_sort_merge_passes{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Sort Merge Passes", - "metric": "", - "refId": "C", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_sort_scan{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_sort_scan{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Sort Scan", - "metric": "", - "refId": "D", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Sorts", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "description": "**MySQL Slow Queries**\n\nSlow queries are defined as queries being slower than the long_query_time setting. For example, if you have long_query_time set to 3, all queries that take longer than 3 seconds to complete will show on this graph.", - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 34 - }, - "hiddenSeries": false, - "id": 48, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_slow_queries{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_slow_queries{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Slow Queries", - "metric": "", - "refId": "A", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Slow Queries", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "label": "", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 41 - }, - "id": 387, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "refId": "A" - } - ], - "title": "Aborted", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "description": "**Aborted Connections**\n\nWhen a given host connects to MySQL and the connection is interrupted in the middle (for example due to bad credentials), MySQL keeps that info in a system table (since 5.6 this table is exposed in performance_schema).\n\nIf the amount of failed requests without a successful connection reaches the value of max_connect_errors, mysqld assumes that something is wrong and blocks the host from further connection.\n\nTo allow connections from that host again, you need to issue the ``FLUSH HOSTS`` statement.", - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 42 - }, - "hiddenSeries": false, - "id": 47, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_aborted_connects{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_aborted_connects{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Aborted Connects (attempts)", - "metric": "", - "refId": "A", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_aborted_clients{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_aborted_clients{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Aborted Clients (timeout)", - "metric": "", - "refId": "B", - "step": 20, - "target": "" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Aborted Connections", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "label": "", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "description": "**Table Locks**\n\nMySQL takes a number of different locks for varying reasons. In this graph we see how many Table level locks MySQL has requested from the storage engine. In the case of InnoDB, many times the locks could actually be row locks as it only takes table level locks in a few specific cases.\n\nIt is most useful to compare Locks Immediate and Locks Waited. If Locks waited is rising, it means you have lock contention. Otherwise, Locks Immediate rising and falling is normal activity.", - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 42 - }, - "hiddenSeries": false, - "id": 32, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_table_locks_immediate{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_table_locks_immediate{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Table Locks Immediate", - "metric": "", - "refId": "A", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_table_locks_waited{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_table_locks_waited{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Table Locks Waited", - "metric": "", - "refId": "B", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Table Locks", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 49 - }, - "id": 388, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "refId": "A" - } - ], - "title": "Network", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "description": "**MySQL Network Traffic**\n\nHere we can see how much network traffic is generated by MySQL. Outbound is network traffic sent from MySQL and Inbound is network traffic MySQL has received.", - "editable": true, - "error": false, - "fill": 6, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 50 - }, - "hiddenSeries": false, - "id": 9, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_bytes_received{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_bytes_received{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Inbound", - "metric": "", - "refId": "A", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_bytes_sent{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_bytes_sent{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Outbound", - "metric": "", - "refId": "B", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Network Traffic", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "none", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "description": "**MySQL Network Usage Hourly**\n\nHere we can see how much network traffic is generated by MySQL per hour. You can use the bar graph to compare data sent by MySQL and data received by MySQL.", - "editable": true, - "error": false, - "fill": 6, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 50 - }, - "height": "250px", - "hiddenSeries": false, - "id": 381, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": false, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "increase(mysql_global_status_bytes_received{instance=~\"$host\"}[1h])", - "format": "time_series", - "interval": "1h", - "intervalFactor": 1, - "legendFormat": "Received", - "metric": "", - "refId": "A", - "step": 3600 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "increase(mysql_global_status_bytes_sent{instance=~\"$host\"}[1h])", - "format": "time_series", - "interval": "1h", - "intervalFactor": 1, - "legendFormat": "Sent", - "metric": "", - "refId": "B", - "step": 3600 - } - ], - "thresholds": [], - "timeFrom": "24h", - "timeRegions": [], - "title": "MySQL Network Usage Hourly", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "none", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 57 - }, - "id": 389, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "refId": "A" - } - ], - "title": "Memory", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 0, - "description": "***System Memory***: Total Memory for the system.\\\n***InnoDB Buffer Pool Data***: InnoDB maintains a storage area called the buffer pool for caching data and indexes in memory.\\\n***TokuDB Cache Size***: Similar in function to the InnoDB Buffer Pool, TokuDB will allocate 50% of the installed RAM for its own cache.\\\n***Key Buffer Size***: Index blocks for MYISAM tables are buffered and are shared by all threads. key_buffer_size is the size of the buffer used for index blocks.\\\n***Adaptive Hash Index Size***: When InnoDB notices that some index values are being accessed very frequently, it builds a hash index for them in memory on top of B-Tree indexes.\\\n ***Query Cache Size***: The query cache stores the text of a SELECT statement together with the corresponding result that was sent to the client. The query cache has huge scalability problems in that only one thread can do an operation in the query cache at the same time.\\\n***InnoDB Dictionary Size***: The data dictionary is InnoDB ‘s internal catalog of tables. InnoDB stores the data dictionary on disk, and loads entries into memory while the server is running.\\\n***InnoDB Log Buffer Size***: The MySQL InnoDB log buffer allows transactions to run without having to write the log to disk before the transactions commit.", - "editable": true, - "error": false, - "fill": 6, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 58 - }, - "hiddenSeries": false, - "id": 50, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [ - { - "title": "Detailed descriptions about metrics", - "url": "https://www.percona.com/doc/percona-monitoring-and-management/dashboard.mysql-overview.html#mysql-internal-memory-overview" - } - ], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "System Memory", - "fill": 0, - "stack": false - } - ], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "node_memory_MemTotal{instance=~\"$host\"}", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "System Memory", - "refId": "G", - "step": 4 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "mysql_global_status_innodb_page_size{instance=~\"$host\"} * on (instance) mysql_global_status_buffer_pool_pages{instance=~\"$host\",state=\"data\"}", - "format": "time_series", - "hide": false, - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "InnoDB Buffer Pool Data", - "refId": "A", - "step": 20 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "mysql_global_variables_innodb_log_buffer_size{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "InnoDB Log Buffer Size", - "refId": "D", - "step": 20 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "mysql_global_variables_innodb_additional_mem_pool_size{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 2, - "legendFormat": "InnoDB Additional Memory Pool Size", - "refId": "H", - "step": 40 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "mysql_global_status_innodb_mem_dictionary{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "InnoDB Dictionary Size", - "refId": "F", - "step": 20 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "mysql_global_variables_key_buffer_size{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Key Buffer Size", - "refId": "B", - "step": 20 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "mysql_global_variables_query_cache_size{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Query Cache Size", - "refId": "C", - "step": 20 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "mysql_global_status_innodb_mem_adaptive_hash{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Adaptive Hash Index Size", - "refId": "E", - "step": 20 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "mysql_global_variables_tokudb_cache_size{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "TokuDB Cache Size", - "refId": "I", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Internal Memory Overview", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "label": "", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 65 - }, - "id": 390, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "refId": "A" - } - ], - "title": "Command, Handlers, Processes", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "description": "**Top Command Counters**\n\nThe Com_{{xxx}} statement counter variables indicate the number of times each xxx statement has been executed. There is one status variable for each type of statement. For example, Com_delete and Com_update count [``DELETE``](https://dev.mysql.com/doc/refman/5.7/en/delete.html) and [``UPDATE``](https://dev.mysql.com/doc/refman/5.7/en/update.html) statements, respectively. Com_delete_multi and Com_update_multi are similar but apply to [``DELETE``](https://dev.mysql.com/doc/refman/5.7/en/delete.html) and [``UPDATE``](https://dev.mysql.com/doc/refman/5.7/en/update.html) statements that use multiple-table syntax.", - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 66 - }, - "hiddenSeries": false, - "id": 14, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "hideEmpty": false, - "hideZero": false, - "max": true, - "min": true, - "rightSide": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [ - { - "title": "Server Status Variables (Com_xxx)", - "url": "https://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html#statvar_Com_xxx" - } - ], - "nullPointMode": "null as zero", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "topk(5, rate(mysql_global_status_commands_total{instance=~\"$host\"}[$interval])>0) or irate(mysql_global_status_commands_total{instance=~\"$host\"}[5m])>0", - "format": "time_series", - "hide": false, - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Com_{{ command }}", - "metric": "", - "refId": "B", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Top Command Counters", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "description": "**Top Command Counters Hourly**\n\nThe Com_{{xxx}} statement counter variables indicate the number of times each xxx statement has been executed. There is one status variable for each type of statement. For example, Com_delete and Com_update count [``DELETE``](https://dev.mysql.com/doc/refman/5.7/en/delete.html) and [``UPDATE``](https://dev.mysql.com/doc/refman/5.7/en/update.html) statements, respectively. Com_delete_multi and Com_update_multi are similar but apply to [``DELETE``](https://dev.mysql.com/doc/refman/5.7/en/delete.html) and [``UPDATE``](https://dev.mysql.com/doc/refman/5.7/en/update.html) statements that use multiple-table syntax.", - "editable": true, - "error": false, - "fill": 6, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 8, - "w": 24, - "x": 0, - "y": 76 - }, - "hiddenSeries": false, - "id": 39, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": false, - "linewidth": 2, - "links": [ - { - "title": "Server Status Variables (Com_xxx)", - "url": "https://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html#statvar_Com_xxx" - } - ], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "topk(5, increase(mysql_global_status_commands_total{instance=~\"$host\"}[1h])>0)", - "format": "time_series", - "interval": "1h", - "intervalFactor": 1, - "legendFormat": "Com_{{ command }}", - "metric": "", - "refId": "A", - "step": 3600 - } - ], - "thresholds": [], - "timeFrom": "24h", - "timeRegions": [], - "title": "Top Command Counters Hourly", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "description": "**MySQL Handlers**\n\nHandler statistics are internal statistics on how MySQL is selecting, updating, inserting, and modifying rows, tables, and indexes.\n\nThis is in fact the layer between the Storage Engine and MySQL.\n\n* `read_rnd_next` is incremented when the server performs a full table scan and this is a counter you don't really want to see with a high value.\n* `read_key` is incremented when a read is done with an index.\n* `read_next` is incremented when the storage engine is asked to 'read the next index entry'. A high value means a lot of index scans are being done.", - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 8, - "w": 24, - "x": 0, - "y": 84 - }, - "hiddenSeries": false, - "id": 8, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "hideZero": true, - "max": true, - "min": true, - "rightSide": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_handlers_total{instance=~\"$host\", handler!~\"commit|rollback|savepoint.*|prepare\"}[$interval]) or irate(mysql_global_status_handlers_total{instance=~\"$host\", handler!~\"commit|rollback|savepoint.*|prepare\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "{{ handler }}", - "metric": "", - "refId": "J", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Handlers", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 92 - }, - "hiddenSeries": false, - "id": 28, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "hideZero": true, - "max": true, - "min": true, - "rightSide": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_handlers_total{instance=~\"$host\", handler=~\"commit|rollback|savepoint.*|prepare\"}[$interval]) or irate(mysql_global_status_handlers_total{instance=~\"$host\", handler=~\"commit|rollback|savepoint.*|prepare\"}[5m])", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "{{ handler }}", - "metric": "", - "refId": "A", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Transaction Handlers", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "editable": true, - "error": false, - "fill": 0, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 99 - }, - "hiddenSeries": false, - "id": 40, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "hideZero": true, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null as zero", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "mysql_info_schema_threads{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "{{ state }}", - "metric": "", - "refId": "A", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Process States", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "editable": true, - "error": false, - "fill": 6, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 106 - }, - "hiddenSeries": false, - "id": 49, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "hideZero": true, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": false, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "topk(5, avg_over_time(mysql_info_schema_threads{instance=~\"$host\"}[1h]))", - "interval": "1h", - "intervalFactor": 1, - "legendFormat": "{{ state }}", - "metric": "", - "refId": "A", - "step": 3600 - } - ], - "thresholds": [], - "timeFrom": "24h", - "timeRegions": [], - "title": "Top Process States Hourly", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 113 - }, - "id": 391, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "refId": "A" - } - ], - "title": "Query Cache", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "description": "**MySQL Query Cache Memory**\n\nThe query cache has huge scalability problems in that only one thread can do an operation in the query cache at the same time. This serialization is true not only for SELECTs, but also for INSERT/UPDATE/DELETE.\n\nThis also means that the larger the `query_cache_size` is set to, the slower those operations become. In concurrent environments, the MySQL Query Cache quickly becomes a contention point, decreasing performance. MariaDB and AWS Aurora have done work to try and eliminate the query cache contention in their flavors of MySQL, while MySQL 8.0 has eliminated the query cache feature.\n\nThe recommended settings for most environments is to set:\n ``query_cache_type=0``\n ``query_cache_size=0``\n\nNote that while you can dynamically change these values, to completely remove the contention point you have to restart the database.", - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 114 - }, - "hiddenSeries": false, - "id": 46, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "mysql_global_status_qcache_free_memory{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Free Memory", - "metric": "", - "refId": "F", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "mysql_global_variables_query_cache_size{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Query Cache Size", - "metric": "", - "refId": "E", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Query Cache Memory", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "description": "**MySQL Query Cache Activity**\n\nThe query cache has huge scalability problems in that only one thread can do an operation in the query cache at the same time. This serialization is true not only for SELECTs, but also for INSERT/UPDATE/DELETE.\n\nThis also means that the larger the `query_cache_size` is set to, the slower those operations become. In concurrent environments, the MySQL Query Cache quickly becomes a contention point, decreasing performance. MariaDB and AWS Aurora have done work to try and eliminate the query cache contention in their flavors of MySQL, while MySQL 8.0 has eliminated the query cache feature.\n\nThe recommended settings for most environments is to set:\n``query_cache_type=0``\n``query_cache_size=0``\n\nNote that while you can dynamically change these values, to completely remove the contention point you have to restart the database.", - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 114 - }, - "height": "", - "hiddenSeries": false, - "id": 45, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_qcache_hits{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_qcache_hits{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Hits", - "metric": "", - "refId": "B", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_qcache_inserts{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_qcache_inserts{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Inserts", - "metric": "", - "refId": "C", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_qcache_not_cached{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_qcache_not_cached{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Not Cached", - "metric": "", - "refId": "D", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_qcache_lowmem_prunes{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_qcache_lowmem_prunes{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Prunes", - "metric": "", - "refId": "F", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "mysql_global_status_qcache_queries_in_cache{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Queries in Cache", - "metric": "", - "refId": "E", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Query Cache Activity", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 121 - }, - "id": 392, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "refId": "A" - } - ], - "title": "Files and Tables", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 122 - }, - "hiddenSeries": false, - "id": 43, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_opened_files{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_opened_files{instance=~\"$host\"}[5m])", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Openings", - "metric": "", - "refId": "A", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL File Openings", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 122 - }, - "hiddenSeries": false, - "id": 41, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "mysql_global_status_open_files{instance=~\"$host\"}", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Open Files", - "metric": "", - "refId": "A", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "mysql_global_variables_open_files_limit{instance=~\"$host\"}", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Open Files Limit", - "metric": "", - "refId": "D", - "step": 20 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "mysql_global_status_innodb_num_open_files{instance=~\"$host\"}", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "InnoDB Open Files", - "refId": "B", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Open Files", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 132 - }, - "id": 393, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "refId": "A" - } - ], - "title": "Table Openings", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "description": "**MySQL Table Open Cache Status**\n\nThe recommendation is to set the `table_open_cache_instances` to a loose correlation to virtual CPUs, keeping in mind that more instances means the cache is split more times. If you have a cache set to 500 but it has 10 instances, each cache will only have 50 cached.\n\nThe `table_definition_cache` and `table_open_cache` can be left as default as they are auto-sized MySQL 5.6 and above (ie: do not set them to any value).", - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 12, - "w": 12, - "x": 0, - "y": 133 - }, - "hiddenSeries": false, - "id": 44, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [ - { - "title": "Server Status Variables (table_open_cache)", - "url": "http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_table_open_cache" - } - ], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Table Open Cache Hit Ratio", - "yaxis": 2 - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "rate(mysql_global_status_opened_tables{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_opened_tables{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Openings", - "metric": "", - "refId": "A", - "step": 20 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "rate(mysql_global_status_table_open_cache_hits{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_table_open_cache_hits{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Hits", - "refId": "B", - "step": 20 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "rate(mysql_global_status_table_open_cache_misses{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_table_open_cache_misses{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Misses", - "refId": "C", - "step": 20 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "rate(mysql_global_status_table_open_cache_overflows{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_table_open_cache_overflows{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Misses due to Overflows", - "refId": "D", - "step": 20 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "(rate(mysql_global_status_table_open_cache_hits{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_table_open_cache_hits{instance=~\"$host\"}[5m]))/((rate(mysql_global_status_table_open_cache_hits{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_table_open_cache_hits{instance=~\"$host\"}[5m]))+(rate(mysql_global_status_table_open_cache_misses{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_table_open_cache_misses{instance=~\"$host\"}[5m])))", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Table Open Cache Hit Ratio", - "refId": "E", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Table Open Cache Status", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:141", - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "$$hashKey": "object:142", - "format": "percentunit", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "description": "**MySQL Open Tables**\n\nThe recommendation is to set the `table_open_cache_instances` to a loose correlation to virtual CPUs, keeping in mind that more instances means the cache is split more times. If you have a cache set to 500 but it has 10 instances, each cache will only have 50 cached.\n\nThe `table_definition_cache` and `table_open_cache` can be left as default as they are auto-sized MySQL 5.6 and above (ie: do not set them to any value).", - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 12, - "w": 12, - "x": 12, - "y": 133 - }, - "hiddenSeries": false, - "id": 42, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [ - { - "title": "Server Status Variables (table_open_cache)", - "url": "http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_table_open_cache" - } - ], - "nullPointMode": "null", + "id": 6, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "mysql_global_status_open_tables{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Open Tables", - "metric": "", - "refId": "B", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "mysql_global_variables_table_open_cache{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Table Open Cache", - "metric": "", - "refId": "C", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Open Tables", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 145 - }, - "id": 394, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "refId": "A" - } - ], - "title": "MySQL Table Definition Cache", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "decimals": 2, - "description": "**MySQL Table Definition Cache**\n\nThe recommendation is to set the `table_open_cache_instances` to a loose correlation to virtual CPUs, keeping in mind that more instances means the cache is split more times. If you have a cache set to 500 but it has 10 instances, each cache will only have 50 cached.\n\nThe `table_definition_cache` and `table_open_cache` can be left as default as they are auto-sized MySQL 5.6 and above (ie: do not set them to any value).", - "editable": true, - "error": false, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 9, - "w": 24, - "x": 0, - "y": 146 - }, - "hiddenSeries": false, - "id": 54, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [ - { - "title": "Server Status Variables (table_open_cache)", - "url": "http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_table_open_cache" - } - ], - "nullPointMode": "null", - "options": { - "alertThreshold": true + "textMode": "auto" }, - "percentage": false, "pluginVersion": "10.0.2", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Opened Table Definitions", - "yaxis": 2 - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, "targets": [ - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "mysql_global_status_open_table_definitions{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Open Table Definitions", - "metric": "", - "refId": "B", - "step": 20 - }, - { - "calculatedInterval": "2m", - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "datasourceErrors": {}, - "errors": {}, - "expr": "mysql_global_variables_table_definition_cache{instance=~\"$host\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Table Definitions Cache Size", - "metric": "", - "refId": "C", - "step": 20 - }, { "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" }, - "expr": "rate(mysql_global_status_opened_table_definitions{instance=~\"$host\"}[$interval]) or irate(mysql_global_status_opened_table_definitions{instance=~\"$host\"}[5m])", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "Opened Table Definitions", + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT COUNT(quoteResponseId) FROM central_ledger.quoteResponse WHERE createdDate between $__timeFrom() AND $__timeTo()", "refId": "A", - "step": 20 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "MySQL Table Definition Cache", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } } ], - "yaxis": { - "align": false - } + "title": "Quote response count between time range", + "type": "stat" } ], - "refresh": "10s", + "refresh": false, "schemaVersion": 38, "style": "dark", - "tags": [ - "Percona", - "MySQL" - ], + "tags": [], "templating": { - "list": [ - { - "allFormat": "glob", - "auto": true, - "auto_count": 200, - "auto_min": "1s", - "current": { - "selected": false, - "text": "auto", - "value": "$__auto_interval_interval" - }, - "datasource": "Prometheus", - "hide": 0, - "includeAll": false, - "label": "Interval", - "multi": false, - "multiFormat": "glob", - "name": "interval", - "options": [ - { - "selected": true, - "text": "auto", - "value": "$__auto_interval_interval" - }, - { - "selected": false, - "text": "1s", - "value": "1s" - }, - { - "selected": false, - "text": "5s", - "value": "5s" - }, - { - "selected": false, - "text": "1m", - "value": "1m" - }, - { - "selected": false, - "text": "5m", - "value": "5m" - }, - { - "selected": false, - "text": "1h", - "value": "1h" - }, - { - "selected": false, - "text": "6h", - "value": "6h" - }, - { - "selected": false, - "text": "1d", - "value": "1d" - } - ], - "query": "1s,5s,1m,5m,1h,6h,1d", - "refresh": 2, - "skipUrlSync": false, - "type": "interval" - }, - { - "allFormat": "glob", - "current": { - "selected": false, - "text": "mysqlexporter-cl:9104", - "value": "mysqlexporter-cl:9104" - }, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "definition": "", - "hide": 0, - "includeAll": false, - "label": "Host", - "multi": false, - "multiFormat": "regex values", - "name": "host", - "options": [], - "query": "label_values(mysql_up, instance)", - "refresh": 2, - "refresh_on_load": false, - "regex": "", - "skipUrlSync": false, - "sort": 1, - "type": "query", - "useTags": false - } - ] + "list": [] }, "time": { - "from": "now-5m", - "to": "now" - }, - "timepicker": { - "collapse": false, - "enable": true, - "hidden": false, - "notice": false, - "now": true, - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "status": "Stable", - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ], - "type": "timepicker" + "from": "2023-10-05T02:05:23.353Z", + "to": "2023-10-05T02:09:31.114Z" }, - "timezone": "browser", - "title": "MySQL Overview", - "uid": "MQWgroiiz", - "version": 1, + "timepicker": {}, + "timezone": "", + "title": "Central Ledger DB-", + "uid": "d17cf1dd-8fbc-4841-a957-214387249f18", + "version": 2, "weekStart": "" }