babelouest / ulfius

Web Framework to build REST APIs, Webservices or any HTTP endpoint in C language. Can stream large amount of data, integrate JSON data with Jansson, and create websocket services
https://babelouest.github.io/ulfius
GNU Lesser General Public License v2.1
1.08k stars 182 forks source link

Integrating Ulfius with Prometheus for metrics #140

Closed bouharb closed 2 years ago

bouharb commented 5 years ago

Hello,

Is it possible to integrate a metrics tool like prometheus ?

Thanks in advance

babelouest commented 5 years ago

Hello @bouharb ,

That's a very good question. Unfortunately I don't know the tool so I would make a definitive assumption but I don't see why not.

I don't know exactly how this tool works but I see a C++ library. You can start with this one.

If you can integrate an Ulfius project with metrics, I'd be interested to get to know the result though.

Citrullin commented 4 years ago

Of course. Prometheus just needs an HTTP endpoint. So, define one and collect your metrics ;) Prometheus describes this also in the documentation: https://prometheus.io/docs/prometheus/latest/getting_started/ As I remember the structure is just key=value But a plugin would be amazing. :) You should write one :D

babelouest commented 4 years ago

Thanks @Citrullin , but the problem remains that I don't have the time these days to make a project like that... Any help would be appreciated.

babelouest commented 3 years ago

Hello,

I'm digging out this issue from the past because I've recently used ulfius to create metrics endpoints for Prometheus in glewlwyd. The issue is available here

Basically a new ulfius instance is created to host the metrics endpoint, and an asynchronous system with detached threads is used to increment the metrics.

Citrullin commented 3 years ago

Thanks @Citrullin , but the problem remains that I don't have the time these days to make a project like that... Any help would be appreciated.

I don't think I was refering to you back then, but to the issue creator :) Afterall it's all open source :D

babelouest commented 3 years ago

My bad @Citrullin , sorry for the confusion :/

babelouest commented 2 years ago

Glewlwyd 2.6 has been released with the prometheus endpoint, the source for the metrics endpoint is available here.