Convert metrics in Open telemetry format to promethues exposition format

108 views
Skip to first unread message

kiran

unread,
Dec 13, 2021, 3:04:02 AM12/13/21
to Prometheus Users
All,

1. Clients' system  is emitting metrics in Open telemetry format and pushing to a HTTP end point on our side
Note:No control to change anything on the clients' side.
2. We need to transform the data received at the above end point into prometheus exposition format(https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format). 
3. Then we want to then import this data from step 2 into another system which accepts prometheus exposition format.

I need help with step 2(transform open telemetry data to prometheus exposition text format) preferably using python or nodejs code.

Regards,
Kiran

Stuart Clark

unread,
Dec 13, 2021, 3:07:05 AM12/13/21
to kiran, Prometheus Users

You should be able to find libraries that decode Open Telemetry and create Prometheus format metrics. Then it should just be a case of writing an application which listens for Open Telemetry data, stores it in memory and then returns the latest set of values when a Prometheus scrape is received.

-- 
Stuart Clark

kiran

unread,
Dec 13, 2021, 3:11:26 AM12/13/21
to Stuart Clark, Prometheus Users
@Stuart: Thank you. Any reference to libraries which can do that. I am not able to find any.

Stuart Clark

unread,
Dec 13, 2021, 3:14:37 AM12/13/21
to kiran, Prometheus Users
On 13/12/2021 08:11, kiran wrote:
> @Stuart: Thank you. Any reference to libraries which can do that. I am
> not able to find any.

For Python there seems to be this for Open Telemetry:
https://github.com/open-telemetry/opentelemetry-python

For Prometheus you'd just use the standard client library:
https://github.com/prometheus/client_python

--
Stuart Clark

kiran

unread,
Dec 13, 2021, 3:18:29 AM12/13/21
to Stuart Clark, Prometheus Users
Hi Stuart,

The open telemetry library is for python application to instrument the code.
In my case I already have metrics coming in open telemetry format already. Just need transformation into prometheus format.

Stuart Clark

unread,
Dec 13, 2021, 3:22:59 AM12/13/21
to kiran, Prometheus Users
On 13/12/2021 08:18, kiran wrote:
> Hi Stuart,
>
> The open telemetry library is for python application to instrument the
> code.
> In my case I already have metrics coming in open telemetry format
> already. Just need transformation into prometheus format.
>
Maybe try asking on their mailing list (or whatever they use) for what
is available? Worst case the format is published so you could write a
parser in the language of your choice.

--
Stuart Clark

Reply all
Reply to author
Forward
0 new messages