citilinkru/camunda-client-go

Prometheus metrics on client side

Closed this issue · 1 comments

Hi,I am a software developer currently working with your Go client for the Camunda BPM platform, and I must commend you for your excellent work.

However, as I continue to integrate the Go client into my projects, I noticed that the current version lacks Prometheus metrics in the client. Utilizing Prometheus metrics has been an essential part of my workflow, enabling effective monitoring and performance tracking.

I am aware that Camunda provides its own API for metrics, but for my specific use-case, I require these metrics on the client-side.

I understand that adding this feature might require substantial efforts and architectural considerations. But I believe that including Prometheus metrics would significantly improve the utility of the client and benefit other developers who also rely on comprehensive monitoring tools.

Given this, I would like to propose contributing to your project by adding Prometheus metrics on the client-side. I would appreciate your feedback and guidance on this.

Could you kindly inform me if there are plans to integrate Prometheus metrics into the client in the foreseeable future, or if my contribution in this regard would be welcome?

Hi! Adding prometheus metrics to the public client is a bad idea. This violates the Single Responsibility SOLID principle. It also increases the number of dependencies.

Just imagine how many things can be implemented: prometheus, influxdb, opentracing ... But the code will become unbearably complex.

But there is another solution: you can use the SetCustomTransport method to pass a CustomTransport wrapped in an interceptor.
The interceptor will intercept all HTTP requests from the client and you can implement the collection of prometheus metrics in it.

You can refer to this article to learn more about HTTP Client interceptors:
https://clavinjune.dev/en/blogs/golang-http-client-interceptors/