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

Automatically instrument profiling for Node and Python when Sentry is set up via the Lambda Layer #11800

Open
cstavitsky opened this issue Apr 25, 2024 · 5 comments

Comments

@cstavitsky
Copy link

Problem Statement

Currently the Lambda Layer setup instructions for serverless functions suggest that errors and performance is automatically enabled:

You can configure Sentry by setting these environment variables for your Lambda function:
SENTRY_INITIAL_HANDLER: The handler function of your AWS Lambda funtion.
SENTRY_DSN: This is set to the DSN of your project
SENTRY_TRACES_SAMPLE_RATE: This sets the sampling rate for transactions.

(I assume this applies to both Node and Python. The Node lambda layer docs are not explicit about what you get out of the box)

Beyond the above, though, it seems profiling has to be manually set up for Node lambdas and I believe also for Python lambdas. This manual step can be difficult when a customer has, say 1000 lambdas and doesn't want to instrument them all with profiling individually.

Solution Brainstorm

Add a configuration option for Node and Python profiling in the lambda layer.

Product Area

Profiling

@getsantry
Copy link

getsantry bot commented Apr 25, 2024

Assigning to @getsentry/support for routing ⏲️

@getsantry
Copy link

getsantry bot commented Apr 25, 2024

Routing to @getsentry/product-owners-profiling for triage ⏲️

@JonasBa
Copy link
Member

JonasBa commented Apr 25, 2024

@AbhiPrasad I guess this would mean that we inject the profiling integration based on an env variable. Is this something that we do in any other SDK and would there be a reason not to do this?

@AbhiPrasad
Copy link
Member

I guess this would mean that we inject the profiling integration based on an env variable

This is a little more complicated because this means we would have to bundle in @sentry/profiling-node with the lambda layer we upload to AWS (also all of this lambda layer code is scary to touch).

I think the environmental variable is a great idea, but the bundling will cause us complexities, especially because there are 0 tests. I'm going to transfer this to the Sentry JavaScript SDK repo, but backlog because we have higher priority items atm. Maybe after v8 releases we can revisit.

@JonasBa
Copy link
Member

JonasBa commented Apr 26, 2024

I guess this would mean that we inject the profiling integration based on an env variable

This is a little more complicated because this means we would have to bundle in @sentry/profiling-node with the lambda layer we upload to AWS (also all of this lambda layer code is scary to touch).

I think the environmental variable is a great idea, but the bundling will cause us complexities, especially because there are 0 tests. I'm going to transfer this to the Sentry JavaScript SDK repo, but backlog because we have higher priority items atm. Maybe after v8 releases we can revisit.

Oh yes, I was assuming the user would have to ensure the binaries are there, so some manual work would be required anyways. Bundling the binaries with the package isnt a good idea imo, I'd rather defer to manual instrumentation

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

No branches or pull requests

3 participants