DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • View Test Results in Grafana - Part 2
  • Modern Test Automation With AI (LLM) and Playwright MCP
  • AI-Driven Test Automation Techniques for Multimodal Systems
  • Debugging With Confidence in the Age of Observability-First Systems

Trending

  • How to Merge HTML Documents in Java
  • Agile’s Quarter-Century Crisis
  • Metrics at a Glance for Production Clusters
  • Next Evolution in Integration: Architecting With Intent Using Model Context Protocol
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Monitoring and Observability
  4. View Test Results in Grafana - Part 1

View Test Results in Grafana - Part 1

In this article, see how to setup Grafana and InfluxDB to store and view test reports

By 
Gowthamraj Palani user avatar
Gowthamraj Palani
·
Jun. 05, 20 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
6.1K Views

Join the DZone community and get the full member experience.

Join For Free

A good test framework should have a proper reporting mechanism to view and analyze test results. The results should also be sharable. There are many ways to achieve them like test-reports, test execution logs, external plugins. In this article and the next article, we are going to see about a different approach in test reporting. Ever thought of uploading the results into database and view them in a graphical manner in Grafana? Let's see how to achieve this in this series.

Grafana 

Grafana is an open-source tool for data-analytics, view data-metrics, and monitoring apps. Data sources for Grafana can be variety of DataBases like MySQL, Postgres, InfluxDB, Graphite, etc. We are going to use InfluxDB as a data source for our application.

Influx DB Setup (Mac)

Let's see how to setup the DB in a mac machine. For setup in other OS, check here.  Bring the influxDB running by running below set of commands 

Shell
 
xxxxxxxxxx
1
 
1
brew install influxdb
2
brew services start influxdb
3
influxd


If you face any issues, while running any of the commands, check influxdb.conf and change the port settings and run like below.

Shell
xxxxxxxxxx
1
 
1
influxd -config "path to influxdb.conf"
2
ex.
3
influxd -config /usr/local/etc/influxdb.conf


Make sure InfluxDB is started and is displaying logs. 

InfluxDB displaying logs

Create Database

Once the db is running, next we need to create a database to store our results. Create it using the below "create" command. 

"Show Databases" command will list the databases. Verify the db that you created is listed. 

More about InfluxDB here.

Shell
xxxxxxxxxx
1
 
1
create database <db_name>;
2
SHOW DATABASES


Creating database

Install Grafana (Mac)

After your db is ready, the next step is to install Grafana and setup the datasource. Install Grafana using the below commands.

Shell
 
xxxxxxxxxx
1
 
1
brew install grafana
2
brew services start grafana


Once it is successfully started, launch Grafana using http://localhost:3000/.

Add Data-Source

After you can see the welcome screen of Grafana, click on create a data-source or click on configuration menu from the left pane. Now choose "InfluxDB" from the option.

Selecting InfluxDB

Give the below details in the form displayed.
URL: http://localhost:8086

Database: <database name>

User: root

Password: root

Test and save the connection.


Testing and saving connection


Testing and saving connection

That's it! Both Grafana and InfluxDB are ready to store and display the test-results.

In the next article in this series, we will see about how to how to achieve this with a simple test framework using TestNG. The sample code is here. 

Happy Reading!!

Grafana Testing

Opinions expressed by DZone contributors are their own.

Related

  • View Test Results in Grafana - Part 2
  • Modern Test Automation With AI (LLM) and Playwright MCP
  • AI-Driven Test Automation Techniques for Multimodal Systems
  • Debugging With Confidence in the Age of Observability-First Systems

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!