Is somebody using Epsagon with SST projects?
# sst
a
Is somebody using Epsagon with SST projects?
r
We do, yes
a
Nice, do I need to do any special setup?
Mostly for auto-tracing.
r
Other than wrapping your functions with the Epsagon handler, no. In the serverless framework we used to use the epsagon plugin but that's not available for CDK/SST so you have to wrap them yourself. Otherwise, it just works. I think there's an open PR for SST plugins or middleware to solve this kind of use case more generically
a
Ok yea, I might use the wrapper then.
Is auto-tracing working with the wrapper?
r
You wouldn't need the auto tracing if you used the wrapper. We don't tend to auto trace as we did have an experience where it broke the function and it would error every time it was called
a
Ok, makes sense.
I’m not sure if my wrappers are enabling tracing currently.
Maybe I’m missing something.
Do you have example of tracing with SST? i mean how the wrapper looks like? any special parameter?
r
Copy code
import { APIGatewayProxyHandler } from 'aws-lambda';
import epsagon from 'epsagon';

epsagon.init({
  token: process.env.EPSAGON_TOKEN || '',
  appName: `My-App-Name`,
});

export const myHandler: APIGatewayProxyHandler = epsagon.lambdaWrapper(async () => {
// Handler code here...
})
a
Ok nice, I do the same.
r
👍🏻
a
Didn’t know that enabled tracing.
Going to check, thank you.
r
no worries