Grafana with Jira

Jérôme Brandt February 19, 2019

Hi,

Does it possible to use Grafana with Jira ?

 

I would like to get some statistics (number of issues and so on... ) in Grafana.

 

I try with plugin "SimpleJSON" and REST API Jira but it doesn't work...

 

 

4 answers

1 vote
Mike Frank March 8, 2019

We had the same struggles and never found a solution so I built one. You can use this project to accomplish what you need; https://github.com/bluefrg/jira-grafana-json-datasource

nimmakayala rameshnaidu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 26, 2019

Hi Mike,

The reference is good,but when I try to validate (http://localhost:3000/test-jira) it returns Unauthorized (401) and when I run docker-compose.yml it returns

ERROR: for jira-grafana Cannot start service jira-grafana: driver failed programming external connectivity on endpoint jira-grafana-json-datasource-master_jira-grafana_1 (b8c1646130d2e5a850575dd5c1570a7e5bd570238236a7b835045c469dfd82f1): Bind for 0.0.0.0:3000 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.

Mike Frank December 26, 2019

Hey nimmakayala!

You must have something already using port 3000 on your computer as the error is stating that, it's a common port for many other Docker projects using HTTP;

Bind for 0.0.0.0:3000 failed: port is already allocated

nimmakayala rameshnaidu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 2, 2020

It's working thank you Mike

lbest
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 20, 2020

Is this a common error? I've tried both dev and prod Dockerfiles

 

jira-grafana_1 |
jira-grafana_1 | > jira-grafana-json-datasource@1.0.0 start /app
jira-grafana_1 | > node server.js
jira-grafana_1 |
jira-grafana_1 | internal/modules/cjs/loader.js:584
jira-grafana_1 | throw err;
jira-grafana_1 | ^
jira-grafana_1 |
jira-grafana_1 | Error: Cannot find module 'express'
jira-grafana_1 | at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
jira-grafana_1 | at Function.Module._load (internal/modules/cjs/loader.js:508:25)
jira-grafana_1 | at Module.require (internal/modules/cjs/loader.js:637:17)
jira-grafana_1 | at require (internal/modules/cjs/helpers.js:22:18)
jira-grafana_1 | at Object.<anonymous> (/app/server.js:1:79)
jira-grafana_1 | at Module._compile (internal/modules/cjs/loader.js:701:30)
jira-grafana_1 | at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
jira-grafana_1 | at Module.load (internal/modules/cjs/loader.js:600:32)
jira-grafana_1 | at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
jira-grafana_1 | at Function.Module._load (internal/modules/cjs/loader.js:531:3)
jira-grafana_1 | npm ERR! code ELIFECYCLE
jira-grafana_1 | npm ERR! errno 1
jira-grafana_1 | npm ERR! jira-grafana-json-datasource@1.0.0 start: `node server.js`
jira-grafana_1 | npm ERR! Exit status 1
jira-grafana_1 | npm ERR!
jira-grafana_1 | npm ERR! Failed at the jira-grafana-json-datasource@1.0.0 start script.
jira-grafana_1 | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
jira-grafana_1 | npm WARN Local package.json exists, but node_modules missing, did you mean to install?
jira-grafana_1 |
jira-grafana_1 | npm ERR! A complete log of this run can be found in:
jira-grafana_1 | npm ERR! /root/.npm/_logs/2020-02-20T19_55_04_953Z-debug.log
jiragrafanajsondatasource_jira-grafana_1 exited with code 1

Patrick Struckmann
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 29, 2020

Hello. 

 

I've been trying to get your solution to work. But metrics in grafana doesn't come up. It just says "Bad Gateway" when i use query inspector. 

 

BadGateway.PNG

When I try the localhost it seems to work fine:

 

LocalHo.PNG

Michał Kucharski
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 15, 2020

Ok if I got everything properly configured and working... how can I fetch or do queries ? sorry for noob question.

Linh Chu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 3, 2021

Hi  @Mike Frank what version of the Grafana and the plugin you are using. I'm using Grafana 7.2.2 and plugin 1.4.1. All I get when i try to create a dashboard with timeseries is a drop-down list with XML format :( 

Mike Frank March 3, 2021

I have Grafana 7.3.4 with SimpleJson 1.4.1 and no issues. 

This will not work for self-hosted JIRA instances.

1 vote
Huwen Arnone _Deiser_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
February 19, 2019
Jérôme Brandt February 19, 2019

Thanks, but not really...

With this, you monitor the JVM and i want to have more statistics with REST and JQL.

Like # people like this
Aayushi Malaviya October 18, 2022

Hi @Jérôme Brandt,

Any update on your findings for exploring Jira Metrics with REST and JQL?

Also any idea how can I visualize it in Grafana?

0 votes
Benjamin Falque May 12, 2023

Hello,

You can do it by using Json API grafana plugin: https://grafana.com/grafana/plugins/marcusolsson-json-datasource/ 

Then you just need to create a datasource with URL : 


https://<your jsm url>.atlassian.net/rest/api/2/search

 

For authentication we have usedBasic Auth

login :  your email

password : your Api token

Add header: 

Content-Type: application/json

 

Once this is done you can create your dashboard.

Kotipalli Sriram
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 3, 2023

Hi Benjamin, thank you for much for the response. I tried integrating Jira with json api but getting below error.

JSON API:  Gateway Timeout

Can you help me out here

I used basic auth as Suggested.

Thanks !!

0 votes
Gabe Kressel April 23, 2021

I'd like to recommend you to export Jira data to Grafana using Skyvia online data platform (https://skyvia.com/data-integration/analyze-jira-with-grafana). It allows you to load necessary data from Jira to Grafana through a database or a cloud data warehouse of your choice. Using this tool you'll be able to do it automatically, without any coding.

By the way, Skyvia is Jira's partner. You can find them on the Atlassian marketplace.

Aayushi Malaviya October 18, 2022

Hi @Gabe Kressel

Thank you for the suggestion.

Could we get an alternative that is free of cost?

Suggest an answer

Log in or Sign up to answer