Git Product home page Git Product logo

jira-grafana-json-datasource's Introduction

Jira Grafana JSON Datasource Plugin

Connect Grafana to Jira Cloud to retrieve metrics on your Jira issues.

The original intention for this project was to allow me to show a singlestat count of open issues for my team's Jira Service Desk.

Example

Requirements

This project only requires your Grafana instance to have the SimpleJson plugin installed.

Installation

Run the Docker container (replace environment variables with your Jira Cloud credentials):

$ docker run -d -p 3000:3000 --name jira-grafana -e JIRA_HOST=myjira.atlassian.net -e [email protected] -e JIRA_PASS=XXXX bluefrg/jira-grafana-json-datasource

Confirm running by visiting: http://localhost:3000

Note: This project has only been tested locally, and as a ECS task using Jira Cloud. Jira On-Prem is not supported by the dependencies used in this project.

Atlassian credentials

It's recommended to use API tokens from your Atlassian API token page for authentication instead of your primary account username and password.

Testing Jira connection

You can validate the connection to Jira is authenticating properly by visiting the test-jira endpoint at: http://localhost:3000/test-jira

A successful authentication will return the current user, a failure will return the HTTP response and detailed error message from Jira.

docker-compose.yml

The docker-compose is included as an example of how to test Grafana and the Jira Grafana JSON Datasource integration. Not intended for production use.

Setup

To add this as a data source in Grafana, go to Configuration -> Data Sources and click Add. For the Type choose SimpleJson. Enter the root URL for this project (e.g. http://localhost:3000).

When adding a panel to a dashboard, choose the newly created data source. Under the metrics tab, you will see your Jira filters as an option to plot on your panel.

Example

Authentication

You can require authentication by adding a HTTP_USER and HTTP_PASS environment variable.

You will need to reconfigure your data source to use "Basic Auth".

License

This project is licensed under the MIT license. See the LICENSE file for more info.

jira-grafana-json-datasource's People

Contributors

bluefrg avatar camjc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jira-grafana-json-datasource's Issues

Error: Cannot find module 'express'

jira-grafana_1 |

jira-grafana_1 | > [email protected] 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. (/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! [email protected] 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 [email protected] 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/2022-03-07T16_02_03_957Z-debug.log

jira-grafana-json-datasource_jira-grafana_1 exited with code 1

not working

Hello bluefrg,

I am new on board and can't start your code. What do I have to adjust to make it work?
node server.js is not working

Add OAuth

Most Jira installation use OAuth, so it would be great if OAuth is available as an option

The value 'undefined' does not exist for the field 'filter'

Hello!

Thank you for sharing this project! It looks promising, but when attempting to use it calls to /test-jira appear to succeed, then when configuring a Grafana panel to use the datasource, I see errors like the following:

(node:24) UnhandledPromiseRejectionWarning: {
  "statusCode": 400,
  "body": {
    "errorMessages": [
      "The value 'undefined' does not exist for the field 'filter'."
    ],
...
  "request": {
    "uri": {
      "hostname": "JIRA.EXAMPLE.COM",
      "pathname": "/rest/api/2/search",

Current Jira version is 7.3.8. Might this project be expected to work with that version?

Problems integrating with Grafana

Screenshot 2019-03-26 at 17 41 13
After adding SimpleJson as datasource & specifying URL ( I verified the test-jira url works correctly ) I cannot see the predefined jira filters. Timeserie dropdown is empty.
grafana used is 6.0.2

Any ideas what is wrong ?

Cannot run Docker Container

Hello,

I cannot run the docker container and I don't know why.

Unable to find image 'bluefrg/jira-grafana-json-datasource:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on .... no such host.
See 'docker run --help'.

Grafana was installed

How can I do It in Grafana already installed?
I think that I need just the plugin, right?

No Data

Hi there,

I just plugged my Jira-Cloud for test, the test-jira return a json with some informations .
But actually it returns "No Data" ...
I can see only my projects in "select metric", but no more data are returned...

Can you help me ?

Metrics are not showing

Hello bluefrg,
first of all I want to thank you for your wonderful work and sharing your Project.
I currently got the Problem, that when I want to select a metric, there is nothing to choose.
The /jira-test is working fine for me.
I'm using the jira cloud version and my current Grafana version is Grafana v7.0.3.
Thank you very much and have a wonderful day =).
Github_Jira

thoughts about Jira Server api?

Hey,
Im not into programming, but i figured out, that its not possible to "GET" the "/rest/api/2/filter"'s in Jira Server (on-prem). Do you have any ideas, how to do this?

The only way to "GET" filters is by ".../filter/{id}" or by ".../filter/favourite" documented here

No Data

Hi, the docker image works fine, API works good, no errors. I have zero data available. Does this thing work?

Grafana not working

I set up the envoirement with Docker v19.03.13 and my container is running on localhols:3000 . The grafana app should reachable but I get just following message:

Mon Oct 05 2020 12:37:30 GMT+0000 (Coordinated Universal Time): OK

I don't see the GUI of grafana.

How can I make run grafana correctly?

502 as DS response.

Thanks for creating this plugin!

I 've installed and tested the plugin (can see my user info)
then after setting up the DS in Grafana, I get no info or metrics in the panel..

This is what I get
data:""
status:502
statusText:"Bad Gateway"
xhrStatus:"complete"
request:Object
method:"POST"
url:"api/datasources/proxy/1/search"
data:Object
target:""
withCredentials:undefined

as a response.

Help?

Thanks!
Brian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.