chendu
chendu

Reputation: 829

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?

Upvotes: 2

Views: 7365

Answers (2)

mahmoud alorfaly
mahmoud alorfaly

Reputation: 51

You have 1-Graph Node Panel 2-Graph Node API

The API is needed an an example only to show how you can feed data. You can also use a normal Database. Create two tables one for nodes and other for edges. table columns should be as the API documentation. Then formulate two queries while you create you panel same way for each nodes and edges tables. Graph Node Panel will be able to form the graph using this approach.

Upvotes: 0

Mac
Mac

Reputation: 517

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

Upvotes: 3

Related Questions