How-To Guides
Applications Guides

Visualize Data Using Grafana

12min
you can use grafana to visualize data in litmus edge step 1 install docker container you have two options to install the docker container option 1 deploy grafana from litmus edge manager if you have access to litmus edge manager (lem), you can use lem to deploy grafana in your litmus edge instance to deploy grafana from litmus edge manager in litmus edge manager, follow the steps to manage applications docid 1cjul2kjjiqebn2kvhjp6 for grafana, follow the steps to deploy an application to edge devices docid\ druoocegnxcgi d 5azzw for step 2 application settings , if the default port number is already in use, you will need to enter another port in litmus edge, navigate to applications > containers the containers pane appears verify that the grafana docker container is running option 2 run grafana container in litmus edge if you don't have access to litmus edge manager, you can run the grafana container in litmus edge to run the grafana container in litmus edge navigate to applications > containers the containers pane appears from the containers pane, click run the enter command to run field appears enter the following docker run command and click run docker run d name=grafana restart=always u root v grafana storage /var/lib/grafana v grafana config /etc/grafana p 3000 3000 grafana/grafana if needed, replace p 3000 3000 with a different port 4\ verify that the grafana docker container is running step 2 access grafana to connect to grafana, you will use your litmus edge ip address and the port configured in the grafana container to access grafana in a new browser window, enter the url to connect to grafana using this format \[litmus edge ip address] \[port] for example, if your litmus edge instance uses the ip address https //192 168 0 146, and the grafana container uses port 3000, enter 192 168 0 146 3000 the grafana login screen appears enter admin as the username and password, and then change the password the grafana home screen appears step 3 set up database grafana needs a database to extract from to display results litmus edge allows you to configure the internal timeseries database (tsdata) to connect to grafana you also have the option to set up a database to your specific requirements step 1 create db user you will need to create a user that has read access to the database to create a db user in litmus edge, navigate to datahub > db users click the add user icon configure the user details username password copy and save this for later use database select tsdata privilege select read click add user step 2 ensure database has a measurement the database will not connect successfully to grafana unless at least one measurement is in the database to confirm if the database has a measurement, navigate to datahub > db management and click the arrow to expand the tsdata database if there are no measurements listed, follow the steps below step 2a connect device follow the steps to connect a device docid\ ish7bqhzxswtdx8vbnszb and do the following select the device type simulator and the driver name generator select the enable data store check box in the device configuration enter a value in the retention hours field step 2b add tag to device follow the steps to add tags docid\ xgwokqbtpevii7or82ll0 and add at least one tag to the device you created after connecting the device and adding the tag, navigate to datahub > db management and click the arrow to expand the tsdata database again to confirm a measurement is now available step 4 add a data source in grafana you will need to add a data source in grafana that connects to the database you created see the influx data source documentation from grafana to learn more when configuring the data source, do the following select the influxdb time series database in the url field, enter http //10 30 50 1 8086 10 30 50 1 is the ip address of litmus edge on the internal docker network by default in the database field, enter tsdata in the user field, enter the username you configured for the db user in litmus edge in the password field, paste or enter the password you configured for the db user in litmus edge step 5 add a dashboard in grafana now that the database is successfully connected to grafana, you can start visualizing the data by using a dashboard see the create a dashboard documentation from grafana to learn more