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

Support more span attributes in the AWS lambda wrapper #1773

Closed
mateuszrzeszutek opened this issue Nov 26, 2020 · 5 comments · Fixed by #1831
Closed

Support more span attributes in the AWS lambda wrapper #1773

mateuszrzeszutek opened this issue Nov 26, 2020 · 5 comments · Fixed by #1831
Labels
enhancement New feature or request

Comments

@mateuszrzeszutek
Copy link
Member

The aim of this issue is to introduce support for most of the FAAS/cloud attributes defined in the spec. Currently only faas.execution is added to the span.

I think that the following attributes can be added pretty easily:

  • cloud.provider
  • cloud.region
  • faas.name
  • faas.version
  • faas.id - this one is interesting, because it's marked as a resource attribute in the spec; in the context of AWS lambda functions ARN is used here and with the current implementation it's impossible to add it as a resource (because it can only be extracted from a lambda Context passed as a function parameter; the tracer is initialized before that happens)

Also, I'm planning to file a new spec issue so that the following things can be added (so this story will probably evolve in time):

  • execution environment
  • account id
  • function qualifier

For APIGatewayProxyRequestEvents I believe that we can implement most of the HTTP server spec - not sure about other event types though.

@mateuszrzeszutek mateuszrzeszutek added the enhancement New feature or request label Nov 26, 2020
@anuraaga
Copy link
Contributor

this one is interesting, because it's marked as a resource attribute in the spec

Yup this one probably needs an update in the spec.

account id

I think this is cloud.account.id
https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/resource/semantic_conventions/cloud.md

@anuraaga
Copy link
Contributor

For resource attributes, it probably makes sense to keep them together with other resource providers instead of instrumentation, so adding LambdaResource here - https://github.com/open-telemetry/opentelemetry-java/tree/master/sdk-extensions/aws/src/main/java/io/opentelemetry/sdk/extension/aws/resource

@mateuszrzeszutek
Copy link
Member Author

mateuszrzeszutek commented Nov 26, 2020

I think this is cloud.account.id

Nice! It was absent from the trace semantic conventions doc - I should probably add it there.

For resource attributes, it probably makes sense to keep them together with other resource providers instead of instrumentation, so adding LambdaResource here

Yep, that was exactly my intention, but in the Javaagent. I think that putting it in otel-java makes more sense though -- will add it there. Thanks for the suggestion!

@mateuszrzeszutek
Copy link
Member Author

By the way @anuraaga : do you know if it's possible to get the account id from something other than the ARN? My idea was to just extract it from the ARN, but then again it cannot be a resource attribute.

@mateuszrzeszutek
Copy link
Member Author

Also, regarding the execution environment: I thought about it and decided to use more generic process.runtime.* attributes instead. I'll create an issue & PR in otel-java.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants