| 
									
										
										
										
											2018-11-24 11:11:27 -08:00
										 |  |  | # Metrics
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ## Testnet Grafana Dashboard
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | There are three versions of the testnet dashboard, corresponding to the three | 
					
						
							|  |  |  | release channels: | 
					
						
							| 
									
										
										
										
											2020-03-11 10:21:53 -07:00
										 |  |  | * https://metrics.solana.com:3000/d/monitor-edge/cluster-telemetry-edge | 
					
						
							|  |  |  | * https://metrics.solana.com:3000/d/monitor-beta/cluster-telemetry-beta | 
					
						
							|  |  |  | * https://metrics.solana.com:3000/d/monitor/cluster-telemetry | 
					
						
							| 
									
										
										
										
											2018-11-24 11:11:27 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The dashboard for each channel is defined from the | 
					
						
							| 
									
										
										
										
											2020-03-11 10:21:53 -07:00
										 |  |  | `metrics/scripts/grafana-provisioning/dashboards/cluster-monitor.json` source | 
					
						
							|  |  |  | file in the git branch associated with that channel, and deployed by automation | 
					
						
							|  |  |  | running `ci/publish-metrics-dashboard.sh`. | 
					
						
							| 
									
										
										
										
											2018-11-24 11:11:27 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | A deploy can be triggered at any time via the `New Build` button of | 
					
						
							|  |  |  | https://buildkite.com/solana-labs/publish-metrics-dashboard. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### Modifying a Dashboard
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-13 09:31:11 -07:00
										 |  |  | Dashboard updates are accomplished by modifying | 
					
						
							| 
									
										
										
										
											2020-03-11 10:21:53 -07:00
										 |  |  | `metrics/scripts/grafana-provisioning/dashboards/cluster-monitor.json`, | 
					
						
							| 
									
										
										
										
											2018-11-24 11:11:27 -08:00
										 |  |  | **manual edits made directly in Grafana will be overwritten**. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-22 14:55:19 -07:00
										 |  |  | * Check out metrics to add at https://metrics.solana.com:8888/ in the data explorer. | 
					
						
							|  |  |  | * When editing a query for a dashboard graph, use the "Toggle Edit Mode" selection | 
					
						
							|  |  |  |   behind the hamburger button to use raw SQL and copy the query into the text field. | 
					
						
							|  |  |  |   You may have to fixup the query with the dashboard variables like $testnet or $timeFilter, | 
					
						
							|  |  |  |   check other functioning fields in the dashboard for examples. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-24 11:11:27 -08:00
										 |  |  | 1. Open the desired dashboard in Grafana | 
					
						
							|  |  |  | 2. Create a development copy of the dashboard by selecting `Save As..` in the | 
					
						
							|  |  |  |    `Settings` menu for the dashboard | 
					
						
							|  |  |  | 3. Edit dashboard as desired | 
					
						
							|  |  |  | 4. Extract the JSON Model by selecting `JSON Model` in the `Settings` menu.  Copy the JSON to the clipboard | 
					
						
							| 
									
										
										
										
											2020-03-11 10:21:53 -07:00
										 |  |  |     and paste into `metrics/scripts/grafana-provisioning/dashboards/cluster-monitor.json`, | 
					
						
							| 
									
										
										
										
											2018-11-24 11:11:27 -08:00
										 |  |  | 5. Delete your development dashboard: `Settings` => `Delete` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### Deploying a Dashboard Manually
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | If you need to immediately deploy a dashboard using the contents of | 
					
						
							| 
									
										
										
										
											2020-03-11 10:21:53 -07:00
										 |  |  | `cluster-monitor.json` in your local workspace, | 
					
						
							| 
									
										
										
										
											2018-11-24 11:11:27 -08:00
										 |  |  | ``` | 
					
						
							|  |  |  | $ export GRAFANA_API_TOKEN="an API key from https://metrics.solana.com:3000/org/apikeys" | 
					
						
							|  |  |  | $ metrics/publish-metrics-dashboard.sh (edge|beta|stable) | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | Note that automation will eventually overwrite your manual deploy. |