metrics: Collect with Graphite and visualize with Grafana. (#5549)

* Add compose config for grafana/graphite combo

* Add rudimentary readme with instructions

* Add Samir's dashboard

* metrics: Move `metrics/grafana` to `ledger/metrics/collection`.

CHANGELOG_BEGIN
CHANGELOG_END

* metrics/collection: Rename samirs-dashboard to ledger-submissions.

* metrics/collection: Save Graphite data between restarts.

* metrics/collection: Add copyright headers.

Co-authored-by: Vladislav Gangan <vladislav.gangan@digitalasset.com>
This commit is contained in:
Samir Talwar 2020-04-15 14:28:57 +02:00 committed by GitHub
parent 11606e327e
commit 5c1c7fe30a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 784 additions and 0 deletions

View File

@ -0,0 +1,19 @@
1. Launch Grafana & Graphite:
```
$ docker-compose up -d
```
2. Explore available dashboards:
```
$ open http://localhost:3000/
# login with admin/admin
```
3. Power off when done:
```
$ docker-compose down
```

View File

@ -0,0 +1,203 @@
{
"annotations": {
"enable": false,
"list": [
{
"$$hashKey": "object:60",
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 1,
"links": [],
"panels": [
{
"aliasColors": {},
"annotate": {
"enable": false
},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Graphite",
"editable": true,
"fill": 0,
"fillGradient": 0,
"grid": {
"max": null,
"min": 0
},
"gridPos": {
"h": 10,
"w": 24,
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 1,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"loadingEditor": false,
"nullPointMode": "null as zero",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"resolution": 100,
"scale": 1,
"seriesOverrides": [
{
"alias": "Points Per Update",
"yaxis": 2
},
{
"alias": "CPU",
"yaxis": 2
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"refId": "A",
"target": "alias(sumSeries(carbon.agents.*.updateOperations),\"Updates\") "
},
{
"refId": "B",
"target": "alias(sumSeries(carbon.agents.*.metricsReceived),'Metrics Received')"
},
{
"refId": "C",
"target": "alias(sumSeries(carbon.agents.*.committedPoints),'Committed Points')"
},
{
"refId": "D",
"target": "alias(sumSeries(carbon.agents.*.pointsPerUpdate),'Points Per Update')"
},
{
"refId": "E",
"target": "alias(averageSeries(carbon.agents.*.cpuUsage),'CPU')"
},
{
"refId": "F",
"target": "alias(sumSeries(carbon.agents.*.creates),'Creates')"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Graphite Carbon Metrics",
"tooltip": {
"query_as_alias": true,
"shared": false,
"sort": 0,
"value_type": "cumulative"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
},
"zerofill": true
}
],
"refresh": false,
"revision": "1.0",
"schemaVersion": 22,
"style": "dark",
"tags": [
"graphite",
"carbon"
],
"templating": {
"list": []
},
"time": {
"from": "now-5m",
"to": "now"
},
"timepicker": {
"collapse": false,
"enable": true,
"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"
},
"timezone": "browser",
"title": "Graphite Carbon Metrics",
"uid": "YEv29jjWz",
"variables": {
"list": []
},
"version": 1
}

View File

@ -0,0 +1,483 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 3,
"links": [],
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 2,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pluginVersion": "6.7.2",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"refId": "A",
"target": "daml.services.write.submit_transaction.count"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Submission count",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 0
},
"hiddenSeries": false,
"id": 4,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"hide": false,
"refCount": 0,
"refId": "A",
"target": "daml.services.write.submit_transaction.mean"
},
{
"refCount": 0,
"refId": "B",
"target": "daml.kvutils.committer.run_timer.mean"
},
{
"refCount": 0,
"refId": "C",
"target": "daml.kvutils.committer.transaction.run_timer.mean"
},
{
"refCount": 0,
"refId": "D",
"target": "daml.kvutils.submission.conversion.transaction_to_submission.mean"
},
{
"refCount": 0,
"refId": "E",
"target": "daml.kvutils.submission.validator.acquire_transaction_lock.mean"
},
{
"refCount": 0,
"refId": "F",
"target": "daml.kvutils.submission.validator.release_transaction_lock.mean"
},
{
"refCount": 0,
"refId": "G",
"target": "daml.kvutils.submission.validator.open_envelope.mean"
},
{
"refCount": 0,
"refId": "H",
"target": "daml.kvutils.submission.validator.validate_submission.mean"
},
{
"refCount": 0,
"refId": "I",
"target": "daml.kvutils.submission.validator.process_submission.mean"
},
{
"refCount": 0,
"refId": "J",
"target": "daml.kvutils.submission.validator.commit_submission.mean"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Submission processing time",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "ms",
"label": "",
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 8
},
"hiddenSeries": false,
"id": 6,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"refCount": 0,
"refId": "A",
"target": "jvm.thread_states.count"
},
{
"refCount": 0,
"refId": "B",
"target": "jvm.thread_states.new.count"
},
{
"refCount": 0,
"refId": "C",
"target": "jvm.thread_states.runnable.count"
},
{
"refCount": 0,
"refId": "D",
"target": "jvm.thread_states.waiting.count"
},
{
"refCount": 0,
"refId": "E",
"target": "jvm.thread_states.timed_waiting.count"
},
{
"refCount": 0,
"refId": "F",
"target": "jvm.thread_states.blocked.count"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "JVM thread states",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 8
},
"hiddenSeries": false,
"id": 8,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"refCount": 0,
"refId": "A",
"target": "jvm.memory_usage.total.used"
},
{
"refCount": 0,
"refId": "B",
"target": "jvm.memory_usage.heap.used"
},
{
"refCount": 0,
"refId": "C",
"target": "jvm.memory_usage.non-heap.used"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "JVM memory used",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "decbytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"refresh": "5s",
"schemaVersion": 22,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-5m",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
]
},
"timezone": "",
"title": "Ledger Submissions",
"uid": "2QgQRqCWk",
"variables": {
"list": []
},
"version": 2
}

View File

@ -0,0 +1,40 @@
# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
version: "3"
services:
grafana:
image: grafana/grafana
container_name: grafana
restart: always
ports:
- 3000:3000
networks:
- collection
volumes:
- ./dashboards:/var/lib/grafana/dashboards
- ./provisioning/dashboards:/etc/grafana/provisioning/dashboards
- ./provisioning/datasources:/etc/grafana/provisioning/datasources
graphite:
image: graphiteapp/graphite-statsd
container_name: graphite
restart: always
ports:
- 2000:80
- 2003:2003
- 2004:2004
- 2023:2023
- 2024:2024
- 8125:8125/udp
- 8126:8126
networks:
- collection
volumes:
- graphite-storage:/opt/graphite/storage
networks:
collection:
volumes:
graphite-storage:

View File

@ -0,0 +1,17 @@
# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
apiVersion: 1
providers:
- name: 'DAML'
orgId: 1
folder: 'daml'
folderUid: ''
type: file
disableDeletion: false
editable: true
updateIntervalSeconds: 10
allowUiUpdates: true
options:
path: /var/lib/grafana/dashboards

View File

@ -0,0 +1,22 @@
# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
apiVersion: 1
deleteDatasources:
- name: Graphite
orgId: 1
datasources:
- name: Graphite
type: graphite
access: proxy
orgId: 1
url: http://graphite:8080
isDefault: true
jsonData:
graphiteVersion: "1.1"
tlsAuth: false
tlsAuthWithCACert: false
version: 1
editable: false