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 FaaS span name #1858

Open
lmolkova opened this issue Jan 31, 2025 · 3 comments
Open

Clarify FaaS span name #1858

lmolkova opened this issue Jan 31, 2025 · 3 comments
Labels

Comments

@lmolkova
Copy link
Contributor

lmolkova commented Jan 31, 2025

Reading

Span `name` should be set to the function name being executed. Depending on the value of the `faas.trigger` attribute, additional attributes MUST be set. For example, an `http` trigger SHOULD follow the [HTTP Server semantic conventions](/docs/http/http-spans.md#http-server-semantic-conventions). For more information, refer to the [Function Trigger Type](#function-trigger-type) section.

and

The function responsibility is to provide an answer to an inbound HTTP request. The `faas` span SHOULD follow the recommendations described in the [HTTP Server semantic conventions](/docs/http/http-spans.md#http-server-semantic-conventions).

It's not clear if the span name should be a function name or, according to HTTP semconv, {method} {route}.

Given that function can be called over HTTP using different methods, it makes sense to use HTTP server span name, but presence of route is not guaranteed.

Perhaps, the best approach would be to report HTTP function span name as {method} {function name} and route, if available, would remain as an attribute.

@trask
Copy link
Member

trask commented Jan 31, 2025

cc @open-telemetry/lambda-extension-approvers

@stebet
Copy link
Contributor

stebet commented Jan 31, 2025

I'd rather see a clear distinction rather than mixing FaaS and HTTP semantics if we'd mix the {method} {function name} in the span name.

Either have it just the {function name} or {http method} {http route} if the http route is available. The span will always contain the faas.name attribute so the function name is always easily found.

Personally I'd like to have the HTTP Server span semantics apply when faas.trigger is HTTP but that's just a personal opinion.

@serkan-ozal
Copy link

As far as I see in the docs, using function name in span name is expressed with "SHOULD", not "MUST".

Span name should be set to the function name being executed.

and here

It is also highly likely that Span name will contain the function name (e.g. for Span displaying purposes), but it is not guaranteed (since it is a weaker "SHOULD" requirement)

So, this got me thinking like:

So in summary, for Lambda span names, my opinion is

  • for http triggers {method} {route} or {method} if {route} is not available
  • for the rest, {function name}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Need triage
Development

No branches or pull requests

4 participants