pyrra icon indicating copy to clipboard operation
pyrra copied to clipboard

feat add Grafana explorer integration with pyrra UI

Open cifuab opened this issue 1 year ago • 9 comments

Hi guys recently we start to use pyrra, with grafana mimir .

It possible configure prometheusExternalUrl to use grafana explorer instead of the prometheus dashboard for see queries directly in grafana?

image

cifuab avatar Jun 09 '23 11:06 cifuab

I guess you could theoretically set the URL to Grafana Explore, I'm pretty sure the URL's query params are quite different. We would need to figure out some sort of standard Grafana Explore has to be able to properly build the URL.

metalmatze avatar Jun 12 '23 17:06 metalmatze

May be the Grafana SDK has some methods to build the URL properly. We could make a bit of research on this regard

achetronic avatar Jun 15 '23 08:06 achetronic

you can do this

https://grafana.foobar.com/explore?orgId=1&left={"datasource":"AbfTenkVk","queries":[{"expr":"vector(1)"}]}

You'd need a way to pass in orgId and datasource

Without datasource it'll use the default or whatever you selected last to explore from.

I'm happy to attempt a PR if people are ok with passing those in. Not sure of another way to make grafana be an external link to the data though

mzupan avatar Jul 30 '23 04:07 mzupan

you can do this

https://grafana.foobar.com/explore?orgId=1&left={"datasource":"AbfTenkVk","queries":[{"expr":"vector(1)"}]}

You'd need a way to pass in orgId and datasource

Without datasource it'll use the default or whatever you selected last to explore from.

I'm happy to attempt a PR if people are ok with passing those in. Not sure of another way to make grafana be an external link to the data though

I think for that you need to capture those variables by using flags. IMHO they could be something like:

--is-grafana-gui (or something similar)

--grafana-organization-id
--grafana-datasource

achetronic avatar Jul 31 '23 07:07 achetronic

Sounds like something we can explore, yes. 👍 I wonder, do you think the Prometheus external links should still show too, or would this replace those with opening in Grafana entirely?

metalmatze avatar Aug 11 '23 14:08 metalmatze

@metalmatze i would vote to to have the text mention grafana if you pass in the args to turn the link into a grafana link if that's the way to handle grafana links

mzupan avatar Aug 11 '23 14:08 mzupan

Ok, sounds good to me! 👌

metalmatze avatar Aug 11 '23 14:08 metalmatze

Ok, sounds good to me! 👌

to me too. It makes sense 🙂

achetronic avatar Aug 11 '23 20:08 achetronic

Any updates here? We expose a central grafana that aggregates hundreds of prometheus instances, and do not expose Prometheus. This would be a great way to connect the two systems.

alec-drw avatar May 06 '24 18:05 alec-drw