getsentry / profiling-node

The code for this repo now lives in https://github.com/getsentry/sentry-javascript/tree/develop/packages/profiling-node
MIT License
28 stars 10 forks source link

Is there a way to enable profiling when using the Sentry Lambda layer instead of the SDK? #240

Open micthiesen opened 5 months ago

micthiesen commented 5 months ago

Problem Statement

Currently the docs only show enabling a Sentry extension via arguments to Sentry.init. But if you're using a Lambda layer, then you never call Sentry.init yourself. I don't see a way to enable other integrations using the layer; any ideas? A little surprising since this is the recommended method for setting up Sentry with Lambdas in the docs.

Solution Brainstorm

Currently you can enable tracing via the SENTRY_TRACES_SAMPLE_RATE: "0.5" env var. Not sure if something similar could work here, although this doesn't seems sustainable for arbitrary integrations.