A very simple JSON server to show Trisul Metrics in a Grafana Dashboard
A dead simple Ruby rack based server
The trisul-grafana-server is a very simple and fast server that allows to you show Trisul Network Analytics time series graphs in Grafana.
- Uses the simple-json-server Grafana Datasource
- Has no authentication at the moment. Use with caution on internal network. We will be adding auth soon.
Step 1: Install the simple-json-datasource
Follow the instructions in https://github.com/grafana/simple-json-datasource?utm_source=grafana_add_ds to install the SimpleJSON datasource.
Step 2: Start the Trisul Grafana server
This is the small rack server to drive the Grafana JSON query interface.
- Download and unzip the latest release from https://github.com/trisulnsm/grafana-server/releases to the Web Trisul server
- Start the trisu-grafana server
You can use the built in Ruby server stack on the Web Trisul server to start the server.
sudo -i cd /usr/local/share/webtrisul source build/switch_local_ruby
In that same session start the server (assume you want to run on port 3005 and bind to IP 192.168.2.99)
rackup trisul-grafana-server.ru -p 3005 -o 192.168.2.99
You can also use your platforms Ruby / Rack if you wish. The goal is to start the rackup server.
Step 3: Configure the SimpleJSON datasource
On Grafana , go to Configuration > Data Source then specify the connection to the server you configured in Step 2
Step 4: Create your dashboards using a special metric format.
First a quick look at the Trisul Metric format
Metrics are identified by a string with the following format
/probe-id/counter group name/key or label/meter number
/probe0/apps/http/0refers to the metric 0 (total bytes) of the HTTP item in the Applications counter group from probe0
- The counter group name is matched by the first few characters converted to lowercase,
/probe0/apps/http/0is the same as
- To get a list of counters and meters login to Trisul and go to Customize > View Meters
- You can leave the probe part blank if you only have a single probe or you want to get data from ALL PROBES combined.
So you would do
How to get Toppers into a table
- You can put toppers from any counter group in a table by using the special key toppers You can add a table in Grafana such as /probe0/apps/toppers(5)/0 This gets the top 5 applications of meter 0 (Total bandwidth) into a table
How to get Topper history timeseries into a chart
- Sometimes you want to see the timeseries for a bunch of toppers.
- Create a timeserie query , then use the //apps/toppers(5)/0 format
How to get lastest toppers into a table
- You can put latest toppers from any counter group in a table by using the special key latest toppers. such as /probe0/apps/latest toppers(10)/0
How to get total value for toppers into a pie chart
- You can use a special key total toppers such as _/probe0/apps/total toppers(10)/0
Start adding queries to dashboards
Create a new dashboard , then start adding Trisul Metrics as shown below. Just enter the strings directly
Enjoy the view
Here is a sample dashboard