Installation
This guide gets you from zero to a visible trace in the Boson web app. Instrumentation uses Boson’s open-source SDK against Boson’s official backend (see Introduction for how Cloud, SDKs, and licensing relate).
Prerequisites
- Node.js 18+
- A Boson API key
- A running app or a small script where you can make one model call
Install the SDK (JavaScript/TypeScript)
pnpm add @getboson/sdk @opentelemetry/sdk-node
Configure environment
The Boson SDKs are Langfuse-compatible and use Langfuse-style environment variables (Boson Cloud accepts them).
LANGFUSE_BASE_URL: base URL of your Boson backend (Boson Cloud or customer-deployed Boson)LANGFUSE_PUBLIC_KEY: project public keyLANGFUSE_SECRET_KEY: project secret key
Set your API key in your environment:
LANGFUSE_BASE_URL=https://app.getboson.com
LANGFUSE_PUBLIC_KEY=...
LANGFUSE_SECRET_KEY=...
Send a trace (minimal example)
The pattern is:
- Create a client
- Start a trace
- Add spans for important steps (LLM call, retrieval, tools)
- End the trace so it appears in the UI
import { NodeSDK } from "@opentelemetry/sdk-node"
import { LangfuseSpanProcessor, observe, propagateAttributes } from "@getboson/sdk"
async function main() {
const spanProcessor = new LangfuseSpanProcessor()
const sdk = new NodeSDK({ spanProcessor, instrumentations: [] })
await sdk.start()
const run = observe(
async () => {
return { ok: true, at: new Date().toISOString() }
},
{
name: "getting-started-handshake",
asType: "span",
captureInput: true,
captureOutput: true,
},
)
try {
await propagateAttributes(
{
traceName: "getting-started",
metadata: { env: process.env.NODE_ENV ?? "development" },
},
() => run(),
)
await spanProcessor.forceFlush()
} finally {
await spanProcessor.shutdown()
await sdk.shutdown()
}
}
main().catch((e) => {
console.error(e)
process.exitCode = 1
})
Verify in the UI
- Open the Boson app and go to Traces
- Filter by trace name:
getting-started - Click into the trace and confirm you see:
- the
llm.callspan - the
input/outputevents (or whatever you captured)
- the
Production checklist (recommended)
- Use stable identifiers:
userId,sessionId, and any request id you already have - Redact or hash sensitive fields (PII, secrets) before sending
- Add tags/metadata you’ll filter on (environment, release, model, feature flag)
Next steps
- Read Product / Tracing to decide what to capture consistently
- Set up Evaluations once you have 20–100 representative examples
// TODO: add real example