Grafana Node Graph Property Not Visible

This is Below Node Graph Data With MSSQL DB

This is Below Edge Graph Data With MSSQL DB

This is Currently showing Node Graph and title this type But Not showing anther property values and styling which I have mentioned in database like subtitle, cpu, memory, c_disk_size, d, c_disk_size color, d_color on node

and Hover of Edge mainStat and secondaryStat is not visible

Here Is my configuration in Node and Edge

This is for reference of what I want It to look like

And Version is @10.2.3

Hello, you can change the MS SQL query for node from current to this:
SELECT TOP (1000) [id] as id
,[title] as title
,[sub_title] as subTitle
,[cpu] as mainStat
,[memory] as SecondaryStat
,[c_disk_size] as arc__cpu
,[d] as arc__memory
,[c_disk_size_color] as arc__cpu_color
,[d_color] as arc__memory_color
,[detail]
FROM [Users].[dbo].[Servers]

and edge query from current to this:
SELECT TOP (1000) [id]
,[source]
,[target]
,[main_stat] as mainStat
,[secondary_stat] as secondaryStat
,[detail_one] as detail__1
FROM [Users].[dbo].[Edge]

Now, after applying the above-mentioned two queries, you will be able to see data on the Grafana node graph, but the color will still not be there.

To set the color, you can see the panel option available on the right-hand side of the grafana panel, and here you can see the nodes section. Here, one arc section will be there, and just below it, one add arc button. Click on this button and then select the arc__cpu option and assign color to it. Now click on the below-situated add arc button and select the arc__memory section. This should solve your issue regarding data not being visible and arc colors not being visible.

2 Likes

Thank you so much to solve my problem. :slightly_smiling_face:

Now it’s working.

Hi @henilvaland @shahnawazvhora7333, I am new to Grafana and had a query : Can we use JSON data format to configure a Node Graph in Grafana ?

For example can we use something like this :

[
    {
        "fields": [
            {
                "name": "id",
                "type": "string",
                "config": {
                    "links": [
                        {
                            "title": "test data link",
                            "url": "",
                            "internal": {
                                "query": {
                                    "scenarioId": "logs",
                                    "alias": "from service graph",
                                    "stringInput": "tes"
                                },
                                "datasourceUid": "gdev-testdata",
                                "datasourceName": "gdev-testdata"
                            }
                        }
                    ]
                },
                "values": [
                    "root",
                    "service:1",
                    "service:2",
                    "service:3",
                    "service:4",
                    "service:5",
                    "service:6",
                    "service:7",
                    "service:8",
                    "service:9"
                ]
            },
            {
                "name": "mainstat",
                "type": "number",
                "config": {
                    "displayName": "Transactions per second"
                },
                "values": [
                    0.5269084489952305,
                    0.3186172070712774,
                    0.0217189888767102,
                    0.23881712564156032,
                    0.8115396296859896,
                    0.9600485890145185,
                    0.8605002419520664,
                    0.6896544605115285,
                    0.7066672691468294,
                    0.9905411582046693
                ]
            },
            {
                "name": "secondarystat",
                "type": "number",
                "config": {
                    "displayName": "Average duration"
                },
                "values": [
                    0.5360624488395105,
                    0.8088904153561247,
                    0.3949131736355005,
                    0.40714005398818776,
                    0.9925655948029481,
                    0.8141737809302889,
                    0.35716677938480146,
                    0.18012858235383256,
                    0.7106872573185647,
                    0.2455825750261207
                ]
            },
            {
                "name": "arc__success",
                "type": "number",
                "config": {
                    "color": {
                        "fixedColor": "green",
                        "mode": "fixed"
                    },
                    "displayName": "Success"
                },
                "values": [
                    1,
                    0.009825831912042116,
                    0.6809865086881657,
                    0.02142287422487632,
                    0.5066214145905183,
                    0.5801643496033606,
                    0.6150000368161581,
                    0.561365727033396,
                    0.8082503303402178,
                    0.2160674573708321
                ]
            },
            {
                "name": "arc__errors",
                "type": "number",
                "config": {
                    "color": {
                        "fixedColor": "red",
                        "mode": "fixed"
                    },
                    "displayName": "Errors"
                },
                "values": [
                    0,
                    0.9901741680879579,
                    0.3190134913118343,
                    0.9785771257751237,
                    0.49337858540948165,
                    0.4198356503966394,
                    0.3849999631838419,
                    0.43863427296660396,
                    0.19174966965978224,
                    0.7839325426291679
                ]
            }
        ],
        "meta": {
            "preferredVisualisationType": "nodeGraph"
        },
        "name": "nodes"
    },
    {
        "name": "edges",
        "fields": [
            {
                "name": "id",
                "values": [
                    "root--service:1",
                    "root--service:2",
                    "root--service:4",
                    "root--service:6",
                    "service:1--service:3",
                    "service:2--service:5",
                    "service:2--service:7",
                    "service:3--service:1",
                    "service:4--service:6",
                    "service:5--service:7",
                    "service:5--service:8",
                    "service:6--service:9",
                    "service:6--service:2"
                ],
                "type": "string",
                "state": null
            },
            {
                "name": "source",
                "values": [
                    "root",
                    "root",
                    "root",
                    "root",
                    "service:1",
                    "service:2",
                    "service:2",
                    "service:3",
                    "service:4",
                    "service:5",
                    "service:5",
                    "service:6",
                    "service:6"
                ],
                "type": "string",
                "config": {},
                "state": null
            },
            {
                "name": "target",
                "values": [
                    "service:1",
                    "service:2",
                    "service:4",
                    "service:6",
                    "service:3",
                    "service:5",
                    "service:7",
                    "service:1",
                    "service:6",
                    "service:7",
                    "service:8",
                    "service:9",
                    "service:2"
                ],
                "type": "string",
                "config": {},
                "state": null
            }
        ],
        "meta": {
            "preferredVisualisationType": "nodeGraph"
        },
        "length": 13
    }
]

And also, if I want to use SQL then, how will we storing things like config.displayName in the table ?

Also please provide any resources (if you have) for configuring advanced properties of nodes like color, displayName, etc.

Thanks !!

Hey @sahayyash9
Sorry for late replay, I am little bit busy now.

to store data like config.displayName in table that i haven’t tried to store in sql tables but i think there might be some way to store and to give answer of your first question we can not use json data with existing database but we can surely bind CSV data using infinity database which you can find in add connection section and from here you might be able to bind JSON as well(not 100% sure) with infinity, with use of sql if you are able to add config.displayName then it is surely possible to add data it in grafana.

I hope this helps.

Hey @shahnawazvhora7333
Thanks for the response.

I don’t find it possible to set properties like “displayName” using a SQL datasource. But I found a plugin : Nodegraph API Datasource Plugin which let’s us consume an API as a datasource for Grafana Node graph. This plugin lets us set properties like displayName, arc__color.

Thanks again !!

Hello,

I’ve troubles so to use my MSSQL databases for node graph (edges and nodes)
If I use only the query for nodes it works.
If I use only the query for edges it works.

but if I’ve enabled both queries in grafana node graph I get an error with the message "Cannot read properties of undefined (reading ‘nodeRadius’) within a red triangle.

Here is how my DB tables look like (only for testing - the productive database structure is the same):

CREATE TABLE TEST_edge
(
	[edgeid] [nvarchar](75)  PRIMARY KEY NOT NULL,
	[source] [nvarchar](45) NOT NULL,
	[target] [nvarchar](45) NOT NULL
)

CREATE TABLE TEST_node
(
	[nodeid] [nvarchar](75) PRIMARY KEY NOT NULL,
	[name] [nvarchar](75) NOT NULL,
	[subname] [varchar](75) NULL
)
SELECT TOP (1000) [nodeid] as id
,[name] as title
,[subname] as subTitle
FROM [dbo].TEST_node

SELECT TOP (1000) [edgeid]
,[source]
,[target]
FROM [dbo].[TEST_edge]

image

These is my configuration of my grafana panel:

what are the requirements for an MS SQL database for Grafana Node Graph?

what is missing from my considerations or what am I doing wrong?

thx for advise
juergen

please provide your data not as pictures but as usable text data ie

id,title,subTitle
1,'A','subA'

fill in the rest

|id|title|subTitle|
|---|---|---|
|1|A|subA|
|2|B|subB|
|3|C|subC|
|4|D|subD|
|5|E|subE|

|edgeid|source|target|
|---|---|---|
|AB|A|B|
|BE|B|E|
|DB|D|B|
Grafana:
edges
SELECT distinct edgeid AS "id", TRIM(source) AS "source", TRIM(target) AS "target" FROM eol_erfassung.dbo.TEST_edge

nodes:
SELECT nodeid AS "id", name AS "title", subname AS "subTitle" FROM eol_erfassung.dbo.[TEST_nodetable]

each of the queries in grafana works for its own.
nodes:
image

edges:
image

well your source and target are referencing the wrong values

edges

select 'AB' as id, 1 as source, 2 as target union
select 'BE' as id, 2 as source, 5 as target union
select 'DB' as id, 4 as source, 2 as target

source and target should reference id of nodes

2 Likes

thx, was my fault.
I wanted to reproduce my problem from the production environment and imported the wrong values in edges.
my test works now. now I will focus on my production database.

2 Likes