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

PoC use of AWS Lambda Telemetry API #348

Open
simitt opened this issue Nov 23, 2022 · 1 comment
Open

PoC use of AWS Lambda Telemetry API #348

simitt opened this issue Nov 23, 2022 · 1 comment
Labels
aws-λ-extension AWS Lambda Extension
Milestone

Comments

@simitt
Copy link
Contributor

simitt commented Nov 23, 2022

Research how the recently announced AWS Lambda Telemetry API can be used for collecting APM data from the lambda service.
A PoC should be built for comparing the current lambda extension to the possibilities via the new API. Focus should be on how the APM data compare and usability.

@simitt simitt added this to the 8.7 milestone Nov 23, 2022
@github-actions github-actions bot added the aws-λ-extension AWS Lambda Extension label Nov 23, 2022
@estolfo
Copy link
Contributor

estolfo commented Jan 23, 2023

I've completed a POC of using the Telemetry API in the aws lambda extension, and these are the findings:

  • The Telemetry API is a superset of the Logs API and is recommended in place of it
    • Implementation of subscription to Telemetry API is here
    • The Logs API will probably be deprecated
  • The functionality is equivalent to the Logs API
    • Send subscription request, then listen on a certain host:port for data
  • Differences include the amount and type of data being sent
  • The Telemetry API documentation gives guidance on how to translate data into OTel spans here
  • The spanId reported in Telemetry API documents is a kind of transaction ID for the overall request to the function
  • The APM agent will create/propagate its trace id to downstream services but the Lambda runtime won't parse the agent's trace id, if the downstream service is a Lambda function.
  • The tracing info is available via the Telemetry API if "Active tracing" is turned to ON for a function
  • Only two spans are reported right now as "tracing" data
    • The responseDuration span reported in the Telemetry API is visualized in their traces explorer as the "intialization" segment (i.e. span)
    • The responseLatency span reported in the Telemetry API is visualzed in their traces explorer as the 'invocation" segment (i.e. span)

In conclusion, we should use the Telemetry API going forward. We can also use the two spans reported to more accurately timestamp the transaction for the lambda function invocation and to show the two "initialization" and "invocation" phases of the lambda function as spans in our own UI.

Open questions:

  • Is there an extra span when SnapStart is used?
  • Are all metrics we use from the Logs API available via the Telemetry API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws-λ-extension AWS Lambda Extension
Projects
None yet
Development

No branches or pull requests

2 participants