Search code examples
grafana

Working example of Grafana integrated with a custom API to display Node Graph


I am trying to generate a directed node graph using Grafana (latest). I hardly see any tutorials anywhere.

I can expose an API which reads JSON data from disk and gives it to Grafana which can display the graph. I don't know how the JSON should look like so that Grafana can print the node graph. There is hardly any help on this on Google. I have tried to use d3js; but it's learning curve is very high and I can't get something working quickly.

Are there any tutorials or samples with Grafana integrated with some custom API to generate node graph?


Solution

  • Have you looked at the following links?

    1. Node Graph documentation - https://grafana.com/docs/grafana/latest/visualizations/node-graph/#data-api

    2. Datasource which can connect to your REST APIs and convert into whatever node graph likes - https://github.com/hoptical/nodegraph-api-plugin

    3. See Query inspector for the following test data source enter image description here

    Here is how I could create a simple node graph using testDataDB csv content data source -

    enter image description here

    It will be displayed as follows -

    enter image description here