BLOG

Building a ServiceNow Grafana Plugin

Share on facebook
Facebook
Share on linkedin
LinkedIn
Share on twitter
Twitter
Share on email
Email

Grafana is a very powerful, as well as open-source visualization tool, and it is perfect for what we need. With Grafana we were able to produce a visually appealing way of displaying useful data to users. 

Grafana is a very powerful, as well as open-source visualization tool, and it is perfect for what we need. With Grafana we were able to produce a visually appealing way of displaying useful data to users.

  • Visualize ServiceNow Service Model
  • Filter metrics and alerts based on individual Configuration Items (CIs) and Business Services
  • Show baseline metrics
  • Drill down to impacted CIs
  • Provide out of the box domain/technology dashboards
  • View Change and incidents data

Service Visibility Dashboard

Drill down from Ci in the application map – again ALL data is from Servicenow.

ServiceNow Datasource Plugin

We chose ServiceNow because it has a great existing platform. Our goal was to provide an observability solution using alerts, incidents, metrics and changes from ServiceNow ITOM. To do this we Developed a Grafana Datasource plugin that queries the ServiceNow API and returns the data in a way that is usable by the visualization. All of the data in the dashboard is coming from ServiceNow. 

Topology Visualization Plugin

To cover the service model visibility, we began our development by looking for any existing plugins that produced a topology. We found an open-source plugin that was supposed to be used for visualizing application performance. https://github.com/NovatecConsulting/novatec-service-dependency-graph-panel 

 It wasn’t quite what we needed but we could modify it to suit our requirements. With our starting point set we began work on reverse engineering and modifying the plugin to suit our needs.  

We had a good starting point with the service dependency plugin but we needed to make some changes. Our requirements to make the plugin usable were: 

  1. Ability to set custom icons for each CI node
  2. Display CIs full name next to the CI node
  3. Change appearance of CI node to be fully red if there is an alert
  4. Remove un-needed fields and labels
  5. Rework pop out menu to not obscure topology

 

With the help of our technical team, we were able to meet all of our requirements, and are able to easily visualize and interpret data coming from ServiceNow.

Learning

TypeScript

Prior to beginning development on this plugin, I had no knowledge of TypeScript. While very similar to JavaScript it has some key differences. Static types being one of the main differences, as well as the use of interfaces and optional parameters for functions. Transitioning from JavaScript to TypeScript at points was quite frustrating, but still a very good learning experience.  

Grafana

Grafana is a very powerful open-source tool, with a lot of possibilities to create something great. One of the biggest issues I had when using Grafana is an overall lack of documentation. Being more niche I wasn’t able to just look up solutions either. I had to learn to get good at reading other people’s code in already working plugins.