Golang microservice promQL client example or package?

26 views
Skip to first unread message

Luke Hamilton

unread,
Aug 6, 2020, 9:04:56 PM8/6/20
to Prometheus Users

Hey all,

I am wondering if there is a golang based promQL client package or exmaples anywhere on how I can call a Prometheus server we have collecting a bunch of data that we need to use for a billing service thats built in Go.

Sounds like this repo has this feature in it, but there is no doco or examples I can find? https://github.com/prometheus/client_golang

Any help is great appreciated

p.s I'm a total newbie around Prometheus

Thanks

Stuart Clark

unread,
Aug 7, 2020, 3:07:51 AM8/7/20
to Luke Hamilton, Prometheus Users
On 07/08/2020 02:04, 'Luke Hamilton' via Prometheus Users wrote:
> I am wondering if there is a golang based promQL client package or
> exmaples anywhere on how I can call a Prometheus server we have
> collecting a bunch of data that we need to use for a billing service
> thats built in Go.

When you say a billing service, what are you hoping to get from Prometheus?

I ask because Prometheus isn't expected to be "billing quality", with
perfect data, so I'd be cautious about how you are planning on using the
data.

Prometheus is primarily designed for system monitoring where
interpolation and the possibilities of missed data or other small
glitches are generally considered acceptable.

Luke Hamilton

unread,
Aug 7, 2020, 7:22:41 PM8/7/20
to Prometheus Users

We are using Prometheus to monitoring a number of custom/proprietary hardware solutions we provide to customers. Prometheus is pulling data which we use to calulate the cost of usage to these devicies. So far prometheus is getting all the data and we can run promQL queries direcly to pull the data out and manually make the required calulations.

What we would now like to do is automate this a bit better with a golang based service that calls prometheus with the query. And as promQL is kind of its own thing I am wondering what clients package exist or if anyone has any example code to speak promQL from a golang ms to a prometheus server?

Also note the data doesnt need to be prefect either as its over time averages that is how the billing is based. Also this really is just a PoC system at the moment and if data is missed, etc we are happy to wear the cost.

We also want to speak golang > promQL -> prometheus server so we can also make our own custom dashboasd for monitoring purposes too.

Thanks

Aliaksandr Valialkin

unread,
Aug 8, 2020, 4:09:12 AM8/8/20
to Luke Hamilton, Prometheus Users

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/20515ff3-81b4-412d-b53b-c9048446e4d7n%40googlegroups.com.


--
Best Regards,

Aliaksandr Valialkin, CTO VictoriaMetrics

Luke Hamilton

unread,
Aug 10, 2020, 8:00:57 PM8/10/20
to Aliaksandr Valialkin, Prometheus Users
Awesome, thanks!
Regards,
Luke 


Reply all
Reply to author
Forward
0 new messages