Giter VIP home page Giter VIP logo

snow-grafana-proxy's Introduction

snow-grafana-proxy

Connections schema

This is a proxy-like service translating grafana simplejson data source calls into calls to ServiceNow REST API getting the items from incident table. Effectively allowing allowing integration of grafana dashboard with ServiceNow.

Configuration file is preatty self-explanatory. You just have to give the details like your ServiceNow instance URL, user and password allowed to access ServiceNow API and configure queries you'd like to make available for grafana. If you want you can find some "explanation" of those options on my blog post: https://funinit.wordpress.com/2018/07/20/integration-for-servicenow-table-api-and-grafana/

If you'd like to learn more about 1st version of snow-grafana-proxy you can check my blog post: https://funinit.wordpress.com/2018/02/20/simple-integration-of-servicenow-and-grafana/

Runtime options

snow-grafana-proxy.py accepts two options, as explained by help:

usage: snow-grafana-proxy.py [-h] [-c CONFIGFILE] [-d]

Simple JSON data source for grafana retreving data from service-now

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIGFILE, --configFile CONFIGFILE
                        Configuration file to use
  -d, --debug           Start in foreground and print all logs to stdout

Configuration file

Current configuration file schema is in YAML format with two basic dictionaries: "service" and "service-now". In service dictionary you define parameters of your snow-grafana-proxy service like address to bind, port, log level and file to log output. In "service-now" section we have basic parameters like service-now instance address, api user and password for simple authntication and queries dictionary.

Queries configuration

Each query will appear as separate option available under metrics configuration in grafana(remember to pick table time, not timeseries from the first list). Query will use service-now table API to get the information from configured table, using value of a snowFilter option as an argument allowing to filter results on snow side. snow-grafana-proxy will forward to grafana only parameters listed in attributes list. For some attributes to make them more meaning ful there is a need to use an interpreter, currently supported interpreters are:

none

Simply return value of attribute specified as in "name" argumnet.

map

Use map disctionary defined or attribute and send corresponding values assuming that service-now returned value is a key for map dictionary,

object_attr_by_link

Assumes that for this attribute service-now API returns value/link pair. In this case additional lookup to link is required to get really meaningful data. This interpreter requires additional parameters specified in interpreterParameters dictionary, for instance: interpreterParams: { linkAttribute: "name", default: "FailedToGetName"} will get the value of name returned from the link from previous call in case of failure returning the value "FailedToGetName". Default value is important since sometimes the value is realy undefined - like assignemnt group for un assigned incident.

Changelog

22-08-2018 Merge of aws-lambda "subproject"

17-07-2018 beta release of second version commited. It allows much more flexible configuration, getting data from any service-now table and arbitrary set of attributes.

15-03-2018 Use logging instead of dirty print.

20-02-2018 Initial working version.

snow-grafana-proxy's People

Contributors

cinek810 avatar

Watchers

Christian avatar

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.