Skip to content

Commit

Permalink
monitoring: document MetricsTool (Export Grafana Snapshots) (pingcap#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytm authored Dec 8, 2020
1 parent 49e7d27 commit de4cd64
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1 deletion.
1 change: 1 addition & 0 deletions TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
+ [Monitoring Framework Overview](/tidb-monitoring-framework.md)
+ [Monitoring API](/tidb-monitoring-api.md)
+ [Deploy Monitoring Services](/deploy-monitoring-services.md)
+ [Export Grafana Snapshots](/exporting-grafana-snapshots.md)
+ [TiDB Cluster Alert Rules](/alert-rules.md)
+ [TiFlash Alert Rules](/tiflash/tiflash-alert-rules.md)
+ Troubleshoot
Expand Down
3 changes: 2 additions & 1 deletion _index.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Designed for the cloud, TiDB provides flexible scalability, reliability and secu
- [Monitoring Framework](/tidb-monitoring-framework.md)
- [Monitoring API](/tidb-monitoring-api.md)
- [Deploy Monitoring Services](/deploy-monitoring-services.md)
- [Export Grafana Snapshots](/exporting-grafana-snapshots.md)
- [Alert Rules and Solutions](/alert-rules.md)
- [TiFlash Alert Rules and Solutions](/tiflash/tiflash-alert-rules.md)

Expand Down Expand Up @@ -113,4 +114,4 @@ Designed for the cloud, TiDB provides flexible scalability, reliability and secu
- [Migration FAQs](/faq/migration-tidb-faq.md)

</NavColumn>
</NavColumns>
</NavColumns>
48 changes: 48 additions & 0 deletions exporting-grafana-snapshots.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: Export Grafana Snapshots
summary: Learn how to export snapshots of Grafana Dashboard, and how to visualize these files.
---

# Export Grafana Snapshots

Metrics data is important in troubleshooting. When you request remote assistance, sometimes the support staff need to view the Grafana dashboards to diagnose problems. [MetricsTool](https://metricstool.pingcap.com/) can help export snapshots of Grafana dashboards as local files and visualize these snapshots. You can share these snapshots with outsiders and allow them to accurately read out the graphs, without giving out access to other sensitive information on the Grafana server.

## Usage

MetricsTool can be accessed from <https://metricstool.pingcap.com/>. It consists of three sets of tools:

* **Export**: A user script running on the browser's Developer Tool, allowing you to download a snapshot of all visible panels in the current dashboard on any Grafana v6.x.x server.

![Screenshot of MetricsTool Exporter after running the user script](/media/metricstool-export.png)

* **Visualize**: A web page visualizing the exported snapshot files. The visualized snapshots can be operated in the same way as live Grafana dashboards.

![Screenshot of MetricsTool Visualizer](/media/metricstool-visualize.png)

* **Import**: Instructions to import the exported snapshot back into an actual Grafana instance.

## FAQs

### What is the advantage of this tool compared with screenshot or PDF printing?

The snapshot files exported by MetricsTool contain the actual values when they are taken. And the Visualizer allows you to interact with the rendered graphs as if it is a live Grafana dashboard, supporting operations like toggling series, zooming into a smaller time range, and checking the precise value at a given time. This makes MetricsTool much more powerful than images or PDFs.

### What are included in the snapshot file?

The snapshot file contains the values of all graphs and panels in the selected time range. It does not save the original metrics from the data sources (and thus you cannot edit the query expression in the Visualizer).

### Will the Visualizer save the uploaded snapshot files in PingCAP's servers?

No, the Visualizer parses the snapshot files entirely inside your browser. Nothing will be sent to PingCAP. You are free to view snapshot files received from sensitive sources, and no need to worry about these leaking to third parties through the Visualizer.

### Can it export metrics besides Grafana?

No, we only support Grafana v6.x.x at the moment.

### Will there be problems to execute the script before all metrics are loaded?

No, the script UI will notify you to wait for all metrics to be loaded. However, you can manually skip waiting and export the snapshot in case of some metrics loading for too long.

### Can we share a link to a visualized snapshot?

No, but you can share the snapshot file, with instruction on how to use the Visualizer to view it. If you truly need a world-readable URL, you may also try the public `snapshot.raintank.io` service built into Grafana, but make sure all privacy concerns are cleared before doing so.
Binary file added media/metricstool-export.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/metricstool-visualize.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit de4cd64

Please sign in to comment.