Sample Code in Go/C++ to Publish Metrics to a Remote Write Endpoint

36 views
Skip to first unread message

Al

unread,
Nov 9, 2020, 9:55:43 AM11/9/20
to Prometheus Users
I have a specific use case where I'm backfilling metrics into a Postgres TimescaleDB instance.   As backfilling indicates, the metrics are not scrapped during regular intervals.  The individual metrics/data points are calculated at the end of each day, and then pushed to TimescaleDB.  I know we can accomplish this directly via some SQL inserts although I know we can also do it by encoding the individual data points with the necessary protobuf definitions which are included in the prometheus repo and posting them to the promscale connector.  I'd like to know if there are any code samples out there of how this can be accomplished in Go and in C++ directly from the application which is generating the metrics?

I appreciate any help.


Al

Bartłomiej Płotka

unread,
Nov 9, 2020, 10:13:47 AM11/9/20
to Al, Prometheus Users
I think this question should go to the TimescaleDB support list rather because it's up to Timescale what exactly semantics they allow on their APIs.

In terms of official Prometheus Remote Write, it's hard to get exactly the same semantics that is accurate as Prometheus client. Think about staleness marking, continuity of series etc

Something that is happening in the community is Open Telemetry Remote Write exporter which might give you some examples: https://github.com/open-telemetry/opentelemetry-collector/tree/master/exporter/prometheusremotewriteexporter (I personally did not look how valid it is though).

Kind Regards,
Bartek Płotka (@bwplotka)


--
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/7590a8c9-646d-4e28-bb2c-ccfffdc99fc2n%40googlegroups.com.

Harkishen Singh

unread,
Nov 24, 2020, 3:16:12 AM11/24/20
to Prometheus Users

Hey AI,

We (TimescaleDB team) are in the process of adding support to easily push prometheus metric data to Promscale/TimescaleDB. The PR is already merged and we are writing examples and docs for users to understand in simple terms how to use this feature.
For knowing more information on this, feel free to drop a message at TimescaleDB community slack (link) and we will answer your queries ASAP.

Thank you
Reply all
Reply to author
Forward
0 new messages