diff --git a/.github/workflows/openinference-typescript-docs.yml b/.github/workflows/openinference-typescript-docs.yml
new file mode 100644
index 000000000..3d0d35fcd
--- /dev/null
+++ b/.github/workflows/openinference-typescript-docs.yml
@@ -0,0 +1,43 @@
+name: OpenInference TypeScript documentation
+
+on:
+ pull_request:
+ branches: [main]
+ paths:
+ - src/pages/docs/integrations/import/openinference.mdx
+ - scripts/openinference-typescript-page.test.mjs
+ - examples/import/openinference-typescript/**
+ - .github/workflows/openinference-typescript-docs.yml
+
+permissions:
+ contents: read
+
+jobs:
+ native-typescript:
+ name: Native TypeScript (${{ matrix.versions }}, Node ${{ matrix.node }})
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+ strategy:
+ fail-fast: false
+ matrix:
+ node: ['22.15.0', '24']
+ versions: [floor, current]
+ defaults:
+ run:
+ working-directory: examples/import/openinference-typescript
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: ${{ matrix.node }}
+ - name: Install released dependencies
+ run: npm ci --ignore-scripts --no-audit --no-fund
+ - name: Install declared floors
+ if: matrix.versions == 'floor'
+ run: npm install --ignore-scripts --no-audit --no-fund --no-save --package-lock=false @arizeai/openinference-core@2.8.0 typescript@5.9.3
+ - name: Execute the documented snippet with loopback networking only
+ run: |
+ sudo env PATH="$PATH" unshare --net sh -ec '
+ ip link set lo up
+ npm test
+ '
diff --git a/examples/import/openinference-typescript/native.test.mjs b/examples/import/openinference-typescript/native.test.mjs
new file mode 100644
index 000000000..79d52b2d9
--- /dev/null
+++ b/examples/import/openinference-typescript/native.test.mjs
@@ -0,0 +1,156 @@
+import assert from 'node:assert/strict';
+import { spawn } from 'node:child_process';
+import { once } from 'node:events';
+import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
+import { createServer } from 'node:http';
+import { join } from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { after, before, test } from 'node:test';
+
+const root = fileURLToPath(new URL('.', import.meta.url));
+const page = await readFile(new URL('../../../src/pages/docs/integrations/import/openinference.mdx', import.meta.url), 'utf8');
+const tab = page.split('')[1]?.split('')[0] ?? '';
+const source = tab.match(/```typescript\n([\s\S]*?)```/)?.[1];
+assert.ok(source, 'The TypeScript example must be extracted from the customer page');
+let directory;
+
+// Do not pass developer credentials, tracing settings or NODE_OPTIONS to the app.
+function cleanEnv(extra = {}) {
+ return { PATH: process.env.PATH, SYSTEMROOT: process.env.SYSTEMROOT, ...extra };
+}
+
+function execute(command, args, env = {}) {
+ return new Promise((resolve, reject) => {
+ const child = spawn(command, args, { cwd: root, env: cleanEnv(env), stdio: ['ignore', 'pipe', 'pipe'] });
+ let stdout = '';
+ let stderr = '';
+ child.stdout.on('data', data => { stdout += data; });
+ child.stderr.on('data', data => { stderr += data; });
+ const timer = setTimeout(() => { child.kill('SIGKILL'); reject(new Error('Example timed out')); }, 30_000);
+ child.once('error', error => { clearTimeout(timer); reject(error); });
+ child.once('close', code => { clearTimeout(timer); resolve({ code, stdout, stderr }); });
+ });
+}
+
+before(async () => {
+ directory = await mkdtemp(join(root, '.native-'));
+ await writeFile(join(directory, 'app.mts'), source);
+ // Exercise upstream wrapper error behavior without adding a failing example to the guide.
+ const failing = source.replace('return location === "rooftop" ? this.plant : "mint";',
+ 'throw new Error("synthetic-tool-error");');
+ assert.notEqual(failing, source, 'Error fixture must replace the documented tool body');
+ await writeFile(join(directory, 'error.mts'), failing);
+ const config = tab.match(/```json\n([\s\S]*?)```/)?.[1];
+ assert.ok(config, 'Compile with the exact documented tsconfig');
+ await writeFile(join(directory, 'tsconfig.json'), config);
+ const result = await execute(join(root, 'node_modules/.bin/tsc'), ['-p', directory]);
+ assert.equal(result.code, 0, `Snippet must compile without skipLibCheck: ${result.stdout}\n${result.stderr}`);
+});
+after(async () => { if (directory) await rm(directory, { recursive: true, force: true }); });
+
+function attributes(entries = []) {
+ return Object.fromEntries(entries.map(({ key, value }) => [key, value.stringValue ?? value.intValue ?? value.boolValue]));
+}
+
+async function capture(t, { filename = 'app', hidden = false, configured = true } = {}) {
+ const requests = [];
+ const server = createServer(async (req, res) => {
+ const chunks = [];
+ for await (const chunk of req) chunks.push(chunk);
+ requests.push({ path: req.url, headers: req.headers, method: req.method, body: Buffer.concat(chunks).toString('utf8') });
+ res.writeHead(200, { 'content-type': 'application/json' });
+ res.end('{}');
+ });
+ server.listen(0, '127.0.0.1');
+ await once(server, 'listening');
+ t.after(() => new Promise(resolve => server.close(resolve)));
+ const env = configured ? {
+ FI_BASE_URL: `http://127.0.0.1:${server.address().port}/tracer/`,
+ FI_API_KEY: 'synthetic-api-key', FI_SECRET_KEY: 'synthetic-secret-key',
+ } : {};
+ if (hidden) {
+ env.OPENINFERENCE_HIDE_INPUTS = 'true';
+ env.OPENINFERENCE_HIDE_OUTPUTS = 'true';
+ }
+ const result = await execute(process.execPath, [join(directory, 'dist', `${filename}.mjs`)], env);
+ const spans = [];
+ for (const request of requests) {
+ assert.equal(request.method, 'POST');
+ assert.equal(request.path, '/tracer/v1/traces');
+ assert.equal(request.headers['x-api-key'], 'synthetic-api-key');
+ assert.equal(request.headers['x-secret-key'], 'synthetic-secret-key');
+ assert.match(request.headers['content-type'], /application\/json/);
+ const payload = JSON.parse(request.body);
+ for (const resourceSpans of payload.resourceSpans) {
+ const resource = attributes(resourceSpans.resource.attributes);
+ assert.equal(resource.project_name, 'my-openinference-project');
+ assert.equal(resource.project_type, 'observe');
+ assert.equal(resource['service.name'], 'garden-planner');
+ for (const scope of resourceSpans.scopeSpans) spans.push(...scope.spans);
+ }
+ }
+ return { ...result, requests, spans };
+}
+
+function assertTree(spans, status) {
+ assert.equal(spans.length, 2, 'One agent and one tool, without duplicate instrumentation');
+ const agent = spans.find(span => span.name === 'garden-planner');
+ const tool = spans.find(span => span.name === 'choose-plant');
+ assert.ok(agent);
+ assert.ok(tool);
+ assert.equal(attributes(agent.attributes)['openinference.span.kind'], 'AGENT');
+ assert.equal(attributes(tool.attributes)['openinference.span.kind'], 'TOOL');
+ assert.equal(tool.traceId, agent.traceId);
+ assert.equal(tool.parentSpanId, agent.spanId);
+ assert.ok(!agent.parentSpanId || /^0+$/.test(agent.parentSpanId));
+ for (const span of spans) {
+ assert.equal(span.status.code, status);
+ assert.ok(BigInt(span.endTimeUnixNano) >= BigInt(span.startTimeUnixNano));
+ }
+ return { agent, tool };
+}
+
+test('the exact documented snippet compiles and exports a native agent/tool tree', async t => {
+ const result = await capture(t);
+ assert.equal(result.code, 0, result.stderr);
+ assert.equal(result.stdout.trim(), 'Plant rosemary in your rooftop garden.');
+ const { agent, tool } = assertTree(result.spans, 1);
+ assert.ok(attributes(agent.attributes)['input.value'].includes('rooftop'));
+ assert.ok(attributes(tool.attributes)['input.value'].includes('rooftop'));
+ assert.equal(attributes(agent.attributes)['output.value'], 'Plant rosemary in your rooftop garden.');
+ assert.equal(attributes(tool.attributes)['output.value'], 'rosemary');
+});
+
+test('native input/output privacy switches redact the wire payload', async t => {
+ const result = await capture(t, { hidden: true });
+ assert.equal(result.code, 0, result.stderr);
+ assertTree(result.spans, 1);
+ for (const span of result.spans) {
+ const attrs = attributes(span.attributes);
+ assert.equal(attrs['input.value'], '__REDACTED__');
+ assert.equal(attrs['output.value'], '__REDACTED__');
+ }
+ for (const request of result.requests) assert.doesNotMatch(request.body, /rooftop|rosemary/);
+});
+
+test('rejected tool calls propagate ERROR and still flush both spans', async t => {
+ const result = await capture(t, { filename: 'error', hidden: true });
+ assert.notEqual(result.code, 0);
+ assert.match(result.stderr, /synthetic-tool-error/);
+ assertTree(result.spans, 2);
+ for (const span of result.spans) {
+ assert.equal(attributes(span.attributes)['input.value'], '__REDACTED__');
+ assert.equal(span.status.message, 'synthetic-tool-error');
+ const exception = span.events.find(event => event.name === 'exception');
+ assert.ok(exception, 'Privacy documentation must not promise exception redaction');
+ assert.equal(attributes(exception.attributes)['exception.message'], 'synthetic-tool-error');
+ assert.match(attributes(exception.attributes)['exception.stacktrace'], /synthetic-tool-error/);
+ }
+});
+
+test('missing credentials stop the example before exporting', async t => {
+ const result = await capture(t, { configured: false });
+ assert.notEqual(result.code, 0);
+ assert.match(result.stderr, /Set FI_BASE_URL, FI_API_KEY and FI_SECRET_KEY/);
+ assert.equal(result.requests.length, 0);
+});
diff --git a/examples/import/openinference-typescript/package-lock.json b/examples/import/openinference-typescript/package-lock.json
new file mode 100644
index 000000000..d172d4afa
--- /dev/null
+++ b/examples/import/openinference-typescript/package-lock.json
@@ -0,0 +1,670 @@
+{
+ "name": "openinference-typescript-docs-test",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "openinference-typescript-docs-test",
+ "dependencies": {
+ "@arizeai/openinference-core": "2.8.1",
+ "@opentelemetry/api": "1.10.0",
+ "@opentelemetry/context-async-hooks": "3.0.0",
+ "@opentelemetry/exporter-trace-otlp-http": "0.300.0",
+ "@opentelemetry/resources": "3.0.0",
+ "@opentelemetry/sdk-trace": "3.0.0"
+ },
+ "devDependencies": {
+ "@types/node": "22.19.0",
+ "typescript": "7.0.2"
+ }
+ },
+ "node_modules/@arizeai/openinference-core": {
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/@arizeai/openinference-core/-/openinference-core-2.8.1.tgz",
+ "integrity": "sha512-BdHwv5yAkvH4ZAbVMl+s4SjAS9QBaeYaMVXE3OqsbxzrGed6eKhhOXp+p3Yj/+0cIfvjMubEviH1/hObZ/wUJg==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@arizeai/openinference-semantic-conventions": "2.15.0",
+ "@opentelemetry/api": "^1.9.0",
+ "@opentelemetry/core": "^2.8.0"
+ }
+ },
+ "node_modules/@arizeai/openinference-core/node_modules/@opentelemetry/api": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.1.tgz",
+ "integrity": "sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
+ "node_modules/@arizeai/openinference-core/node_modules/@opentelemetry/core": {
+ "version": "2.12.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.12.0.tgz",
+ "integrity": "sha512-1HsSAuvT4/my0QrXWsyXFdWjKaPeCHsismKZgEEIb8NK13LP6DrMRlsUbvD/0F9mDWK3xDom9AMv3IscxgOnOQ==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@opentelemetry/semantic-conventions": "^1.29.0"
+ },
+ "engines": {
+ "node": "^18.19.0 || >=20.6.0"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": ">=1.0.0 <1.10.0"
+ }
+ },
+ "node_modules/@arizeai/openinference-semantic-conventions": {
+ "version": "2.15.0",
+ "resolved": "https://registry.npmjs.org/@arizeai/openinference-semantic-conventions/-/openinference-semantic-conventions-2.15.0.tgz",
+ "integrity": "sha512-apIjbl1CqPEXPfvft5rNn7VpxjbktkvAwOJMhhrl6OMsSBwiOK7uf5qFFz0RI3IePa3xldn7TmiAkJMiRN2hug==",
+ "license": "Apache-2.0"
+ },
+ "node_modules/@opentelemetry/api": {
+ "version": "1.10.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.10.0.tgz",
+ "integrity": "sha512-lMkyes8iHrG+mk6WH7X70MdCLI2RS0FwNBY1PyQ8UemaijE2m5mv5A0Niy3HtbYTFrgkUEQjFMXmSAk2hQDuPQ==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
+ "node_modules/@opentelemetry/context-async-hooks": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-3.0.0.tgz",
+ "integrity": "sha512-qDZeKSgTT+qTaL99eRbpvWO5+oZ0MKvMH4pqvzi6xYKyhiMTDBxBeTLI6BpdeMt58T5TpxHJvFl9P52i6CDWGA==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=22.15.0"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": ">=1.0.0 <1.11.0"
+ }
+ },
+ "node_modules/@opentelemetry/core": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-3.0.0.tgz",
+ "integrity": "sha512-whOLlww0R/RLtCWGBXhK1fdvL9t2/TL0fqdjZvcaoUUuNilRPjXecqQdzyVwV68s6XEDA5oYbm7/bZT62GXF4A==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@opentelemetry/semantic-conventions": "^1.29.0"
+ },
+ "engines": {
+ "node": ">=22.15.0"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": ">=1.10.0 <1.11.0"
+ }
+ },
+ "node_modules/@opentelemetry/exporter-trace-otlp-http": {
+ "version": "0.300.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.300.0.tgz",
+ "integrity": "sha512-Dwdagba93cdhROlFGbkU4yK4hvd3l0k7WV9nvTWIoN6KwxFP+HCvy9EkgIpyfN11fVdIWxY3XqOwWOq83OPfcA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@opentelemetry/otlp-exporter-base": "0.300.0",
+ "@opentelemetry/otlp-transformer": "0.300.0",
+ "@opentelemetry/sdk-trace": "3.0.0"
+ },
+ "engines": {
+ "node": ">=22.15.0"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": "^1.3.0"
+ }
+ },
+ "node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/otlp-transformer": {
+ "version": "0.300.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.300.0.tgz",
+ "integrity": "sha512-T55lRmjRwvXWyTFdy/BbJ3T5RRsq3bAwQgxxA7qHFxgRd4+pZzRk02ZwOFsYK5072OXGYjYFNJcp68eQV4i0Ig==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@opentelemetry/core": "3.0.0",
+ "@opentelemetry/resources": "3.0.0",
+ "@opentelemetry/sdk-logs": "3.0.0",
+ "@opentelemetry/sdk-metrics": "3.0.0",
+ "@opentelemetry/sdk-trace": "3.0.0"
+ },
+ "engines": {
+ "node": ">=22.15.0"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": ">=1.10.0 <1.11.0"
+ }
+ },
+ "node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/sdk-logs": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-3.0.0.tgz",
+ "integrity": "sha512-IysNZWrBk2PqYw4qU9PZcC7pjrZLa+KLk7vcLmPPNBUr97MgeamWhX0DUHsmxwJv3dnjYM6mLRmP8mw69ld+dA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@opentelemetry/core": "3.0.0",
+ "@opentelemetry/resources": "3.0.0",
+ "@opentelemetry/semantic-conventions": "^1.29.0"
+ },
+ "engines": {
+ "node": ">=22.15.0"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": ">=1.10.0 <1.11.0"
+ }
+ },
+ "node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/sdk-metrics": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-3.0.0.tgz",
+ "integrity": "sha512-YozyS2rIlizvUNLZwcWxH0x2FhX02/mcZwzM8hsl8yvQk+xeKmAc7vcSieWiO4oSwIB20B8eS/zwdopAd/J5zQ==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@opentelemetry/core": "3.0.0",
+ "@opentelemetry/resources": "3.0.0"
+ },
+ "engines": {
+ "node": ">=22.15.0"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": ">=1.10.0 <1.11.0"
+ }
+ },
+ "node_modules/@opentelemetry/otlp-exporter-base": {
+ "version": "0.300.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.300.0.tgz",
+ "integrity": "sha512-D+PhzYURtv6p7Kk1rUrilLtV+ZvS218tI0jiKTV5z1agOeELw78C+cFd3o9UUshUx1j+EIpFM62yGk8BuydQvg==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@opentelemetry/core": "3.0.0",
+ "@opentelemetry/otlp-transformer": "0.300.0"
+ },
+ "engines": {
+ "node": ">=22.15.0"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": "^1.3.0"
+ }
+ },
+ "node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/otlp-transformer": {
+ "version": "0.300.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.300.0.tgz",
+ "integrity": "sha512-T55lRmjRwvXWyTFdy/BbJ3T5RRsq3bAwQgxxA7qHFxgRd4+pZzRk02ZwOFsYK5072OXGYjYFNJcp68eQV4i0Ig==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@opentelemetry/core": "3.0.0",
+ "@opentelemetry/resources": "3.0.0",
+ "@opentelemetry/sdk-logs": "3.0.0",
+ "@opentelemetry/sdk-metrics": "3.0.0",
+ "@opentelemetry/sdk-trace": "3.0.0"
+ },
+ "engines": {
+ "node": ">=22.15.0"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": ">=1.10.0 <1.11.0"
+ }
+ },
+ "node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/sdk-logs": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-3.0.0.tgz",
+ "integrity": "sha512-IysNZWrBk2PqYw4qU9PZcC7pjrZLa+KLk7vcLmPPNBUr97MgeamWhX0DUHsmxwJv3dnjYM6mLRmP8mw69ld+dA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@opentelemetry/core": "3.0.0",
+ "@opentelemetry/resources": "3.0.0",
+ "@opentelemetry/semantic-conventions": "^1.29.0"
+ },
+ "engines": {
+ "node": ">=22.15.0"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": ">=1.10.0 <1.11.0"
+ }
+ },
+ "node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/sdk-metrics": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-3.0.0.tgz",
+ "integrity": "sha512-YozyS2rIlizvUNLZwcWxH0x2FhX02/mcZwzM8hsl8yvQk+xeKmAc7vcSieWiO4oSwIB20B8eS/zwdopAd/J5zQ==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@opentelemetry/core": "3.0.0",
+ "@opentelemetry/resources": "3.0.0"
+ },
+ "engines": {
+ "node": ">=22.15.0"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": ">=1.10.0 <1.11.0"
+ }
+ },
+ "node_modules/@opentelemetry/resources": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-3.0.0.tgz",
+ "integrity": "sha512-4762KVmlDroRIt+4Ra8AnwcQqdXlkAR55jDrhzna8bzhJx1mUzvHW/Lh/OemFuY9+ouM4xaDc6CbUmoJmM6BFg==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@opentelemetry/core": "3.0.0",
+ "@opentelemetry/semantic-conventions": "^1.29.0"
+ },
+ "engines": {
+ "node": ">=22.15.0"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": ">=1.10.0 <1.11.0"
+ }
+ },
+ "node_modules/@opentelemetry/sdk-trace": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace/-/sdk-trace-3.0.0.tgz",
+ "integrity": "sha512-4T0DbDGdtsjNmYK5/lNalHro4fsMZ0UZ3JE+C8fcqYP25xaJC22FHg8kdJNJ21srjJY5XoT7WNFCtj88NNTl4Q==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@opentelemetry/core": "3.0.0",
+ "@opentelemetry/resources": "3.0.0",
+ "@opentelemetry/semantic-conventions": "^1.29.0"
+ },
+ "engines": {
+ "node": ">=22.15.0"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": ">=1.10.0 <1.11.0"
+ }
+ },
+ "node_modules/@opentelemetry/semantic-conventions": {
+ "version": "1.44.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.44.0.tgz",
+ "integrity": "sha512-E3JkOlMBi3N8OGGkbl7tFyqk2MAS6/lySRZBK3Mu7AzjF1fT8oIChH9ChE48SUWzDn9Kdwta+G/p5LJ4xW4CLQ==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=14"
+ }
+ },
+ "node_modules/@types/node": {
+ "version": "22.19.0",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.0.tgz",
+ "integrity": "sha512-xpr/lmLPQEj+TUnHmR+Ab91/glhJvsqcjB+yY0Ix9GO70H6Lb4FHH5GeqdOE5btAx7eIMwuHkp4H2MSkLcqWbA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "undici-types": "~6.21.0"
+ }
+ },
+ "node_modules/@typescript/typescript-aix-ppc64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz",
+ "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-darwin-arm64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz",
+ "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-darwin-x64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz",
+ "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-freebsd-arm64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz",
+ "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-freebsd-x64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz",
+ "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-linux-arm": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz",
+ "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-linux-arm64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz",
+ "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-linux-loong64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz",
+ "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-linux-mips64el": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz",
+ "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-linux-ppc64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz",
+ "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-linux-riscv64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz",
+ "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-linux-s390x": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz",
+ "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-linux-x64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz",
+ "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-netbsd-arm64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz",
+ "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-netbsd-x64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz",
+ "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-openbsd-arm64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz",
+ "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-openbsd-x64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz",
+ "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-sunos-x64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz",
+ "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-win32-arm64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz",
+ "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-win32-x64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz",
+ "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/typescript": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz",
+ "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "tsc": "bin/tsc"
+ },
+ "engines": {
+ "node": ">=16.20.0"
+ },
+ "optionalDependencies": {
+ "@typescript/typescript-aix-ppc64": "7.0.2",
+ "@typescript/typescript-darwin-arm64": "7.0.2",
+ "@typescript/typescript-darwin-x64": "7.0.2",
+ "@typescript/typescript-freebsd-arm64": "7.0.2",
+ "@typescript/typescript-freebsd-x64": "7.0.2",
+ "@typescript/typescript-linux-arm": "7.0.2",
+ "@typescript/typescript-linux-arm64": "7.0.2",
+ "@typescript/typescript-linux-loong64": "7.0.2",
+ "@typescript/typescript-linux-mips64el": "7.0.2",
+ "@typescript/typescript-linux-ppc64": "7.0.2",
+ "@typescript/typescript-linux-riscv64": "7.0.2",
+ "@typescript/typescript-linux-s390x": "7.0.2",
+ "@typescript/typescript-linux-x64": "7.0.2",
+ "@typescript/typescript-netbsd-arm64": "7.0.2",
+ "@typescript/typescript-netbsd-x64": "7.0.2",
+ "@typescript/typescript-openbsd-arm64": "7.0.2",
+ "@typescript/typescript-openbsd-x64": "7.0.2",
+ "@typescript/typescript-sunos-x64": "7.0.2",
+ "@typescript/typescript-win32-arm64": "7.0.2",
+ "@typescript/typescript-win32-x64": "7.0.2"
+ }
+ },
+ "node_modules/undici-types": {
+ "version": "6.21.0",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
+ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
+ "dev": true,
+ "license": "MIT"
+ }
+ }
+}
diff --git a/examples/import/openinference-typescript/package.json b/examples/import/openinference-typescript/package.json
new file mode 100644
index 000000000..928e86fa7
--- /dev/null
+++ b/examples/import/openinference-typescript/package.json
@@ -0,0 +1,20 @@
+{
+ "name": "openinference-typescript-docs-test",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "test": "node --test ../../../scripts/openinference-typescript-page.test.mjs native.test.mjs"
+ },
+ "dependencies": {
+ "@arizeai/openinference-core": "2.8.1",
+ "@opentelemetry/api": "1.10.0",
+ "@opentelemetry/context-async-hooks": "3.0.0",
+ "@opentelemetry/exporter-trace-otlp-http": "0.300.0",
+ "@opentelemetry/resources": "3.0.0",
+ "@opentelemetry/sdk-trace": "3.0.0"
+ },
+ "devDependencies": {
+ "@types/node": "22.19.0",
+ "typescript": "7.0.2"
+ }
+}
diff --git a/scripts/openinference-typescript-page.test.mjs b/scripts/openinference-typescript-page.test.mjs
new file mode 100644
index 000000000..fd80c45e2
--- /dev/null
+++ b/scripts/openinference-typescript-page.test.mjs
@@ -0,0 +1,47 @@
+import { test } from 'node:test';
+import assert from 'node:assert/strict';
+import { readFileSync } from 'node:fs';
+
+const page = readFileSync(new URL('../src/pages/docs/integrations/import/openinference.mdx', import.meta.url), 'utf8');
+const typescript = page.split('')[1]?.split('')[0] ?? '';
+
+test('OpenInference offers released native TypeScript wrappers and standard decorators', () => {
+ assert.ok(typescript, 'Missing native TypeScript setup');
+ assert.match(typescript, /@arizeai\/openinference-core@2\.8\.1/);
+ assert.match(typescript, /2\.8\.0 or later/);
+ assert.match(typescript, /traceAgent\(/);
+ assert.match(typescript, /@observe\(/);
+ assert.match(typescript, /standard decorators/);
+ assert.doesNotMatch(typescript, /@traceai\/|class .*Exporter/);
+});
+
+test('TypeScript owns one exporter, routes the project, and flushes on exit', () => {
+ assert.equal((typescript.match(/new OTLPTraceExporter\(/g) ?? []).length, 1);
+ for (const value of ['"project_name": "my-openinference-project"', '"project_type": "observe"',
+ '"X-Api-Key": process.env.FI_API_KEY', '"X-Secret-Key": process.env.FI_SECRET_KEY',
+ 'https://api.futureagi.com/tracer', '/v1/traces']) {
+ assert.ok(typescript.includes(value), `Missing ${value}`);
+ }
+ assert.match(typescript, /finally\s*{\s*await provider\.shutdown\(\)/);
+ assert.match(typescript, /Do not.*second exporter/);
+ assert.match(typescript, /openinference\.project\.name/);
+});
+
+test('TypeScript explains native content controls without promising exception redaction', () => {
+ assert.match(typescript, /new OITracer\(/);
+ assert.match(typescript, /traceConfig: \{\}/);
+ assert.match(typescript, /@observe\(\{ tracer,/);
+ assert.match(typescript, /\}, \{ tracer, name: "garden-planner" \}\)/);
+ assert.match(typescript, /OPENINFERENCE_HIDE_INPUTS=true/);
+ assert.match(typescript, /OPENINFERENCE_HIDE_OUTPUTS=true/);
+ assert.match(typescript, /exception messages.*status.*events/is);
+ assert.match(typescript, /FI_HIDE_\*/);
+ assert.match(typescript, /does not.*model names or token usage/is);
+});
+
+test('Existing Python and Java routes remain intact', () => {
+ assert.match(page, //);
+ assert.match(page, /OpenAIInstrumentor\(\)\.instrument\(tracer_provider=provider\)/);
+ assert.match(page, //);
+ assert.match(page, /OpenInferenceAgent\.register\(new OITracer/);
+});
diff --git a/src/lib/integrations.mjs b/src/lib/integrations.mjs
index ae406302f..c3868743d 100644
--- a/src/lib/integrations.mjs
+++ b/src/lib/integrations.mjs
@@ -41,7 +41,7 @@ export const integrations = [
{ id: 'cloudflare-think', name: 'Cloudflare Think', href: '/docs/integrations/frameworks/cloudflare-think', category: 'frameworks', summary: 'Forward native Worker agent spans through a privacy-filtering collector.', method: 'Native OTLP', logo: 'generic-framework' },
{ id: 'openrouter-broadcast', name: 'OpenRouter Broadcast', href: '/docs/integrations/gateways/openrouter-broadcast', category: 'gateways', summary: 'Forward native Broadcast traces through a privacy-filtering collector.', method: 'Native OTLP', logo: 'generic-framework' },
{ id: 'everos', name: 'EverOS', href: '/docs/integrations/traceai/everos', category: 'frameworks', summary: 'Export version-scoped memory-server spans to self-hosted Future AGI.', method: 'Native OTLP', logo: 'generic-framework' },
- { id: 'openinference', name: 'OpenInference', href: '/docs/integrations/import/openinference', category: 'frameworks', summary: 'Send the qualified Python OpenAI instrumentor spans over OTLP.', method: 'OpenInference SDK', logo: 'generic-framework' },
+ { id: 'openinference', name: 'OpenInference', href: '/docs/integrations/import/openinference', category: 'frameworks', summary: 'Send native Python, TypeScript and Java OpenInference spans over OTLP.', method: 'OpenInference SDK', logo: 'generic-framework' },
{ id: 'oh-my-pi', name: 'Oh My Pi', href: '/docs/integrations/coding-agents/oh-my-pi', category: 'coding', summary: 'Trace omp sessions with the version-scoped local hook.', method: 'omp hook', logo: 'generic-framework' },
{ id: 'claude-code', name: 'Claude Code', href: '/docs/integrations/coding-agents/claude-code', category: 'coding', summary: 'Forward native CLI telemetry through a privacy-filtering collector.', method: 'Native OTLP', logo: 'generic-framework' },
{ id: 'pi', name: 'Pi', href: '/docs/integrations/coding-agents/pi', category: 'coding', summary: 'Trace upstream Pi sessions through a local extension.', method: 'Pi extension', logo: 'generic-framework' },
diff --git a/src/pages/docs/integrations/import/openinference.mdx b/src/pages/docs/integrations/import/openinference.mdx
index e450f193d..b35980a63 100644
--- a/src/pages/docs/integrations/import/openinference.mdx
+++ b/src/pages/docs/integrations/import/openinference.mdx
@@ -1,9 +1,9 @@
---
title: "Send OpenInference spans to Future AGI"
-description: "Export Python OpenAI traces or Java annotation spans from OpenInference to Future AGI over OTLP/HTTP."
+description: "Export Python OpenAI traces, TypeScript function spans or Java annotation spans from OpenInference to Future AGI over OTLP/HTTP."
---
-Send [OpenInference](https://github.com/Arize-ai/openinference) spans to **Observe** using a standard OTLP/HTTP exporter. Choose Python for OpenAI text calls or Java for annotated application methods. Neither route needs a Future AGI instrumentation package.
+Send [OpenInference](https://github.com/Arize-ai/openinference) spans to **Observe** using a standard OTLP/HTTP exporter. Choose Python for OpenAI text calls, TypeScript for application functions and methods, or Java for annotated methods. These routes use native OpenInference packages, without a Future AGI instrumentation package.
Use the collector endpoint below, not the retired Django OTLP route (`/api/public/otel/...`).
@@ -124,6 +124,138 @@ These settings replace `input.value` and `output.value` with `__REDACTED__` and
- Retriever documents are not shown in the output column.
- Other Python OpenInference instrumentors may emit different attributes.
+
+
+
+Use [OpenInference Core](https://github.com/Arize-ai/openinference/tree/main/js/packages/openinference-core) to trace application functions with `traceAgent` and class methods with `@observe`. These APIs create OpenTelemetry spans directly; you do not need a tracing adapter or model-provider key for this example.
+
+### Install the TypeScript dependencies
+
+Use Node.js 22.15 or later, TypeScript 5.9.3 or later and OpenInference Core 2.8.0 or later. This example uses TypeScript's standard decorators, not legacy experimental decorators. Run these commands in a new project directory:
+
+```bash
+npm init -y
+npm install @arizeai/openinference-core@2.8.1 @opentelemetry/api@1.10.0 \
+ @opentelemetry/sdk-trace@3.0.0 @opentelemetry/resources@3.0.0 \
+ @opentelemetry/context-async-hooks@3.0.0 @opentelemetry/exporter-trace-otlp-http@0.300.0
+npm install --save-dev typescript@7.0.2 @types/node@22.19.0
+```
+
+### Configure and run the application
+
+Set your collector URL and credentials before starting Node.js:
+
+```bash
+export FI_BASE_URL="https://api.futureagi.com/tracer"
+export FI_API_KEY="your-futureagi-api-key"
+export FI_SECRET_KEY="your-futureagi-secret-key"
+```
+
+For self-hosted Future AGI, replace `FI_BASE_URL` with your collector base URL. The exporter appends `/v1/traces`. Set `project_name` on the resource as shown: OpenInference's `openinference.project.name` is not a substitute for Future AGI's project routing attribute.
+
+Save this as `app.mts`. Register the provider before calling traced functions. OpenInference captures arguments and return values by default; see [TypeScript content and errors](#typescript-content-and-errors) before processing sensitive data.
+
+```typescript
+import { OITracer, observe, traceAgent } from "@arizeai/openinference-core";
+import { context, trace } from "@opentelemetry/api";
+import { AsyncLocalStorageContextManager } from "@opentelemetry/context-async-hooks";
+import { resourceFromAttributes } from "@opentelemetry/resources";
+import { BatchSpanProcessor, TracerProvider } from "@opentelemetry/sdk-trace";
+import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
+
+if (!process.env.FI_BASE_URL || !process.env.FI_API_KEY || !process.env.FI_SECRET_KEY) {
+ throw new Error("Set FI_BASE_URL, FI_API_KEY and FI_SECRET_KEY");
+}
+
+const provider = new TracerProvider({
+ resource: resourceFromAttributes({
+ "service.name": "garden-planner",
+ "project_name": "my-openinference-project",
+ "project_type": "observe",
+ }),
+ spanProcessors: [new BatchSpanProcessor({
+ exporter: new OTLPTraceExporter({
+ url: process.env.FI_BASE_URL.replace(/\/+$/, "") + "/v1/traces",
+ headers: {
+ "X-Api-Key": process.env.FI_API_KEY,
+ "X-Secret-Key": process.env.FI_SECRET_KEY,
+ },
+ }),
+ })],
+});
+context.setGlobalContextManager(new AsyncLocalStorageContextManager().enable());
+trace.setGlobalTracerProvider(provider);
+const tracer = new OITracer({
+ tracer: provider.getTracer("garden-app"),
+ traceConfig: {},
+});
+
+class GardenService {
+ private plant = "rosemary";
+
+ @observe({ tracer, name: "choose-plant", kind: "TOOL" })
+ async choosePlant(location: string): Promise {
+ return location === "rooftop" ? this.plant : "mint";
+ }
+}
+
+const garden = new GardenService();
+const planGarden = traceAgent(async (location: string) => {
+ const plant = await garden.choosePlant(location);
+ return `Plant ${plant} in your ${location} garden.`;
+}, { tracer, name: "garden-planner" });
+
+try {
+ console.log(await planGarden("rooftop"));
+} finally {
+ await provider.shutdown();
+}
+```
+
+Save this as `tsconfig.json`. The `.mts` extension produces an ES module and the compiler handles the standard decorator:
+
+```json
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "NodeNext",
+ "strict": true,
+ "types": ["node"],
+ "outDir": "dist"
+ },
+ "include": ["*.mts"]
+}
+```
+
+Compile and run from the project directory:
+
+```bash
+npx tsc -p .
+node dist/app.mjs
+```
+
+Open **Observe** and select `my-openinference-project`. Each run produces one `garden-planner` agent span with one `choose-plant` tool child, including their inputs and outputs. The application prints a planting suggestion without calling an LLM. Labelling a function `LLM` does not discover model names or token usage; use a provider-specific OpenInference instrumentor for automatic model tracing.
+
+Do not add a second exporter or wrap an operation that your framework already instruments. If your application already has a registered OpenTelemetry provider, configure its existing exporter for Future AGI and reuse that provider rather than creating another one. For servers, call `shutdown()` during graceful process shutdown, not after each request.
+
+### TypeScript content and errors
+
+To hide arguments and return values, set these variables before starting the application:
+
+```bash
+export OPENINFERENCE_HIDE_INPUTS=true
+export OPENINFERENCE_HIDE_OUTPUTS=true
+```
+
+The `OITracer` reads these settings and replaces `input.value` and `output.value` with `__REDACTED__`. Keep `traceConfig: {}` and pass this tracer to both `traceAgent` and `@observe` as shown, so the environment settings also apply on OpenInference Core 2.8.0. Future AGI's `FI_HIDE_*` variables do not configure OpenInference. Hiding inputs and outputs does not redact exception messages: they still appear in the span status and exception events, including stack traces. Keep sensitive values out of exceptions and custom span attributes, or redact them in an OpenTelemetry Collector before export.
+
+### TypeScript troubleshooting
+
+- **No spans.** Pass the configured `OITracer` to both tracing APIs, await asynchronous work, and await `provider.shutdown()` before exiting. Wrappers without an explicit tracer use the registered global provider.
+- **Decorator compile errors.** Compile with TypeScript 5.9.3 or later using the command above. Do not enable `experimentalDecorators` for `@observe`; it uses standard decorators.
+- **HTTP 400 or 401.** Check `project_name`, `FI_BASE_URL`, and both authentication headers. Use `/tracer/v1/traces` for Cloud, not the retired Django route.
+- **Empty input/output fields.** Check `OPENINFERENCE_HIDE_INPUTS` and `OPENINFERENCE_HIDE_OUTPUTS`. These switches do not remove exception details.
+