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

Clarify where to use NewHandler() #953

Open
gebn opened this issue Aug 11, 2021 · 1 comment
Open

Clarify where to use NewHandler() #953

gebn opened this issue Aug 11, 2021 · 1 comment

Comments

@gebn
Copy link

gebn commented Aug 11, 2021

The docs for this function suggest NewHandler() should wrap a mux, and WithRouteTag() individual routes on that mux. However, this forces a single operation for every path, which sounds wrong. This is causing some confusion, as several reputable sites (1, 2, 3 - the first one written by a core maintainer of OTel) teach wrapping routes with NewHandler().

@wolverian
Copy link

The semantics of the operation parameter are unclear to me as well. What does it mean? For example, on this line:

https://github.com/open-telemetry/opentelemetry-go-contrib/blob/v1.3.0/instrumentation/net/http/otelhttp/handler.go#L127

operation is passed to semconv. semconv.HTTPServerAttributesFromHTTPRequest as the serverName parameter:

https://github.com/open-telemetry/opentelemetry-go/blob/v1.3.0/semconv/v1.7.0/http.go#L199

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

No branches or pull requests

3 participants