Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open-telemetry #2

Open
pkieltyka opened this issue May 7, 2021 · 3 comments
Open

open-telemetry #2

pkieltyka opened this issue May 7, 2021 · 3 comments

Comments

@pkieltyka
Copy link
Member

Switch to https://github.com/open-telemetry/opentelemetry-go as its won

@Isnor
Copy link

Isnor commented Mar 10, 2024

It's been a while since this was created and I know there are two otel implementations in https://github.com/riandyrn/otelchi and (sort of) https://github.com/signalfx/splunk-otel-go/tree/main/instrumentation/github.com/go-chi/chi/splunkchi , but because the former doesn't appear actively maintained and the latter for a specific vendor, I want to know if you would still entertain PRs on this repo. I like chi a lot and I'm interested in opentelemetry so I thought this might be the best place to do it where otelchi doesn't have a huge user base.

@pkieltyka
Copy link
Member Author

thanks @Isnor :) what do you propose.. this package is largely outdated

@Isnor
Copy link

Isnor commented Mar 13, 2024

I think that the go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp package did a pretty good job, and after playing with it for a few hours I don't know if there's much more instrumentation chi can do. A couple of things:

  • Telemetry isn't something users of chi can "drop in" like other middleware; it requires initialization and configuration of the tracer/metrics/etc. that require at the very least a service name. Users of opentelemetry won't be confused by this but people hoping to drop in telemetry will probably end up opening issues when they can't find traces.
  • otelhttp.NewHandler does probably everything we would want a chi Middleware to do and it just uses http.Handler, and as far as I can see there isn't a straightforward way for chi to put an event name on a handler/request - and it probably shouldn't anyway.

I've only spent a few hours playing around, but my feeling right now is that telemetry is out of scope for chi, and that implementing it effectively won't be done automagically any better than the existing solution of otelhttp. otelchi exists but AFAIK it's so outdated and the opentelemetry project has grown so much that I don't think it's ever a good choice over otelhttp.

Link to the full example implementation: https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/instrumentation/net/http/otelhttp/example/server/server.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants