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

Span name for http server spans should include http.method. #2998

Closed
gouthamve opened this issue Dec 1, 2022 · 9 comments · Fixed by #3165
Closed

Span name for http server spans should include http.method. #2998

gouthamve opened this issue Dec 1, 2022 · 9 comments · Fixed by #3165
Assignees
Labels
area:semantic-conventions Related to semantic conventions semconv:HTTP spec:trace Related to the specification/trace directory

Comments

@gouthamve
Copy link
Member

gouthamve commented Dec 1, 2022

Current spec defines the span name as the route, for example, /users/:userID?.

But having the http.method in the span name helps a lot, imo: GET /users/:userID?.

Prompted by open-telemetry/opentelemetry-go-contrib#3040

@gouthamve gouthamve added the spec:trace Related to the specification/trace directory label Dec 1, 2022
@cyrille-leclerc
Copy link
Member

I support this proposal as REST architectures rely on the verb (GET, PUT, DELETE) to convey the sense of the action performed on the resource identified by its URI.
GET /users/:userID, PUT /users/:userID and DELETE /users/:userID are completely different operations with completely different code execution paths.
For this reason, I support the idea that the name of an HTTP span should be ${http.method} ${http.route}

@arminru arminru added the area:semantic-conventions Related to semantic conventions label Dec 5, 2022
@jsuereth
Copy link
Contributor

I'm also supportive of this change.

@trask trask assigned trask and unassigned carlosalberto Jan 30, 2023
@trask
Copy link
Member

trask commented Jan 31, 2023

if we make this change, does it makes sense to also change the fallback (when there's no http.route available) from "HTTP {http.method}" to just "{http.method}"?

this would have the nice symmetry:

  • "{http.method} {http.route}" if route is available
  • "{http.method}" if route is not available

@blumamir
Copy link
Member

I support this change too.

It also happens many times that the route is / (just one slash). In these cases, the current span name is just /, and I think changing it to GET / gives context to what we are looking at.

@arielvalentin
Copy link

if we make this change, does it makes sense to also change the fallback (when there's no http.route available) from "HTTP {http.method}" to just "{http.method}"?

this would have the nice symmetry:

  • "{http.method} {http.route}" if route is available
  • "{http.method}" if route is not available

if we make this change, does it makes sense to also change the fallback (when there's no http.route available) from "HTTP {http.method}" to just "{http.method}"?

this would have the nice symmetry:

  • "{http.method} {http.route}" if route is available
  • "{http.method}" if route is not available

👍🏼 👍🏼 👍🏼 in favor!

@macieyng
Copy link

We consider faas handlers servers, but typically they use handler name as span name. How does this specification apply to faas?

  • {handler_name} {http.method} {http.route} if route available and {handler_name} {http.method} when route unavailable

OR

  • it should ignore handler_name and stick to specification - after all handler_name is commonly passed as a span attribute (faas.invocation_name) and resource attribute(faas.name) - unless I have mixed up something.

I'm currently working on open-telemetry/opentelemetry-python-contrib#1757 and this is something I came across when working on python aws-lambda instrumentation. I would really appreciate clarification in this matter.

@Oberon00
Copy link
Member

Oberon00 commented Apr 17, 2023

The term "handler name" for faas is ambiguous, do you mean the name of the handler method in code or the logical FaaS function name? Also, what is faas.invocation_name?

In general, I think the span name is sometimes not 100% clear and this is one such case. I think either the FaaS conventions or the HTTP conventions, if applicable, are valid. In doubt, I would stick to the FaaS conventions, since that is probably the more natural implementation.

@macieyng
Copy link

I meant faas.invoked_name (src).

It make sense to apply FaaS conventions in those cases. Thanks!

@trask
Copy link
Member

trask commented Apr 19, 2023

@macieyng if there's still an issue/concern, can you open a new issue so it doesn't get lost? thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:semantic-conventions Related to semantic conventions semconv:HTTP spec:trace Related to the specification/trace directory
Projects
Development

Successfully merging a pull request may close this issue.

10 participants