To Integrate Medusa v2 with Sentry. #11661
Unanswered
Attachai77
asked this question in
Q&A
Replies: 1 comment
-
@Attachai77, we introduced support for a broader range of instrumentation tools in our latest release. To enable Sentry, you need to follow the regular docs for setting up instrumentation, and then modify it with the following configuration: import Sentry from '@sentry/node'
import otelApi from "@opentelemetry/api";
import { registerOtel } from "@medusajs/medusa"
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-grpc"
import { SentrySpanProcessor, SentryPropagator } from "@sentry/opentelemetry-node"
Sentry.init({
dsn: "INSERT DSN FROM SENTRY",
tracesSampleRate: 1.0,
// @ts-ignore
instrumenter: "otel",
});
otelApi.propagation.setGlobalPropagator(new SentryPropagator());
export function register() {
registerOtel({
serviceName: 'INSERT SERVICE NAME',
spanProcessor: new SentrySpanProcessor(),
traceExporter: new OTLPTraceExporter(),
instrument: {
http: true,
workflows: true,
query: true
},
})
} And install the following packages in addition to the ones from our docs:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to integrate Medusa v2 with sentry? I know that it can do that using a plugin https://medusa-plugins.vercel.app/sentry , but it's working only V1.
Beta Was this translation helpful? Give feedback.
All reactions