gorilla / handlers

Package gorilla/handlers is a collection of useful middleware for Go HTTP services & web applications 🛃
https://gorilla.github.io
BSD 3-Clause "New" or "Revised" License
1.66k stars 271 forks source link

[FEATURE] OpenTelemetry Instrumentation #257

Open jwafle opened 2 months ago

jwafle commented 2 months ago

Is there an existing feature request for this?

Is your feature request related to a problem? Please describe.

OpenTelemetry is becoming a popular open-source solution for monitoring application performance. Well-defined semantic conventions are supplied for HTTP metrics and traces. See here: https://opentelemetry.io/docs/specs/semconv/http/

In following with their guidance on instrumentation, they recommend implementing instrumentation code in the library for which it is written: https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation#new-instrumentation

Describe the solution that you would like.

If interested, I would be willing to contribute instrumentation code that implements OpenTelemetry metrics and tracing as a middleware for mux. Please let me know if you would like me to proceed with opening a PR.

Describe alternatives you have considered.

I have opened an issue to explore updating the current otelmux instrumentation: https://github.com/open-telemetry/opentelemetry-go-contrib/issues/5936

However, current guidance from OpenTelemetry is to seek to include instrumentation with the libraries/packages themselves, thus why I am opening this issue.

Anything else?

No response

AlexVulaj commented 2 months ago

Hey @jwafle - I think this would be a wonderful thing to add to the library. You have my support to go ahead with a PR for this.

jwafle commented 1 month ago

Hey @jwafle - I think this would be a wonderful thing to add to the library. You have my support to go ahead with a PR for this.

Great! I'll work on opening a PR!