This content originally appeared on Level Up Coding - Medium and was authored by Nidhin kumar
Grafana Excel Report Download (Part 1)

If you don’t have time to read but want to know what’s there in this post. Find the quick read 👇

In Grafana OSS(Open Source) we can’t download the reports in PDF or Excel format. but there are few plugins available for PDF which would take a snapshot of the panels.
But to download the report as excel we don’t have any option all we have is to download panel data as CSV.
Today, we are going to see how to download the data collected by InfluxDB as an excel report in Grafana using NodeJS.

What we are going to do
In this series, we will see how to download the system metrics data which is stored in InfluxDB from Grafana using the NodeJS application.

- Create a telegraf configuration to collect system metrics
- Run the telegraf agent to send system metrics
- Create a Dashboard in Grafana for system metrics using InfluxDB as a data source
- Create a NodeJS application to collect system metrics from InfluxDB using client libraries
- Create the Excel report using the collected metrics
- Configure Grafana to download the report
What we are going to do in Part 1
In this part, we will see how to
- Create a telegraf configuration to collect the system metrics
- Run the telegraf agent to send system metrics
- Create a Dashboard in Grafana for system metrics using InfluxDB as a data source

1. Create a telegraf configuration to collect system metrics
Before starting make sure you have telegraf installed in your system as well as InfluxDB running.If not kindly look at the above articles 👆.
Open InfluxDB and then click Data ➡️ Telegraf you could see a page like below

Click Create Configuration and then select the bucket from the dropdown menu to which the metrics need to store.

Once the metric is selected click Continue and then you could receive a token like below (Copy it will use it later)

Once the Token is copied click Finish and then download the configuration

Congrats on completing 1️⃣st milestone 👏 in this part

Just take a quick break to know about Telegraf 👇

2. Run the telegraf agent to send system metrics
Once the configuration file is downloaded paste the InfluxDB token which you have copied earlier into telegraf.conf or you can export it is as an InfluxToken also. Once the token is added start the telegraf service and then use the following command to run telegraf like below
telegraf --config path-of-your-telegraf.conf

Once you run the telegraf agent you could see an output like below

Congrats on completing the 2️⃣nd milestone 👏

Just take a quick break to know about Grafana 👇

3. Create a Dashboard in Grafana for system metrics using InfluxDB as a data source

Once you have installed Grafana and started the Grafana instance in your machine. Open your browser and type localhost:3000 you could see the login page of Grafana like below

If you log in for the first time then the username and password is admin and admin.If not log in with the credentials you have set earlier.
Now click on Settings ➡️ Datasource like below

Now Click Datasource ➡️ Add data source and type InfluxDB like below

Now click InfluxDB and fill in the details like below 👇

Now click Save & Test where you could see a result like below

Now you have successfully connected with InfluxDB.Now we will create the dashboard for system metrics
Click on the ‘+’ icon to import a new dashboard.

Now copy the JSON 👇

Once you have copied the JSON paste the code into Grafana and click Load

Once you click the Load button select the folder in which you want to save the dashboard like below

Once you import the dashboard you could see some errors in the dashboard 😨. Don’t get freaked out just click the Dashboard settings

and then select Variables and click the hostname

Change the hostname to the one which you have seen in your InfluxDB and then click update

Make sure the default dashbaord is InfluxDB
Once it is done you could see the dashboard like 👇

Congrats on completing the 3️⃣rd milestone 👏

Congratulations 🏆
You have completed Part 1️⃣ milestones. Get ready for the Part 2 milestone. Till then Happy Learning 😄
Grafana Excel Report Download — Part1 was originally published in Level Up Coding on Medium, where people are continuing the conversation by highlighting and responding to this story.
This content originally appeared on Level Up Coding - Medium and was authored by Nidhin kumar

Nidhin kumar | Sciencx (2021-10-28T02:29:52+00:00) Grafana Excel Report Download — Part1. Retrieved from https://www.scien.cx/2021/10/28/grafana-excel-report-download%e2%80%8a-%e2%80%8apart1/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.