Skip to content

Conversation

lahsivjar
Copy link
Contributor

Adds support for collecting function logs using AWS Logs API and shipping it to APM-Server with collected agent metadata.

Closes: #256

@github-actions github-actions bot added the aws-λ-extension AWS Lambda Extension label Sep 13, 2022
@lahsivjar lahsivjar marked this pull request as draft September 13, 2022 04:16
@ghost
Copy link

ghost commented Sep 13, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-09-19T03:26:40.652+0000

  • Duration: 5 min 14 sec

Test stats 🧪

Test Results
Failed 0
Passed 164
Skipped 2
Total 166

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@lahsivjar
Copy link
Contributor Author

/test

@lahsivjar lahsivjar marked this pull request as ready for review September 14, 2022 02:07
@lahsivjar lahsivjar requested review from a team and axw and removed request for axw September 14, 2022 05:59
Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a few nitpicks. Nice work!

@lahsivjar lahsivjar force-pushed the 256_collect_lambda_logs branch from f2b6b0d to 7e6865c Compare September 19, 2022 03:05
@lahsivjar
Copy link
Contributor Author

@axw Apologies for the force push 🙇

This is the commit added for addressing the review comments.

Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for the updates :)

@lahsivjar lahsivjar merged commit 556d5dd into elastic:main Sep 19, 2022
@lahsivjar lahsivjar deleted the 256_collect_lambda_logs branch September 19, 2022 03:42
@kruskall kruskall self-assigned this Sep 27, 2022
@kruskall
Copy link
Member

Tested with BC2 (and 8.6.0-SNAPSHOT) by provisioning the environment with the terraform script (SKIP_DESTROY=1 has been used to inspect the cluster) with TF_VAR_ess_version=8.5.0-SNAPSHOT.

Verified that the logs are visible in the logs tab in the Observability section.

Made sure that ELASTIC_APM_LAMBDA_CAPTURE_LOGS=false disables logs collection.

Possible concern: #322
I don't think the above issue is a blocker according to the definition of a blocker so I'm going to label this PR as test-plan-ok

@RyanHealey1307
Copy link

I'm aware this is still experimental, but some feedback...
I've tested this for a python lambda, using the latest APM layer, and when you invocate the function, the logs don't go through to APM until the next invocation. Eg, if my lambda is run at 10:09 and then again at 10:13, the logs from 10:09 are not visible until next next invocation at 10:13. My timeout is set to 5 mins and it's a very simple function, so I can't be a timeout issue.

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

Successfully merging this pull request may close these issues.

Collect Lambda Logs (POC)

5 participants