hackney icon indicating copy to clipboard operation
hackney copied to clipboard

Telemetry support

Open Kitton opened this issue 4 years ago • 13 comments

Hello, do you have any plans about adding support of telemetry? From https://github.com/edgurgel/httpoison/issues/383

Kitton avatar Aug 20 '19 15:08 Kitton

There is a plan to use hooks and opencensus. What telemetry does compared to it?

benoitc avatar Sep 23 '19 21:09 benoitc

@benoitc , from what I understand this lib can connect both: https://github.com/opencensus-beam/opencensus_telemetry . But I think this is just for metrics and not tracing?

So basically adding telemetry to hackney would enable people to use opencensus if they wanted to or something else completely.

edgurgel avatar Sep 23 '19 22:09 edgurgel

@edgurgel that something that could be don with hooks long time before telemetry was existing :) And I don't like the implementation of telemetry . Dispatching events using ets is exactly what I replaced with hooks.

Anyway since it's used by some people I will add a support for it in next version, that will work with hooks and some other additions.

benoitc avatar Sep 28 '19 13:09 benoitc

Just stopping by to note that I'm interested in this feature as well. Given that OpenCensus has been superseded by OpenTelemetry, and in the BEAM ecosystem, it seems that the desire is to use Telemetry library as a bridge for library authors (like Hackney in this case) to emit their metrics and events, and then there would be an integration to connect that to OpenTelemetry-Erlang in case someone wants to use that.

GregMefford avatar Apr 10 '20 19:04 GregMefford

@GregMefford thanks for the feedback. I agree supporting telemetry may be useful for some users :)

The current plan is the following . Hackney will provide inline hooking and replace metrics by it. Support of telemetry and open-telemetry will be provided by add-ons attached to these hooks. This will provide more flexibility and also support for any other solutions and usages around.

This work will land sometimes this month once I committed the changes in pooling and made the new release. Starting by adding the hooks. I will provide a better roadmap in the coming week.

benoitc avatar Apr 12 '20 20:04 benoitc

Sounds great, thanks! 🚀

GregMefford avatar Apr 13 '20 00:04 GregMefford

I'm interested to learn more about the "hooks" idea... One potential use case that is just a step beyond what telemetry provides is the ability to add Distributed Tracing instrumentation - that involves attaching an additional HTTP header to the outgoing request for context propigation.

Would this kind of use case be a target for hooks?

Here's some context: https://github.com/beam-telemetry/telemetry/issues/48

binaryseed avatar Apr 13 '20 17:04 binaryseed

@binaryseed so it's partly reusing the hooks library i've written (though with some changes). It will allows to indeed manipulate the request before if it is sent and such things. It can also be used to intercept it completely if needed. More over the coming week :)

benoitc avatar Apr 17 '20 16:04 benoitc

@benoitc any update on this? I'd love to use it, so I'd be happy to help contribute to it.

zoidyzoidzoid avatar Aug 19 '20 15:08 zoidyzoidzoid

@zoidbergwill i have been side tracked but it still on the pipe. I will describe the feature more accuratly this weekend so anyone can see where it's going and maybe help. I 'm not sure though it should be done on 1.x version..

benoitc avatar Aug 21 '20 16:08 benoitc

Another voice of someone who would be interested in this issue, and will be interested in reviewing the code, if needed.

isaacsanders avatar Oct 07 '20 21:10 isaacsanders

Hello again! Any way folks in the community might be able to help get this work moving forward?

binaryseed avatar May 06 '21 19:05 binaryseed

Any updates on the telemetry or the suggested hooks integration @benoitc?

gjsduarte avatar Feb 22 '22 03:02 gjsduarte