Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Displaying dynamic metric values on the map. #95

Open
daarunraj opened this issue Dec 2, 2019 · 3 comments
Open

Displaying dynamic metric values on the map. #95

daarunraj opened this issue Dec 2, 2019 · 3 comments

Comments

@daarunraj
Copy link

I am able to mark the routers on the map and the link between them using the map source (json editor) option. I am trying to display the dynamic values(input rate) fetched from metric query on the map using legend when hovered over the link. But unable to find a way to do so. I tried passing the value in json editor, but couldn't get to see that on the map. Looking for help on displaying the dynamic values on the map. Thanks in advance.
The metric query and legend used is:
metric: ifHCInOctets
legend: ipRate

Below is the json in the map source for marking the routers and link.
{
"results": [
{
"links": [
{
"path": [
{
"lon": "-150.991531",
"lat": "40.742043"
},
{
"lon": "-150.991531",
"lat": "70.742043"
}

			],
			"name": "Interface 1",
                             "current": "100 Kbps"
			
		}
	],
	"endpoints": [
    {
      "pop_id": null,
      "lon": "-150.991531",
      "real_lon": null,
      "real_lat": null,
      "name": "DEN B",
      "lat": "40.742043"
    },
	{
      "pop_id": null,
      "lon": "-150.991531",
      "real_lon": null,
      "real_lat": null,
      "name": "DEN A",
      "lat": "70.742043"
    }
  ]
}

]
}

@sreemukha
Copy link
Contributor

Please follow this link for an example map source.

Please note that results.links.endpoints should be specified to associate data with each link.

@daarunraj
Copy link
Author

Currently we are using Prometheus as datasource. Is it mandatory to use GlobalNOC TSDS Datasource for Network map or can we use Prometheus datsource?

How can we map data from datsource to network map through json editor?
We are trying to add the results.links.endpoints in our json editor but still we are unable to get the dynamic values on the map. We had checked link given above for reference given to results.links.endpoints. Can you please explain how to use results.links.endpoints in the below example.

Example:
{
"results": [
{
"links": [
{
"path": [
{
"lon": "-104.991531",
"order": "50",
"lat": "40.742043"
},
{
"lon": "-108.991531",
"order": "50",
"lat": "40.742043"
},
{
"lon": "-104.991531",
"order": "10",
"lat": "37.742043"
}
],
"name": "Link1"
}
],
"endpoints": [
{
"pop_id": null,
"lon": "-118.243683",
"real_lon": null,
"real_lat": null,
"name": "Endpt1",
"lat": "34.052235"
},
{
"pop_id": null,
"lon": "-104.991531",
"real_lon": null,
"real_lat": null,
"name": "Endpt2",
"lat": "40.742043"
},
{
"pop_id": null,
"lon": "-104.991531",
"real_lon": null,
"real_lat": null,
"name": "Endpt3",
"lat": "37.742043"
}
]
}
]
}

@daldoyle
Copy link
Contributor

daldoyle commented Feb 5, 2020

As far as I've tested you can use any datasource. Grafana mandates a standard for what the data looks like so it shouldn't matter.

Eyeballing your JSON shown below, it looks like you're mixing up the results.endpoints with the results.links.endpoints, admittedly a bit of a name overload. The results.links.endpoints is used to control the association of data onto the map. You can see this in the README example. The name attribute is what matches a target coming out of the datasource, if that makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants