I’m curious how other people are handling Sentry +...
# help
s
I’m curious how other people are handling Sentry + source maps with Lambda. right now, in my Sentry config, I have
release: process.env.SENTRY_RELEASE
, and each time I deploy,
SENTRY_RELEASE
is the git hash of the current commit. this works fine with associating each function w/ the proper release in Sentry, but the downside is that every time I deploy, EVERY function gets an update. I wonder if there’s a better way to do this
@thdxr this is probably up your alley
t
I only load one env variable in every function which is SSM_PATH =
/${dev.stage}/
and then all my variables are loaded from SSM on lambda cold start
s
got it. so for the Sentry release hash, how do you update that in an automated fashion when you deploy?
(perhaps just an SSM update via AWS CLI?)
t
I would update that via CDK
s
ahhh.. right!
@thdxr that works great! only about 50ms cost to pull an SSM parameter, then it’s cached while the func is warm. so, obviously the Sentry initialization has to be wrapped in a function now since it has to make an async call to SSM. how do you have that set up so every single Lambda function does that? trying to think if there’s a better way than importing a function all the time & doing
initSentry()
I suppose some sort of higher-order function wrapper around the Lambda handler would work. though it still requires an extra step