-
Notifications
You must be signed in to change notification settings - Fork 24
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
How do I use toucan-js with Sentry Performance/Tracing #101
Comments
hey @STRRL , I'm not the maintainer of import { Toucan } from 'toucan-js';
import '@sentry/tracing';
type Env = {
SENTRY_DSN: string;
};
export default {
async fetch(request, env, context): Promise<Response> {
const sentry = new Toucan({
dsn: env.SENTRY_DSN,
tracesSampleRate: 1.0,
context,
request,
});
const transaction = sentry.startTransaction({ name: 'someRandomName' });
try {
handler();
return new Response('Hello!');
} catch (e) {
sentry.captureException(e);
return new Response('Something went wrong! Team has been notified.', {
status: 500,
});
} finally {
transaction.finish();
}
},
} as ExportedHandler<Env>; To create a span, simply do |
One thing I'll add to @ngshiheng's answer is that you need to pass a description to give a name for the span:
|
Anyone figured out how to use tracing in toucan-js 4? Looks like things have changed quite a bit |
Hi! I want to use toucan-js for collecting tracing data with my cloudflare workers application.
I have set up the
tracesSampleRate
whennew Toucan({<options>})
, but it does not work, no data on the sentry performance panel appeared.What should I do to use toucan with tracing correctly?
Thank in advance!
The text was updated successfully, but these errors were encountered: