Get started with LangWatch TypeScript SDK in 5 minutes
@ai-sdk/openai
and ai
packages are only required for the example in this guide. You can skip this step if you’re only looking to install the LangWatch SDK.app.ts
:
greetUser
function executionsetupObservability
function returns an ObservabilityHandle
that provides a shutdown
method for graceful cleanup. This ensures all pending traces are exported before your application terminates.
SIGTERM
signal:
SIGTERM
or need custom shutdown logic, you can manually call the shutdown method:
shutdown()
before your application exits to prevent data loss. The method is safe to call multiple times.shutdown()
, some traces may be lost when your application terminates abruptly.No traces appearing in dashboard
setupObservability
is called before any tracingHigh memory usage
processorType: 'batch'
Performance impact