-
Notifications
You must be signed in to change notification settings - Fork 902
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
feat: opentelemetry integration #2235
feat: opentelemetry integration #2235
Conversation
…shubham/for-2023-self-host-signoz-for-trying-out-their-monitoring
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
Thank you for following the naming conventions for pull request titles! 🙏 |
apps/web/instrumentation.tsIt's a good practice to add error handling to the OpenTelemetry instrumentation setup. This will help in identifying any issues that might occur during the setup process and prevent the application from crashing due to unhandled exceptions. try {
startInstrumentationForNode(process.env.NEXT_PUBLIC_OPENTELEMETRY_LISTENER_URL);
} catch (error) {
console.error('Failed to start OpenTelemetry instrumentation:', error);
}
|
apps/web/instrumentation.ts
Outdated
if (process.env.NEXT_RUNTIME === "nodejs" && process.env.NEXT_PUBLIC_OPENTELEMETRY_LISTENER_URL) { | ||
console.log("Configuring OpenTelemetry"); | ||
const { startInstrumentationForNode } = await import("./instrumentation.node"); | ||
|
||
startInstrumentationForNode(process.env.NEXT_PUBLIC_OPENTELEMETRY_LISTENER_URL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding error handling to the OpenTelemetry instrumentation setup to prevent the application from crashing due to unhandled exceptions.
if (process.env.NEXT_RUNTIME === "nodejs" && process.env.NEXT_PUBLIC_OPENTELEMETRY_LISTENER_URL) { | |
console.log("Configuring OpenTelemetry"); | |
const { startInstrumentationForNode } = await import("./instrumentation.node"); | |
startInstrumentationForNode(process.env.NEXT_PUBLIC_OPENTELEMETRY_LISTENER_URL); | |
if (process.env.NEXT_RUNTIME === "nodejs" && process.env.NEXT_PUBLIC_OPENTELEMETRY_LISTENER_URL) { | |
console.log("Configuring OpenTelemetry"); | |
const { startInstrumentationForNode } = await import("./instrumentation.node"); | |
try { | |
startInstrumentationForNode(process.env.NEXT_PUBLIC_OPENTELEMETRY_LISTENER_URL); | |
} catch (error) { | |
console.error('Failed to start OpenTelemetry instrumentation:', error); | |
} | |
} |
…-out-their-monitoring
…monitoring' of https://github.com/formbricks/formbricks into shubham/for-2023-self-host-signoz-for-trying-out-their-monitoring
What does this PR do?
Enables exporting app metrics to any OpenTelemetry supported Client given the
NEXT_PUBLIC_OPENTELEMETRY_LISTENER_URL
is passedHow should this be tested?
Checklist
Required
pnpm build
console.logs
git pull origin main
Appreciated