Skip to content

feat(otel): expose SDK instance from registerOTel#141

Open
zloit wants to merge 1 commit into
vercel:mainfrom
zloit:open-sdk-api
Open

feat(otel): expose SDK instance from registerOTel#141
zloit wants to merge 1 commit into
vercel:mainfrom
zloit:open-sdk-api

Conversation

@zloit
Copy link
Copy Markdown

@zloit zloit commented Feb 3, 2025

This change allows users to properly manage OpenTelemetry SDK lifecycle by exposing the SDK instance from registerOTel function.

Previously, there was no way to properly shutdown the SDK which could lead to lost telemetry data during application shutdown. Now users can store the SDK instance and call shutdown when needed.

Example:

const sdk = registerOTel("service-name");
process.on('SIGTERM', async () => {
  await sdk.shutdown();
});

This change allows users to properly manage OpenTelemetry SDK lifecycle
by exposing the SDK instance from registerOTel function.

Previously, there was no way to properly shutdown the SDK
which could lead to lost telemetry data during application shutdown.
Now users can store the SDK instance and call shutdown when needed.

Example:

```typescript
const sdk = registerOTel("service-name");
process.on('SIGTERM', async () => {
  await sdk.shutdown();
});
```
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Feb 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
otel-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 3, 2025 3:55pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant