Skip to content

Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.

feat: Enable JS SDK Injection in Controller (#1314)

Aman Agarwald138160db27a
diff --git a/examples/openai-agents-js-app/Dockerfile b/examples/openai-agents-js-app/Dockerfile
new file mode 100644
index 00000000..f62467d6
--- /dev/null
+++ b/examples/openai-agents-js-app/Dockerfile
@@ -0,0 +1,10 @@
+FROM node:22-slim
+
+WORKDIR /app
+
+COPY package*.json .
+RUN npm ci --omit=dev --no-audit --no-fund
+
+COPY app.mjs .
+
+CMD ["npm", "start"]
diff --git a/examples/openai-agents-js-app/app.mjs b/examples/openai-agents-js-app/app.mjs
new file mode 100644
index 00000000..5d0b1bef
--- /dev/null
+++ b/examples/openai-agents-js-app/app.mjs
@@ -0,0 +1,204 @@
+import { createServer } from 'node:http';
+import { randomUUID } from 'node:crypto';
+import OpenAI from 'openai';
+import {
+ Agent,
+ run,
+ setDefaultOpenAIClient,
+ setOpenAIAPI,
+ setTracingDisabled,
+ tool,
+} from '@openai/agents';
+
+const MOCK_HOST = process.env.MOCK_LLM_HOST || '127.0.0.1';
+const MOCK_PORT = Number(process.env.MOCK_LLM_PORT || 8091);
+const MODEL = process.env.AGENT_MODEL || 'gpt-4o-mini';
+const REQUEST_INTERVAL_SECONDS = Number(process.env.REQUEST_INTERVAL_SECONDS || 20);
+
+const prompts = [
+ 'Plan a practical three-step rollout for adding evals to an AI support agent.',
+ 'Summarize the operational risks of shipping a tool-using agent to production.',
+ 'Draft a concise checklist for debugging missing traces in a JavaScript agent app.',
+ 'Suggest a safe architecture for an agent that can query docs and create tickets.',
+];
+
+const toolResults = {
+ lookup_runbook:
+ 'Runbook: verify SDK preload, confirm OTLP endpoint, check service.name, inspect resource attributes.',
+ score_agent_risk:
+ 'Risk score: medium. Main controls: tool allowlists, retries, eval coverage, and trace review.',
+};
+
+function readRequestBody(req) {
+ return new Promise((resolve) => {
+ const chunks = [];
+ req.on('data', (chunk) => chunks.push(chunk));
+ req.on('end', () => {
+ const raw = Buffer.concat(chunks).toString('utf8');
+ if (!raw) return resolve({});
+ try {
+ resolve(JSON.parse(raw));
+ } catch {
+ resolve({});
+ }
+ });
+ });
+}
+
+function jsonResponse(res, status, payload) {
+ const body = JSON.stringify(payload);
+ res.writeHead(status, {
+ 'content-type': 'application/json',
+ 'content-length': Buffer.byteLength(body),
+ });
+ res.end(body);
+}
+
+function hasToolResult(messages) {
+ return Array.isArray(messages) && messages.some((message) => message.role === 'tool');
+}
+
+function buildChatCompletion(body) {
+ const id = `chatcmpl-${randomUUID().replaceAll('-', '').slice(0, 16)}`;
+ const model = body.model || MODEL;
+ const messages = body.messages || [];
+ const tools = body.tools || [];
+
+ let message;
+ let finishReason;
+ if (tools.length > 0 && !hasToolResult(messages)) {
+ const requestedTool = tools.find((item) => item?.function?.name === 'lookup_runbook') || tools[0];
+ message = {
+ role: 'assistant',
+ content: null,
+ tool_calls: [
+ {
+ id: `call_${randomUUID().replaceAll('-', '').slice(0, 10)}`,
+ type: 'function',
+ function: {
+ name: requestedTool.function.name,
+ arguments: JSON.stringify({ topic: 'agent observability' }),
+ },
+ },
+ ],
+ };
+ finishReason = 'tool_calls';
+ } else {
+ message = {
+ role: 'assistant',
+ content:
+ 'Use a controller-injected OpenLIT SDK preload, keep framework spans separate from direct LLM calls, and validate with a mock LLM before production rollout.',
+ };
+ finishReason = 'stop';
+ }
+
+ return {
+ id,
+ object: 'chat.completion',
+ created: Math.floor(Date.now() / 1000),
+ model,
+ choices: [{ index: 0, message, finish_reason: finishReason }],
+ usage: {
+ prompt_tokens: 96,
+ completion_tokens: 38,
+ total_tokens: 134,
+ prompt_tokens_details: { cached_tokens: 0 },
+ },
+ };
+}
+
+function startMockServer() {
+ const server = createServer(async (req, res) => {
+ if (req.method === 'POST' && req.url === '/v1/chat/completions') {
+ const body = await readRequestBody(req);
+ jsonResponse(res, 200, buildChatCompletion(body));
+ return;
+ }
+ if (req.method === 'GET' && req.url === '/health') {
+ jsonResponse(res, 200, { status: 'ok' });
+ return;
+ }
+ jsonResponse(res, 404, { error: 'not found' });
+ });
+
+ return new Promise((resolve) => {
+ server.listen(MOCK_PORT, MOCK_HOST, () => {
+ console.log(`[mock-llm] listening on http://${MOCK_HOST}:${MOCK_PORT}/v1`);
+ resolve(server);
+ });
+ });
+}
+
+const lookupRunbook = tool({
+ name: 'lookup_runbook',
+ description: 'Look up an internal agent-observability runbook by topic.',
+ parameters: {
+ type: 'object',
+ properties: {
+ topic: {
+ type: 'string',
+ description: 'Operational topic to look up.',
+ },
+ },
+ required: ['topic'],
+ additionalProperties: false,
+ },
+ strict: false,
+ execute: async () => toolResults.lookup_runbook,
+});
+
+const scoreAgentRisk = tool({
+ name: 'score_agent_risk',
+ description: 'Return a simple operational risk summary for an agent workflow.',
+ parameters: {
+ type: 'object',
+ properties: {
+ workflow: {
+ type: 'string',
+ description: 'Agent workflow to assess.',
+ },
+ },
+ required: ['workflow'],
+ additionalProperties: false,
+ },
+ strict: false,
+ execute: async () => toolResults.score_agent_risk,
+});
+
+await startMockServer();
+
+setOpenAIAPI('chat_completions');
+setDefaultOpenAIClient(
+ new OpenAI({
+ apiKey: 'sk-mock-not-real',
+ baseURL: `http://${MOCK_HOST}:${MOCK_PORT}/v1`,
+ }),
+);
+// Keep local mock runs quiet; controller-managed OpenLIT injection replaces
+// the Agents SDK trace processor and needs tracing enabled for framework spans.
+setTracingDisabled(process.env.OPENLIT_CONTROLLER_MODE !== 'agent_observability');
+
+const agent = new Agent({
+ name: 'js-agent-framework-demo',
+ model: MODEL,
+ instructions:
+ 'You are a production AI agent engineer. Use tools when useful, then answer with a concise operational recommendation.',
+ tools: [lookupRunbook, scoreAgentRisk],
+});
+
+console.log(
+ `[agent] OpenAI Agents JS demo starting with model='${MODEL}', interval=${REQUEST_INTERVAL_SECONDS}s`,
+);
+
+let i = 0;
+while (true) {
+ const prompt = prompts[i % prompts.length];
+ try {
+ const result = await run(agent, prompt, { maxTurns: 4 });
+ console.log(`[${i}] ${result.finalOutput}`);
+ } catch (error) {
+ console.log(`[${i}] error: ${error?.stack || error}`);
+ }
+ i += 1;
+ await new Promise((resolve) => setTimeout(resolve, REQUEST_INTERVAL_SECONDS * 1000));
+}
diff --git a/examples/openai-agents-js-app/package-lock.json b/examples/openai-agents-js-app/package-lock.json
new file mode 100644
index 00000000..c8520a71
--- /dev/null
+++ b/examples/openai-agents-js-app/package-lock.json
@@ -0,0 +1,1408 @@
+{
+ "name": "openlit-openai-agents-js-example",
+ "version": "0.1.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "openlit-openai-agents-js-example",
+ "version": "0.1.0",
+ "dependencies": {
+ "@openai/agents": "0.12.0",
+ "openai": "^6.42.0"
+ },
+ "engines": {
+ "node": ">=22.0.0"
+ }
+ },
+ "node_modules/@hono/node-server": {
+ "version": "1.19.14",
+ "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.14.tgz",
+ "integrity": "sha512-GwtvgtXxnWsucXvbQXkRgqksiH2Qed37H9xHZocE5sA3N8O8O8/8FA3uclQXxXVzc9XBZuEOMK7+r02FmSpHtw==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=18.14.1"
+ },
+ "peerDependencies": {
+ "hono": "^4"
+ }
+ },
+ "node_modules/@modelcontextprotocol/sdk": {
+ "version": "1.29.0",
+ "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.29.0.tgz",
+ "integrity": "sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "@hono/node-server": "^1.19.9",
+ "ajv": "^8.17.1",
+ "ajv-formats": "^3.0.1",
+ "content-type": "^1.0.5",
+ "cors": "^2.8.5",
+ "cross-spawn": "^7.0.5",
+ "eventsource": "^3.0.2",
+ "eventsource-parser": "^3.0.0",
+ "express": "^5.2.1",
+ "express-rate-limit": "^8.2.1",
+ "hono": "^4.11.4",
+ "jose": "^6.1.3",
+ "json-schema-typed": "^8.0.2",
+ "pkce-challenge": "^5.0.0",
+ "raw-body": "^3.0.0",
+ "zod": "^3.25 || ^4.0",
+ "zod-to-json-schema": "^3.25.1"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "@cfworker/json-schema": "^4.1.1",
+ "zod": "^3.25 || ^4.0"
+ },
+ "peerDependenciesMeta": {
+ "@cfworker/json-schema": {
+ "optional": true
+ },
+ "zod": {
+ "optional": false
+ }
+ }
+ },
+ "node_modules/@openai/agents": {
+ "version": "0.12.0",
+ "resolved": "https://registry.npmjs.org/@openai/agents/-/agents-0.12.0.tgz",
+ "integrity": "sha512-O+ML3tU7NhP5DXqzi/Q9WIht0lrb4ky0haal5Xp+uy+KaG+GxzxgZCbqD4b3nzWbzsq1dMt8Wq/iD7hG3LtsLA==",
+ "license": "MIT",
+ "dependencies": {
+ "@openai/agents-core": "0.12.0",
+ "@openai/agents-openai": "0.12.0",
+ "@openai/agents-realtime": "0.12.0",
+ "debug": "^4.4.0",
+ "openai": "^6.42.0"
+ },
+ "peerDependencies": {
+ "zod": "^4.0.0"
+ }
+ },
+ "node_modules/@openai/agents-core": {
+ "version": "0.12.0",
+ "resolved": "https://registry.npmjs.org/@openai/agents-core/-/agents-core-0.12.0.tgz",
+ "integrity": "sha512-8SSbAW1cVCX9tOr+N5YMj7eJyRmTSMQ5lXGlwXa7j3QclzMqVNJ4bcqrvU6GqIbSOe2XpUc+cS/kg0It2+74Fg==",
+ "license": "MIT",
+ "dependencies": {
+ "debug": "^4.4.0",
+ "openai": "^6.42.0"
+ },
+ "optionalDependencies": {
+ "@modelcontextprotocol/sdk": "^1.26.0"
+ },
+ "peerDependencies": {
+ "zod": "^4.0.0"
+ },
+ "peerDependenciesMeta": {
+ "zod": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@openai/agents-openai": {
+ "version": "0.12.0",
+ "resolved": "https://registry.npmjs.org/@openai/agents-openai/-/agents-openai-0.12.0.tgz",
+ "integrity": "sha512-GseH+cMrvzFxsv2ovQHWuP2ej9kUUgX5f/K49uPnq+cTixPZRpaxOTRZX62cJrHahpom/RuZnDlK4rf97xwJOA==",
+ "license": "MIT",
+ "dependencies": {
+ "@openai/agents-core": "0.12.0",
+ "debug": "^4.4.0",
+ "openai": "^6.42.0"
+ },
+ "peerDependencies": {
+ "zod": "^4.0.0"
+ }
+ },
+ "node_modules/@openai/agents-realtime": {
+ "version": "0.12.0",
+ "resolved": "https://registry.npmjs.org/@openai/agents-realtime/-/agents-realtime-0.12.0.tgz",
+ "integrity": "sha512-isTxWymL7G71n+as3PSty/vjaU5btJufYTACXcbJlgVf88JhP3YRfYXLfc5HX5NF8qgQorjyvTEliBNv3dFfWw==",
+ "license": "MIT",
+ "dependencies": {
+ "@openai/agents-core": "0.12.0",
+ "@types/ws": "^8.18.1",
+ "debug": "^4.4.0",
+ "ws": "^8.21.0"
+ },
+ "peerDependencies": {
+ "zod": "^4.0.0"
+ }
+ },
+ "node_modules/@types/node": {
+ "version": "26.0.1",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-26.0.1.tgz",
+ "integrity": "sha512-fc3KiUoBt6kie0N9bIW3E47vZsuaMf0PM2AaUpLCLT0s/LvX1nxAim6Fc049cNxODPpGm6qRAuUOB86SkRuPQw==",
+ "license": "MIT",
+ "dependencies": {
+ "undici-types": "~8.3.0"
+ }
+ },
+ "node_modules/@types/ws": {
+ "version": "8.18.1",
+ "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz",
+ "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/accepts": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",
+ "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "mime-types": "^3.0.0",
+ "negotiator": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/ajv": {
+ "version": "8.20.0",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz",
+ "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "fast-deep-equal": "^3.1.3",
+ "fast-uri": "^3.0.1",
+ "json-schema-traverse": "^1.0.0",
+ "require-from-string": "^2.0.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
+ "node_modules/ajv-formats": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz",
+ "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "ajv": "^8.0.0"
+ },
+ "peerDependencies": {
+ "ajv": "^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "ajv": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/body-parser": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz",
+ "integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "bytes": "^3.1.2",
+ "content-type": "^2.0.0",
+ "debug": "^4.4.3",
+ "http-errors": "^2.0.1",
+ "iconv-lite": "^0.7.2",
+ "on-finished": "^2.4.1",
+ "qs": "^6.15.2",
+ "raw-body": "^3.0.2",
+ "type-is": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/body-parser/node_modules/content-type": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz",
+ "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/bytes": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
+ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/call-bind-apply-helpers": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/call-bound": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
+ "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "get-intrinsic": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/content-disposition": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.1.0.tgz",
+ "integrity": "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/content-type": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
+ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/cookie": {
+ "version": "0.7.2",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
+ "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/cookie-signature": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz",
+ "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=6.6.0"
+ }
+ },
+ "node_modules/cors": {
+ "version": "2.8.6",
+ "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz",
+ "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "object-assign": "^4",
+ "vary": "^1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/cross-spawn": {
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "path-key": "^3.1.0",
+ "shebang-command": "^2.0.0",
+ "which": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/depd": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
+ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/dunder-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "gopd": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/ee-first": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
+ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
+ "license": "MIT",
+ "optional": true
+ },
+ "node_modules/encodeurl": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
+ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/es-define-property": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-errors": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-object-atoms": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz",
+ "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "es-errors": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/escape-html": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
+ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
+ "license": "MIT",
+ "optional": true
+ },
+ "node_modules/etag": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
+ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/eventsource": {
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz",
+ "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "eventsource-parser": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ }
+ },
+ "node_modules/eventsource-parser": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.1.0.tgz",
+ "integrity": "sha512-kJezFj9YFAMLeORyi7aCLxLbD5/qWMQnoMVlVPyHIll7lgRJCc3JVln9Vgl9nwQi0YkMnhdGTMNn7CkRRAptMg==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=18.0.0"
+ }
+ },
+ "node_modules/express": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",
+ "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "accepts": "^2.0.0",
+ "body-parser": "^2.2.1",
+ "content-disposition": "^1.0.0",
+ "content-type": "^1.0.5",
+ "cookie": "^0.7.1",
+ "cookie-signature": "^1.2.1",
+ "debug": "^4.4.0",
+ "depd": "^2.0.0",
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "etag": "^1.8.1",
+ "finalhandler": "^2.1.0",
+ "fresh": "^2.0.0",
+ "http-errors": "^2.0.0",
+ "merge-descriptors": "^2.0.0",
+ "mime-types": "^3.0.0",
+ "on-finished": "^2.4.1",
+ "once": "^1.4.0",
+ "parseurl": "^1.3.3",
+ "proxy-addr": "^2.0.7",
+ "qs": "^6.14.0",
+ "range-parser": "^1.2.1",
+ "router": "^2.2.0",
+ "send": "^1.1.0",
+ "serve-static": "^2.2.0",
+ "statuses": "^2.0.1",
+ "type-is": "^2.0.1",
+ "vary": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/express-rate-limit": {
+ "version": "8.5.2",
+ "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.5.2.tgz",
+ "integrity": "sha512-5Kb34ipNX694DH48vN9irak1Qx30nb0PLYHXfJgw4YEjiC3ZEmZJhwOp+VfiCYwFzvFTdB9QkArYS5kXa2cx2A==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "ip-address": "^10.2.0"
+ },
+ "engines": {
+ "node": ">= 16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/express-rate-limit"
+ },
+ "peerDependencies": {
+ "express": ">= 4.11"
+ }
+ },
+ "node_modules/fast-deep-equal": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
+ "license": "MIT",
+ "optional": true
+ },
+ "node_modules/fast-uri": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.3.tgz",
+ "integrity": "sha512-i70LwGWUduXqzicKXWshooq+sWL1K3WUU5rKZNG/0i3a1OSoX3HqhH5WbWwTmqWfor4urUakGPiRQcleRZTwOg==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/fastify"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/fastify"
+ }
+ ],
+ "license": "BSD-3-Clause",
+ "optional": true
+ },
+ "node_modules/finalhandler": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz",
+ "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "debug": "^4.4.0",
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "on-finished": "^2.4.1",
+ "parseurl": "^1.3.3",
+ "statuses": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 18.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/forwarded": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
+ "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/fresh": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz",
+ "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/function-bind": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+ "license": "MIT",
+ "optional": true,
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-intrinsic": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
+ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "es-define-property": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "es-object-atoms": "^1.1.1",
+ "function-bind": "^1.1.2",
+ "get-proto": "^1.0.1",
+ "gopd": "^1.2.0",
+ "has-symbols": "^1.1.0",
+ "hasown": "^2.0.2",
+ "math-intrinsics": "^1.1.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "dunder-proto": "^1.0.1",
+ "es-object-atoms": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/gopd": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-symbols": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
+ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/hasown": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz",
+ "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/hono": {
+ "version": "4.12.27",
+ "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.27.tgz",
+ "integrity": "sha512-1yrb/+w6HWQJrUCLkJ2IF5jNIPvvFkblV5RNOYl6bV+OA6p9GLcMpHFFGTosSvHvcAUibuUukRqhlYI4z32C7Q==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=16.9.0"
+ }
+ },
+ "node_modules/http-errors": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
+ "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "depd": "~2.0.0",
+ "inherits": "~2.0.4",
+ "setprototypeof": "~1.2.0",
+ "statuses": "~2.0.2",
+ "toidentifier": "~1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/iconv-lite": {
+ "version": "0.7.2",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz",
+ "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+ "license": "ISC",
+ "optional": true
+ },
+ "node_modules/ip-address": {
+ "version": "10.2.0",
+ "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.2.0.tgz",
+ "integrity": "sha512-/+S6j4E9AHvW9SWMSEY9Xfy66O5PWvVEJ08O0y5JGyEKQpojb0K0GKpz/v5HJ/G0vi3D2sjGK78119oXZeE0qA==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 12"
+ }
+ },
+ "node_modules/ipaddr.js": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
+ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/is-promise": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
+ "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",
+ "license": "MIT",
+ "optional": true
+ },
+ "node_modules/isexe": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
+ "license": "ISC",
+ "optional": true
+ },
+ "node_modules/jose": {
+ "version": "6.2.3",
+ "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.3.tgz",
+ "integrity": "sha512-YYVDInQKFJfR/xa3ojUTl8c2KoTwiL1R5Wg9YCydwH0x0B9grbzlg5HC7mMjCtUJjbQ/YnGEZIhI5tCgfTb4Hw==",
+ "license": "MIT",
+ "optional": true,
+ "funding": {
+ "url": "https://github.com/sponsors/panva"
+ }
+ },
+ "node_modules/json-schema-traverse": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
+ "license": "MIT",
+ "optional": true
+ },
+ "node_modules/json-schema-typed": {
+ "version": "8.0.2",
+ "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz",
+ "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==",
+ "license": "BSD-2-Clause",
+ "optional": true
+ },
+ "node_modules/math-intrinsics": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/media-typer": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz",
+ "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/merge-descriptors": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz",
+ "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/mime-db": {
+ "version": "1.54.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",
+ "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime-types": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz",
+ "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "mime-db": "^1.54.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "license": "MIT"
+ },
+ "node_modules/negotiator": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz",
+ "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/object-assign": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object-inspect": {
+ "version": "1.13.4",
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
+ "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/on-finished": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
+ "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "ee-first": "1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+ "license": "ISC",
+ "optional": true,
+ "dependencies": {
+ "wrappy": "1"
+ }
+ },
+ "node_modules/openai": {
+ "version": "6.45.0",
+ "resolved": "https://registry.npmjs.org/openai/-/openai-6.45.0.tgz",
+ "integrity": "sha512-5DQVNErssk0afNpTTHUm/qZPU4iKR9OYdNid8Ib4puq4gHNNvGWZht2zY4h9a8JMF949Ik6m8gQutllVPbjdnw==",
+ "license": "Apache-2.0",
+ "peerDependencies": {
+ "@aws-sdk/credential-provider-node": ">=3.972.0 <4",
+ "@smithy/hash-node": ">=4.3.0 <5",
+ "@smithy/signature-v4": ">=5.4.0 <6",
+ "ws": "^8.18.0",
+ "zod": "^3.25 || ^4.0"
+ },
+ "peerDependenciesMeta": {
+ "@aws-sdk/credential-provider-node": {
+ "optional": true
+ },
+ "@smithy/hash-node": {
+ "optional": true
+ },
+ "@smithy/signature-v4": {
+ "optional": true
+ },
+ "ws": {
+ "optional": true
+ },
+ "zod": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/parseurl": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/path-key": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/path-to-regexp": {
+ "version": "8.4.2",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz",
+ "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==",
+ "license": "MIT",
+ "optional": true,
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/pkce-challenge": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.1.tgz",
+ "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/proxy-addr": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
+ "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "forwarded": "0.2.0",
+ "ipaddr.js": "1.9.1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/qs": {
+ "version": "6.15.3",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz",
+ "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==",
+ "license": "BSD-3-Clause",
+ "optional": true,
+ "dependencies": {
+ "es-define-property": "^1.0.1",
+ "side-channel": "^1.1.1"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/range-parser": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz",
+ "integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.6"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/raw-body": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz",
+ "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "bytes": "~3.1.2",
+ "http-errors": "~2.0.1",
+ "iconv-lite": "~0.7.0",
+ "unpipe": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/require-from-string": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
+ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/router": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz",
+ "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "debug": "^4.4.0",
+ "depd": "^2.0.0",
+ "is-promise": "^4.0.0",
+ "parseurl": "^1.3.3",
+ "path-to-regexp": "^8.0.0"
+ },
+ "engines": {
+ "node": ">= 18"
+ }
+ },
+ "node_modules/safer-buffer": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
+ "license": "MIT",
+ "optional": true
+ },
+ "node_modules/send": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz",
+ "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "debug": "^4.4.3",
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "etag": "^1.8.1",
+ "fresh": "^2.0.0",
+ "http-errors": "^2.0.1",
+ "mime-types": "^3.0.2",
+ "ms": "^2.1.3",
+ "on-finished": "^2.4.1",
+ "range-parser": "^1.2.1",
+ "statuses": "^2.0.2"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/serve-static": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz",
+ "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "parseurl": "^1.3.3",
+ "send": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/setprototypeof": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
+ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
+ "license": "ISC",
+ "optional": true
+ },
+ "node_modules/shebang-command": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "shebang-regex": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/shebang-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/side-channel": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz",
+ "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "object-inspect": "^1.13.4",
+ "side-channel-list": "^1.0.1",
+ "side-channel-map": "^1.0.1",
+ "side-channel-weakmap": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-list": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz",
+ "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "object-inspect": "^1.13.4"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-map": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
+ "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "call-bound": "^1.0.2",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.5",
+ "object-inspect": "^1.13.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-weakmap": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
+ "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "call-bound": "^1.0.2",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.5",
+ "object-inspect": "^1.13.3",
+ "side-channel-map": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/statuses": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",
+ "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/toidentifier": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
+ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=0.6"
+ }
+ },
+ "node_modules/type-is": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz",
+ "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "content-type": "^2.0.0",
+ "media-typer": "^1.1.0",
+ "mime-types": "^3.0.0"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/type-is/node_modules/content-type": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz",
+ "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/undici-types": {
+ "version": "8.3.0",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz",
+ "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==",
+ "license": "MIT"
+ },
+ "node_modules/unpipe": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
+ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/vary": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
+ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/which": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+ "license": "ISC",
+ "optional": true,
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "node-which": "bin/node-which"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
+ "license": "ISC",
+ "optional": true
+ },
+ "node_modules/ws": {
+ "version": "8.21.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz",
+ "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/zod": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz",
+ "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/colinhacks"
+ }
+ },
+ "node_modules/zod-to-json-schema": {
+ "version": "3.25.2",
+ "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.2.tgz",
+ "integrity": "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==",
+ "license": "ISC",
+ "optional": true,
+ "peerDependencies": {
+ "zod": "^3.25.28 || ^4"
+ }
+ }
+ }
+}
diff --git a/examples/openai-agents-js-app/package.json b/examples/openai-agents-js-app/package.json
new file mode 100644
index 00000000..184c0192
--- /dev/null
+++ b/examples/openai-agents-js-app/package.json
@@ -0,0 +1,17 @@
+{
+ "name": "openlit-openai-agents-js-example",
+ "version": "0.1.0",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "start": "node app.mjs"
+ },
+ "dependencies": {
+ "@openai/agents": "0.12.0",
+ "openai": "^6.42.0"
+ },
+ "engines": {
+ "node": ">=22.0.0"
+ }
+}
+
diff --git a/openlit-controller/Dockerfile b/openlit-controller/Dockerfile
index 86196bbf..fef865ae 100644
--- a/openlit-controller/Dockerfile
+++ b/openlit-controller/Dockerfile
@@ -2,11 +2,11 @@
FROM ghcr.io/open-telemetry/obi-generator:0.2.11 AS obi-builder
ARG OBI_REPO=https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation.git
-ARG OBI_BRANCH=v0.9.0
+ARG OBI_BRANCH=v0.10.0
ARG TARGETARCH
ENV GOARCH=${TARGETARCH}
-# OBI v0.9.0 requires Go >= 1.25.9, newer than the obi-generator base image's
+# OBI v0.10.0 requires Go >= 1.25.11, newer than the obi-generator base image's
# pinned toolchain. Allow Go to auto-download the toolchain its go.mod requests.
ENV GOTOOLCHAIN=auto
diff --git a/openlit-controller/cmd/controller/helpers_test.go b/openlit-controller/cmd/controller/helpers_test.go
index a94327c0..0b85d0b4 100644
--- a/openlit-controller/cmd/controller/helpers_test.go
+++ b/openlit-controller/cmd/controller/helpers_test.go
@@ -7,7 +7,7 @@ import (
)
func newNilEngine() *engine.Engine {
- return engine.New(testLogger(), "/nonexistent/obi", "http://localhost:4318", "/proc", "test", "", config.DeployLinux)
+ return engine.New(testLogger(), "/nonexistent/obi", "http://localhost:4318", "/proc", "test", "", "", config.DeployLinux)
}
func testLogger() *zap.Logger {
diff --git a/openlit-controller/cmd/controller/main.go b/openlit-controller/cmd/controller/main.go
index 39c5e62d..f509e8ff 100644
--- a/openlit-controller/cmd/controller/main.go
+++ b/openlit-controller/cmd/controller/main.go
@@ -51,7 +51,7 @@ func main() {
zap.String("proc_root", cfg.ProcRoot),
)
- eng := engine.New(logger, cfg.OBIBinaryPath, cfg.OTLPEndpoint, cfg.ProcRoot, cfg.Environment, cfg.SDKVersion, cfg.DeployMode)
+ eng := engine.New(logger, cfg.OBIBinaryPath, cfg.OTLPEndpoint, cfg.ProcRoot, cfg.Environment, cfg.SDKVersion, cfg.NodeSDKVersion, cfg.DeployMode)
client := openlit.NewClient(cfg.OpenlitURL, cfg.APIKey, logger)
var mode openlit.ControllerMode
@@ -330,14 +330,14 @@ func executeAction(eng *engine.Engine, action openlit.PendingAction, logger *zap
execErr = eng.InstrumentService(action.ServiceKey)
case openlit.ActionUninstrument:
execErr = eng.UninstrumentService(action.ServiceKey)
- case openlit.ActionEnablePythonSDK:
+ case openlit.ActionEnableSDK, openlit.ActionEnablePythonSDK:
payload, err := parsePythonSDKPayload(action.Payload)
if err != nil {
execErr = err
break
}
execErr = eng.EnablePythonSDK(action.ServiceKey, payload)
- case openlit.ActionDisablePythonSDK:
+ case openlit.ActionDisableSDK, openlit.ActionDisablePythonSDK:
payload, err := parsePythonSDKPayload(action.Payload)
if err != nil {
execErr = err
diff --git a/openlit-controller/controller b/openlit-controller/controller
deleted file mode 100755
index abde7a02..00000000
Binary files a/openlit-controller/controller and /dev/null differ
diff --git a/openlit-controller/internal/config/config.go b/openlit-controller/internal/config/config.go
index 6e8a8f3f..e542ae17 100644
--- a/openlit-controller/internal/config/config.go
+++ b/openlit-controller/internal/config/config.go
@@ -18,17 +18,18 @@ const (
)
type Config struct {
- OpenlitURL string `yaml:"openlit_url"`
- APIKey string `yaml:"api_key"`
- APIListen string `yaml:"api_listen"`
- PollInterval time.Duration `yaml:"poll_interval"`
- OBIBinaryPath string `yaml:"obi_binary_path"`
- OTLPEndpoint string `yaml:"otlp_endpoint"`
- ProcRoot string `yaml:"proc_root"`
- Environment string `yaml:"environment"`
- ClusterID string `yaml:"cluster_id"`
- SDKVersion string `yaml:"sdk_version"`
- DeployMode DeployMode `yaml:"-"`
+ OpenlitURL string `yaml:"openlit_url"`
+ APIKey string `yaml:"api_key"`
+ APIListen string `yaml:"api_listen"`
+ PollInterval time.Duration `yaml:"poll_interval"`
+ OBIBinaryPath string `yaml:"obi_binary_path"`
+ OTLPEndpoint string `yaml:"otlp_endpoint"`
+ ProcRoot string `yaml:"proc_root"`
+ Environment string `yaml:"environment"`
+ ClusterID string `yaml:"cluster_id"`
+ SDKVersion string `yaml:"sdk_version"`
+ NodeSDKVersion string `yaml:"node_sdk_version"`
+ DeployMode DeployMode `yaml:"-"`
}
func DetectDeployMode() DeployMode {
@@ -106,6 +107,13 @@ func Load(path string) (*Config, error) {
if v := os.Getenv("OPENLIT_SDK_VERSION"); v != "" {
cfg.SDKVersion = v
}
+ // Node injection installs from npm, which versions independently from the
+ // Python SDK on PyPI. Use a dedicated knob so pinning one runtime's SDK
+ // version never forces a non-existent version on the other (a pinned
+ // OPENLIT_SDK_VERSION would otherwise be passed to `npm install openlit@X`).
+ if v := os.Getenv("OPENLIT_NODE_SDK_VERSION"); v != "" {
+ cfg.NodeSDKVersion = v
+ }
cfg.OpenlitURL = strings.TrimRight(cfg.OpenlitURL, "/")
if v := os.Getenv("OPENLIT_DEPLOY_MODE"); v != "" {
diff --git a/openlit-controller/internal/config/config_test.go b/openlit-controller/internal/config/config_test.go
index e7dfd22c..9c176258 100644
--- a/openlit-controller/internal/config/config_test.go
+++ b/openlit-controller/internal/config/config_test.go
@@ -26,6 +26,7 @@ func TestLoadEnvOverrides(t *testing.T) {
t.Setenv("OPENLIT_ENVIRONMENT", "staging")
t.Setenv("OPENLIT_CLUSTER_ID", "my-cluster")
t.Setenv("OPENLIT_SDK_VERSION", "1.2.3")
+ t.Setenv("OPENLIT_NODE_SDK_VERSION", "4.5.6")
t.Setenv("OPENLIT_DEPLOY_MODE", "docker")
cfg, err := Load("")
@@ -53,6 +54,9 @@ func TestLoadEnvOverrides(t *testing.T) {
if cfg.SDKVersion != "1.2.3" {
t.Errorf("SDKVersion = %q", cfg.SDKVersion)
}
+ if cfg.NodeSDKVersion != "4.5.6" {
+ t.Errorf("NodeSDKVersion = %q", cfg.NodeSDKVersion)
+ }
if cfg.DeployMode != DeployDocker {
t.Errorf("DeployMode = %q, want docker", cfg.DeployMode)
}
diff --git a/openlit-controller/internal/engine/engine.go b/openlit-controller/internal/engine/engine.go
index 3b7c8e1c..3a3721d5 100644
--- a/openlit-controller/internal/engine/engine.go
+++ b/openlit-controller/internal/engine/engine.go
@@ -48,15 +48,16 @@ type Engine struct {
logger *zap.Logger
running bool
- scanner *scanner.Scanner
- customHosts []string // user-configured custom LLM host specs ("host[:port]")
- obi *OBIManager
- exportCfg ExportConfig
- procRoot string
- deployMode config.DeployMode
- container *ContainerEnricher
- environment string
- sdkVersion string
+ scanner *scanner.Scanner
+ customHosts []string // user-configured custom LLM host specs ("host[:port]")
+ obi *OBIManager
+ exportCfg ExportConfig
+ procRoot string
+ deployMode config.DeployMode
+ container *ContainerEnricher
+ environment string
+ sdkVersion string
+ nodeSDKVersion string
patterns map[string]instrumentPattern // serviceID -> pattern
}
@@ -67,6 +68,10 @@ const (
CapabilityPythonSDKDockerV1 = "python_sdk_injection_docker_v1"
CapabilityPythonSDKLinuxSystemdV1 = "python_sdk_injection_linux_systemd_v1"
CapabilityPythonSDKLinuxBareV1 = "python_sdk_injection_linux_bare_v1"
+ CapabilityNodeJSSDKKubernetesV1 = "nodejs_sdk_injection_kubernetes_v1"
+ CapabilityNodeJSSDKDockerV1 = "nodejs_sdk_injection_docker_v1"
+ CapabilityNodeJSSDKLinuxSystemdV1 = "nodejs_sdk_injection_linux_systemd_v1"
+ CapabilityNodeJSSDKLinuxBareV1 = "nodejs_sdk_injection_linux_bare_v1"
CapabilityLifecycleKubernetesV1 = "lifecycle_kubernetes_v1"
CapabilityLifecycleDockerV1 = "lifecycle_docker_v1"
CapabilityLifecycleLinuxSystemdV1 = "lifecycle_linux_systemd_v1"
@@ -86,7 +91,7 @@ const (
K8sRolloutRestartAnnotation = "openlit.io/restartedAt"
)
-func New(logger *zap.Logger, obiBinaryPath, otlpEndpoint, procRoot, environment, sdkVersion string, mode config.DeployMode) *Engine {
+func New(logger *zap.Logger, obiBinaryPath, otlpEndpoint, procRoot, environment, sdkVersion, nodeSDKVersion string, mode config.DeployMode) *Engine {
if procRoot == "" {
procRoot = "/proc"
}
@@ -99,6 +104,7 @@ func New(logger *zap.Logger, obiBinaryPath, otlpEndpoint, procRoot, environment,
zap.String("obi_binary", obiBinaryPath),
zap.String("otlp_endpoint", otlpEndpoint),
zap.String("sdk_version", sdkVersion),
+ zap.String("node_sdk_version", nodeSDKVersion),
)
return &Engine{
@@ -110,11 +116,12 @@ func New(logger *zap.Logger, obiBinaryPath, otlpEndpoint, procRoot, environment,
OTLPEndpoint: otlpEndpoint,
OTLPProtocol: "http/protobuf",
},
- procRoot: procRoot,
- deployMode: mode,
- container: container,
- environment: environment,
- sdkVersion: sdkVersion,
+ procRoot: procRoot,
+ deployMode: mode,
+ container: container,
+ environment: environment,
+ sdkVersion: sdkVersion,
+ nodeSDKVersion: nodeSDKVersion,
}
}
@@ -144,6 +151,7 @@ func (e *Engine) Start(ctx context.Context) error {
}
go e.pruneStaleServices(ctx)
+ go e.discoverRuntimeServicesLoop(ctx)
e.logger.Info("engine started")
return nil
@@ -424,18 +432,22 @@ func (e *Engine) ControllerCapabilities() []string {
case config.DeployKubernetes:
if e.container != nil && e.container.k8sClient != nil {
capabilities = append(capabilities, CapabilityPythonSDKKubernetesV1)
+ capabilities = append(capabilities, CapabilityNodeJSSDKKubernetesV1)
capabilities = append(capabilities, CapabilityLifecycleKubernetesV1)
}
case config.DeployDocker:
if e.container != nil && e.container.dockerClient != nil && e.container.dockerClient.canManage() {
capabilities = append(capabilities, CapabilityPythonSDKDockerV1)
+ capabilities = append(capabilities, CapabilityNodeJSSDKDockerV1)
capabilities = append(capabilities, CapabilityLifecycleDockerV1)
}
default:
capabilities = append(capabilities, CapabilityPythonSDKLinuxBareV1)
+ capabilities = append(capabilities, CapabilityNodeJSSDKLinuxBareV1)
capabilities = append(capabilities, CapabilityLifecycleLinuxBareV1)
if linuxSystemdSDKSupported() {
capabilities = append(capabilities, CapabilityPythonSDKLinuxSystemdV1)
+ capabilities = append(capabilities, CapabilityNodeJSSDKLinuxSystemdV1)
capabilities = append(capabilities, CapabilityLifecycleLinuxSystemdV1)
}
}
diff --git a/openlit-controller/internal/engine/engine_test.go b/openlit-controller/internal/engine/engine_test.go
index f8c006ce..b3d9f29f 100644
--- a/openlit-controller/internal/engine/engine_test.go
+++ b/openlit-controller/internal/engine/engine_test.go
@@ -10,7 +10,7 @@ import (
func newTestEngine() *Engine {
logger, _ := zap.NewDevelopment()
- eng := New(logger, "/nonexistent/obi", "http://localhost:4318", "/proc", "test", "", config.DeployLinux)
+ eng := New(logger, "/nonexistent/obi", "http://localhost:4318", "/proc", "test", "", "", config.DeployLinux)
return eng
}
diff --git a/openlit-controller/internal/engine/node_sdk.go b/openlit-controller/internal/engine/node_sdk.go
new file mode 100644
index 00000000..23947e60
--- /dev/null
+++ b/openlit-controller/internal/engine/node_sdk.go
@@ -0,0 +1,1152 @@
+package engine
+
+import (
+ "crypto/sha256"
+ "encoding/hex"
+ "encoding/json"
+ "fmt"
+ "os"
+ "path/filepath"
+ "strings"
+ "time"
+
+ "github.com/openlit/openlit/openlit-controller/internal/config"
+ "github.com/openlit/openlit/openlit-controller/internal/openlit"
+ "go.uber.org/zap"
+)
+
+const (
+ nodeSDKRuntime = "nodejs"
+ nodeSystemdSDKStateDir = "/var/lib/openlit/nodejs-sdk"
+ nodeBareProcessSDKStateDir = "/var/lib/openlit/nodejs-sdk"
+ nodeOpenLITRegisterModule = "openlit/register"
+ nodeOTelAutoRegisterModule = "@opentelemetry/auto-instrumentations-node/register"
+ nodeOTelSDKModule = "@opentelemetry/sdk-node"
+)
+
+var controllerManagedNodeDisabledInstrumentors = []string{
+ "openai",
+ "anthropic",
+ "cohere",
+ "groq",
+ "ai21",
+ "gradient",
+ "mistral",
+ "google-ai",
+ "vertexai",
+ "together",
+ "ollama",
+ "bedrock",
+ "azure-ai-inference",
+ "huggingface",
+ "replicate",
+ "elevenlabs",
+ "transformers",
+ "http",
+ "undici",
+}
+
+func (e *Engine) EnableNodeJSSDK(serviceID string, payload openlit.SDKActionPayload) error {
+ payload = e.normalizeSDKPayload(payload, nodeSDKRuntime)
+ if !isValidSDKVersion(payload.SDKVersion) {
+ return fmt.Errorf("invalid sdk_version %q: must match a safe npm package version (letters, digits, . _ + -)", payload.SDKVersion)
+ }
+
+ svc, err := e.serviceSnapshot(serviceID)
+ if err != nil {
+ return err
+ }
+ if !isNodeRuntime(svc.LanguageRuntime) {
+ e.setAgentObservabilityState(
+ serviceID,
+ "unsupported",
+ "none",
+ "",
+ "Controller-managed JavaScript/TypeScript SDK injection is only available for Node.js services",
+ )
+ return fmt.Errorf("service %q is not a Node.js runtime", svc.ServiceName)
+ }
+ if svc.AgentObservabilityStatus == "enabled" && svc.AgentObservabilitySource == "existing_openlit" {
+ e.setAgentObservabilityState(
+ serviceID,
+ "enabled",
+ "existing_openlit",
+ "",
+ "Existing OpenLIT instrumentation is not controller-managed and will not be removed automatically",
+ )
+ return fmt.Errorf("service %q uses existing OpenLIT instrumentation that is not controller-managed", svc.ServiceName)
+ }
+
+ sdkVersionLabel := payload.SDKVersion
+ if sdkVersionLabel == "" {
+ sdkVersionLabel = "latest"
+ }
+
+ switch e.deployMode {
+ case config.DeployKubernetes:
+ if err := e.enableNodeJSSDKKubernetes(svc, payload); err != nil {
+ return err
+ }
+ e.setDesiredAgentObservabilityState(serviceID, "enabled", "controller_managed", "", "Controller-managed JavaScript/TypeScript SDK rollout configured for Kubernetes workload")
+ case config.DeployDocker:
+ if err := e.enableNodeJSSDKDocker(svc, payload); err != nil {
+ return err
+ }
+ e.setDesiredAgentObservabilityState(serviceID, "enabled", "controller_managed", "", "Controller-managed JavaScript/TypeScript SDK rollout configured for Docker container")
+ default:
+ isContainerized := svc.ResourceAttributes["openlit.is_containerized"] == "true"
+ containerID := svc.ResourceAttributes["container.id"]
+ if isContainerized && containerID != "" {
+ if e.container != nil && e.container.dockerClient != nil && e.container.dockerClient.canManage() {
+ if err := e.enableNodeJSSDKDocker(svc, payload); err != nil {
+ return err
+ }
+ e.setDesiredAgentObservabilityState(serviceID, "enabled", "controller_managed", "", "Controller-managed JavaScript/TypeScript SDK rollout configured for Docker container (detected from Linux host)")
+ e.setSDKVersionAttr(serviceID, sdkVersionLabel)
+ return nil
+ }
+ e.setDesiredAgentObservabilityState(
+ serviceID,
+ "unsupported",
+ "none",
+ "",
+ "This process runs inside a container but the Docker socket is not available. Mount /var/run/docker.sock or use Docker-mode controller for Agent Observability.",
+ )
+ return fmt.Errorf("containerized process detected but Docker socket not available for Agent O11y")
+ }
+ if svc.ResourceAttributes["systemd.unit"] != "" {
+ if err := e.enableNodeJSSDKLinux(svc, payload); err != nil {
+ return err
+ }
+ e.setDesiredAgentObservabilityState(serviceID, "enabled", "controller_managed", "", "Controller-managed JavaScript/TypeScript SDK rollout configured for systemd service")
+ } else if err := e.enableNodeJSSDKBareProcess(svc, payload); err != nil {
+ return err
+ }
+ }
+ e.setSDKVersionAttr(serviceID, sdkVersionLabel)
+ return nil
+}
+
+func (e *Engine) DisableNodeJSSDK(serviceID string, _ openlit.SDKActionPayload) error {
+ svc, err := e.serviceSnapshot(serviceID)
+ if err != nil {
+ return err
+ }
+ if !isNodeRuntime(svc.LanguageRuntime) {
+ e.setAgentObservabilityState(
+ serviceID,
+ "unsupported",
+ "none",
+ "",
+ "Controller-managed JavaScript/TypeScript SDK injection is only available for Node.js services",
+ )
+ return fmt.Errorf("service %q is not a Node.js runtime", svc.ServiceName)
+ }
+
+ switch e.deployMode {
+ case config.DeployKubernetes:
+ if err := e.disableNodeJSSDKKubernetes(svc); err != nil {
+ return err
+ }
+ e.setDesiredAgentObservabilityState(serviceID, "disabled", "none", "", "Controller-managed JavaScript/TypeScript SDK removed from Kubernetes workload")
+ case config.DeployDocker:
+ if err := e.disableNodeJSSDKDocker(svc); err != nil {
+ return err
+ }
+ e.setDesiredAgentObservabilityState(serviceID, "disabled", "none", "", "Controller-managed JavaScript/TypeScript SDK removed from Docker container")
+ default:
+ isContainerized := svc.ResourceAttributes["openlit.is_containerized"] == "true"
+ containerID := svc.ResourceAttributes["container.id"]
+ if isContainerized && containerID != "" {
+ if e.container != nil && e.container.dockerClient != nil && e.container.dockerClient.canManage() {
+ if err := e.disableNodeJSSDKDocker(svc); err != nil {
+ return err
+ }
+ e.setDesiredAgentObservabilityState(serviceID, "disabled", "none", "", "Controller-managed JavaScript/TypeScript SDK removed from Docker container (detected from Linux host)")
+ return nil
+ }
+ return fmt.Errorf("containerized process detected but Docker socket not available to disable Agent O11y")
+ }
+ if svc.ResourceAttributes["systemd.unit"] != "" {
+ if err := e.disableNodeJSSDKLinux(svc); err != nil {
+ return err
+ }
+ e.setDesiredAgentObservabilityState(serviceID, "disabled", "none", "", "Controller-managed JavaScript/TypeScript SDK removed from systemd service")
+ } else if err := e.disableNodeJSSDKBareProcess(svc); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func (e *Engine) enableNodeJSSDKKubernetes(svc *openlit.ServiceState, payload openlit.SDKActionPayload) error {
+ if e.container == nil || e.container.k8sClient == nil {
+ return fmt.Errorf("kubernetes client unavailable for JavaScript/TypeScript SDK injection")
+ }
+ namespace := svc.ResourceAttributes["k8s.namespace.name"]
+ workloadKind := svc.ResourceAttributes["k8s.workload.kind"]
+ workloadName := svc.DeploymentName
+ containerName := svc.ResourceAttributes["container.name"]
+ if workloadKind == "" || workloadKind == "Pod" {
+ return e.enableNodeJSSDKNakedPod(svc, payload)
+ }
+ if namespace == "" || workloadName == "" {
+ return fmt.Errorf("missing Kubernetes workload metadata for %s", svc.ServiceName)
+ }
+ workload, err := e.container.k8sClient.getWorkload(namespace, workloadKind, workloadName)
+ if err != nil {
+ e.setAgentObservabilityState(svc.ID, "error", "controller_managed", "", fmt.Sprintf("Failed to fetch workload %s/%s: %v", workloadKind, workloadName, err))
+ return err
+ }
+ container, err := findTargetContainer(workload, containerName)
+ if err != nil {
+ return err
+ }
+ preflight := evaluateNodeJSSDKPreflight(extractContainerEnv(container), flattenContainerCommand(container), payload.DuplicatePolicy)
+ if err := e.applySDKPreflightResult(svc.ID, preflight); err != nil {
+ return err
+ }
+ if preflight.Decision == pythonSDKDecisionAdopt {
+ return nil
+ }
+ patch, err := buildNodeJSSDKWorkloadPatch(workload, containerName, svc, payload, true)
+ if err != nil {
+ return err
+ }
+ if err := e.container.k8sClient.patchWorkload(namespace, workloadKind, workloadName, patch); err != nil {
+ e.setAgentObservabilityState(svc.ID, "error", "controller_managed", "", fmt.Sprintf("Failed to patch workload %s/%s: %v", workloadKind, workloadName, err))
+ return err
+ }
+ e.setAgentObservabilityState(svc.ID, "enabled", "controller_managed", "", fmt.Sprintf("OpenLIT SDK injected via %s/%s patch (workload %s)", workloadKind, workloadName, svc.WorkloadKey))
+ return nil
+}
+
+func (e *Engine) disableNodeJSSDKKubernetes(svc *openlit.ServiceState) error {
+ if e.container == nil || e.container.k8sClient == nil {
+ return fmt.Errorf("kubernetes client unavailable for JavaScript/TypeScript SDK removal")
+ }
+ namespace := svc.ResourceAttributes["k8s.namespace.name"]
+ workloadKind := svc.ResourceAttributes["k8s.workload.kind"]
+ workloadName := svc.DeploymentName
+ containerName := svc.ResourceAttributes["container.name"]
+ if workloadKind == "" || workloadKind == "Pod" {
+ return e.disableNodeJSSDKNakedPod(svc)
+ }
+ if namespace == "" || workloadName == "" {
+ return fmt.Errorf("missing Kubernetes workload metadata for %s", svc.ServiceName)
+ }
+ workload, err := e.container.k8sClient.getWorkload(namespace, workloadKind, workloadName)
+ if err != nil {
+ e.setAgentObservabilityState(svc.ID, "error", "controller_managed", "", fmt.Sprintf("Failed to fetch workload %s/%s: %v", workloadKind, workloadName, err))
+ return err
+ }
+ patch, err := buildNodeJSSDKWorkloadPatch(workload, containerName, svc, openlit.SDKActionPayload{}, false)
+ if err != nil {
+ return err
+ }
+ if err := e.container.k8sClient.patchWorkload(namespace, workloadKind, workloadName, patch); err != nil {
+ e.setAgentObservabilityState(svc.ID, "error", "controller_managed", "", fmt.Sprintf("Failed to patch workload %s/%s: %v", workloadKind, workloadName, err))
+ return err
+ }
+ e.setAgentObservabilityState(svc.ID, "disabled", "none", "", fmt.Sprintf("OpenLIT SDK removed via %s/%s patch (workload %s)", workloadKind, workloadName, svc.WorkloadKey))
+ return nil
+}
+
+func (e *Engine) enableNodeJSSDKNakedPod(svc *openlit.ServiceState, payload openlit.SDKActionPayload) error {
+ namespace := svc.ResourceAttributes["k8s.namespace.name"]
+ podName := svc.ResourceAttributes["k8s.pod.name"]
+ containerName := svc.ResourceAttributes["container.name"]
+ if namespace == "" || podName == "" {
+ return fmt.Errorf("missing pod metadata for naked pod %s", svc.ServiceName)
+ }
+ pod, err := e.container.k8sClient.getPod(namespace, podName)
+ if err != nil {
+ return fmt.Errorf("fetching naked pod %s/%s: %w", namespace, podName, err)
+ }
+ spec, _ := pod["spec"].(map[string]any)
+ if spec == nil {
+ return fmt.Errorf("pod %s/%s has no spec", namespace, podName)
+ }
+ containers, err := extractContainers(spec["containers"])
+ if err != nil {
+ return err
+ }
+ targetIndex, err := selectContainerIndex(containers, containerName)
+ if err != nil {
+ return err
+ }
+ preflight := evaluateNodeJSSDKPreflight(extractContainerEnv(containers[targetIndex]), flattenContainerCommand(containers[targetIndex]), payload.DuplicatePolicy)
+ if err := e.applySDKPreflightResult(svc.ID, preflight); err != nil {
+ return err
+ }
+ if preflight.Decision == pythonSDKDecisionAdopt {
+ return nil
+ }
+ appImage := resolveContainerImage(containers, containerName)
+ if appImage == "" {
+ return fmt.Errorf("cannot resolve image for naked pod container %q", containerName)
+ }
+ if err := applyNodeJSSDKContainerSettings(containers[targetIndex], svc, payload); err != nil {
+ return err
+ }
+ initContainer := map[string]any{
+ "name": openlitInstrumentationInitName,
+ "image": appImage,
+ "command": []any{"sh", "-c", buildNPMInstallShellCmd(openlitInstrumentationMountPath, payload.SDKVersion)},
+ "volumeMounts": []any{map[string]any{
+ "name": openlitInstrumentationVolume,
+ "mountPath": openlitInstrumentationMountPath,
+ }},
+ }
+ if policy := resolveContainerImagePullPolicy(containers, containerName); policy != "" {
+ initContainer["imagePullPolicy"] = policy
+ }
+ spec["initContainers"] = objectSliceToAny(upsertNamedObject(extractObjectSlice(spec["initContainers"]), openlitInstrumentationInitName, initContainer))
+ spec["volumes"] = objectSliceToAny(upsertNamedObject(extractObjectSlice(spec["volumes"]), openlitInstrumentationVolume, map[string]any{
+ "name": openlitInstrumentationVolume,
+ "emptyDir": map[string]any{},
+ }))
+ spec["containers"] = objectSliceToAny(containers)
+
+ metadata, _ := pod["metadata"].(map[string]any)
+ annotations := copyStringMap(metadata["annotations"])
+ setManagedSDKAnnotations(annotations, svc, payload, nodeSDKRuntime)
+ stripPodRuntimeFields(pod)
+ if metaMap, ok := pod["metadata"].(map[string]any); ok {
+ metaMap["annotations"] = stringMapToAny(annotations)
+ }
+ originalPodJSON, marshalErr := json.Marshal(pod)
+ if marshalErr != nil {
+ return fmt.Errorf("marshaling naked pod %s/%s before SDK injection: %w", namespace, podName, marshalErr)
+ }
+ e.logger.Info("recreating naked pod for Node.js SDK injection; original spec captured for rollback", zap.String("namespace", namespace), zap.String("pod", podName), zap.ByteString("original_spec", originalPodJSON))
+ if err := e.container.k8sClient.deletePod(namespace, podName, 0); err != nil {
+ return fmt.Errorf("deleting naked pod %s/%s for SDK injection: %w", namespace, podName, err)
+ }
+ if err := e.container.k8sClient.createPod(namespace, pod); err != nil {
+ e.logger.Error("naked pod create failed after delete, attempting rollback with original spec", zap.String("namespace", namespace), zap.String("pod", podName), zap.Error(err))
+ var originalPod map[string]any
+ if unmarshalErr := json.Unmarshal(originalPodJSON, &originalPod); unmarshalErr == nil {
+ stripPodRuntimeFields(originalPod)
+ _ = e.container.k8sClient.createPod(namespace, originalPod)
+ }
+ return fmt.Errorf("recreating naked pod %s/%s with SDK: %w", namespace, podName, err)
+ }
+ e.setAgentObservabilityState(svc.ID, "enabled", "controller_managed", "", fmt.Sprintf("OpenLIT SDK injected via naked pod %s/%s recreate (workload %s)", namespace, podName, svc.WorkloadKey))
+ return nil
+}
+
+func (e *Engine) disableNodeJSSDKNakedPod(svc *openlit.ServiceState) error {
+ namespace := svc.ResourceAttributes["k8s.namespace.name"]
+ podName := svc.ResourceAttributes["k8s.pod.name"]
+ containerName := svc.ResourceAttributes["container.name"]
+ if namespace == "" || podName == "" {
+ return fmt.Errorf("missing pod metadata for naked pod %s", svc.ServiceName)
+ }
+ pod, err := e.container.k8sClient.getPod(namespace, podName)
+ if err != nil {
+ return fmt.Errorf("fetching naked pod %s/%s: %w", namespace, podName, err)
+ }
+ spec, _ := pod["spec"].(map[string]any)
+ if spec == nil {
+ return fmt.Errorf("pod %s/%s has no spec", namespace, podName)
+ }
+ containers, err := extractContainers(spec["containers"])
+ if err != nil {
+ return err
+ }
+ targetIndex, err := selectContainerIndex(containers, containerName)
+ if err != nil {
+ return err
+ }
+ removeNodeJSSDKContainerSettings(containers[targetIndex])
+ spec["initContainers"] = objectSliceToAny(removeNamedObject(extractObjectSlice(spec["initContainers"]), openlitInstrumentationInitName))
+ spec["volumes"] = objectSliceToAny(removeNamedObject(extractObjectSlice(spec["volumes"]), openlitInstrumentationVolume))
+ spec["containers"] = objectSliceToAny(containers)
+ metadata, _ := pod["metadata"].(map[string]any)
+ annotations := copyStringMap(metadata["annotations"])
+ removeManagedSDKAnnotations(annotations)
+ stripPodRuntimeFields(pod)
+ if metaMap, ok := pod["metadata"].(map[string]any); ok {
+ metaMap["annotations"] = stringMapToAny(annotations)
+ }
+ originalPodJSON, _ := json.Marshal(pod)
+ if err := e.container.k8sClient.deletePod(namespace, podName, 0); err != nil {
+ return fmt.Errorf("deleting naked pod %s/%s for SDK removal: %w", namespace, podName, err)
+ }
+ if err := e.container.k8sClient.createPod(namespace, pod); err != nil {
+ var originalPod map[string]any
+ if unmarshalErr := json.Unmarshal(originalPodJSON, &originalPod); unmarshalErr == nil {
+ stripPodRuntimeFields(originalPod)
+ _ = e.container.k8sClient.createPod(namespace, originalPod)
+ }
+ return fmt.Errorf("recreating naked pod %s/%s without SDK: %w", namespace, podName, err)
+ }
+ e.setAgentObservabilityState(svc.ID, "disabled", "none", "", fmt.Sprintf("OpenLIT SDK removed via naked pod %s/%s recreate (workload %s)", namespace, podName, svc.WorkloadKey))
+ return nil
+}
+
+func buildNodeJSSDKWorkloadPatch(workload map[string]any, containerName string, svc *openlit.ServiceState, payload openlit.SDKActionPayload, enable bool) (map[string]any, error) {
+ template, err := getTemplate(workload)
+ if err != nil {
+ return nil, err
+ }
+ templateMeta := ensureMap(template, "metadata")
+ templateSpec := ensureMap(template, "spec")
+ annotations := copyStringMap(templateMeta["annotations"])
+ if enable {
+ setManagedSDKAnnotations(annotations, svc, payload, nodeSDKRuntime)
+ } else {
+ removeManagedSDKAnnotations(annotations)
+ }
+ containers, err := extractContainers(templateSpec["containers"])
+ if err != nil {
+ return nil, err
+ }
+ targetIndex, err := selectContainerIndex(containers, containerName)
+ if err != nil {
+ return nil, err
+ }
+ if enable {
+ appImage := resolveContainerImage(containers, containerName)
+ if appImage == "" {
+ return nil, fmt.Errorf("cannot resolve image for container %q", containerName)
+ }
+ if err := applyNodeJSSDKContainerSettings(containers[targetIndex], svc, payload); err != nil {
+ return nil, err
+ }
+ initContainer := map[string]any{
+ "name": openlitInstrumentationInitName,
+ "image": appImage,
+ "command": []any{"sh", "-c", buildNPMInstallShellCmd(openlitInstrumentationMountPath, payload.SDKVersion)},
+ "volumeMounts": []any{map[string]any{
+ "name": openlitInstrumentationVolume,
+ "mountPath": openlitInstrumentationMountPath,
+ }},
+ }
+ if policy := resolveContainerImagePullPolicy(containers, containerName); policy != "" {
+ initContainer["imagePullPolicy"] = policy
+ }
+ templateSpec["initContainers"] = objectSliceToAny(upsertNamedObject(extractObjectSlice(templateSpec["initContainers"]), openlitInstrumentationInitName, initContainer))
+ templateSpec["volumes"] = objectSliceToAny(upsertNamedObject(extractObjectSlice(templateSpec["volumes"]), openlitInstrumentationVolume, map[string]any{
+ "name": openlitInstrumentationVolume,
+ "emptyDir": map[string]any{},
+ }))
+ } else {
+ removeNodeJSSDKContainerSettings(containers[targetIndex])
+ templateSpec["initContainers"] = objectSliceToAny(removeNamedObject(extractObjectSlice(templateSpec["initContainers"]), openlitInstrumentationInitName))
+ templateSpec["volumes"] = objectSliceToAny(removeNamedObject(extractObjectSlice(templateSpec["volumes"]), openlitInstrumentationVolume))
+ }
+ templateSpec["containers"] = objectSliceToAny(containers)
+ return map[string]any{
+ "spec": map[string]any{
+ "template": map[string]any{
+ "metadata": map[string]any{"annotations": annotations},
+ "spec": templateSpec,
+ },
+ },
+ }, nil
+}
+
+func applyNodeJSSDKContainerSettings(container map[string]any, svc *openlit.ServiceState, payload openlit.SDKActionPayload) error {
+ env := extractObjectSlice(container["env"])
+ nodeOptions, err := upsertNodeOptionsInK8sEnv(env, k8sManagedNodeRegisterPath())
+ if err != nil {
+ return err
+ }
+ env = nodeOptions
+ env = appendCommonSDKK8sEnv(env, svc, payload, strings.Join(controllerManagedNodeDisabledInstrumentors, ","))
+ container["env"] = objectSliceToAny(env)
+ volumeMounts := extractObjectSlice(container["volumeMounts"])
+ volumeMounts = upsertNamedObject(volumeMounts, openlitInstrumentationVolume, map[string]any{
+ "name": openlitInstrumentationVolume,
+ "mountPath": openlitInstrumentationMountPath,
+ })
+ container["volumeMounts"] = objectSliceToAny(volumeMounts)
+ return nil
+}
+
+func removeNodeJSSDKContainerSettings(container map[string]any) {
+ env := extractObjectSlice(container["env"])
+ env = removeCommonSDKK8sEnv(env)
+ env = removeNodeOptionsFromK8sEnv(env, k8sManagedNodeRegisterPath())
+ container["env"] = objectSliceToAny(env)
+ volumeMounts := removeNamedObject(extractObjectSlice(container["volumeMounts"]), openlitInstrumentationVolume)
+ container["volumeMounts"] = objectSliceToAny(volumeMounts)
+}
+
+func appendCommonSDKK8sEnv(env []map[string]any, svc *openlit.ServiceState, payload openlit.SDKActionPayload, disabledInstrumentors string) []map[string]any {
+ env = upsertEnvValue(env, "OPENLIT_CONTROLLER_MODE", controllerManagedAgentMode)
+ env = upsertEnvValue(env, "OTEL_SERVICE_NAME", svc.ServiceName)
+ env = upsertEnvValue(env, "OTEL_EXPORTER_OTLP_ENDPOINT", payload.OTLPEndpoint)
+ env = upsertEnvValue(env, "OTEL_DEPLOYMENT_ENVIRONMENT", payload.Environment)
+ if svc.WorkloadKey != "" {
+ env = mergeOtelResourceAttrInK8sEnv(env, "service.workload.key", svc.WorkloadKey)
+ }
+ if payload.OTLPProtocol != "" {
+ env = upsertEnvValue(env, "OTEL_EXPORTER_OTLP_PROTOCOL", payload.OTLPProtocol)
+ }
+ if payload.OTLPTracesEndpoint != "" {
+ env = upsertEnvValue(env, "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT", payload.OTLPTracesEndpoint)
+ }
+ if payload.OTLPMetricsEndpoint != "" {
+ env = upsertEnvValue(env, "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT", payload.OTLPMetricsEndpoint)
+ }
+ if payload.OTLPLogsEndpoint != "" {
+ env = upsertEnvValue(env, "OTEL_EXPORTER_OTLP_LOGS_ENDPOINT", payload.OTLPLogsEndpoint)
+ }
+ if len(payload.OTLPHeaders) > 0 {
+ env = upsertEnvValue(env, "OTEL_EXPORTER_OTLP_HEADERS", formatOTLPHeaders(payload.OTLPHeaders))
+ }
+ env = upsertEnvValue(env, "OPENLIT_DISABLED_INSTRUMENTORS", disabledInstrumentors)
+ return env
+}
+
+func removeCommonSDKK8sEnv(env []map[string]any) []map[string]any {
+ for _, key := range []string{
+ "OPENLIT_CONTROLLER_MODE",
+ "OTEL_EXPORTER_OTLP_ENDPOINT",
+ "OTEL_EXPORTER_OTLP_PROTOCOL",
+ "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT",
+ "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT",
+ "OTEL_EXPORTER_OTLP_LOGS_ENDPOINT",
+ "OTEL_EXPORTER_OTLP_HEADERS",
+ "OTEL_DEPLOYMENT_ENVIRONMENT",
+ "OPENLIT_DISABLED_INSTRUMENTORS",
+ } {
+ env = removeEnvValue(env, key)
+ }
+ return removeOtelResourceAttrFromK8sEnv(env, "service.workload.key")
+}
+
+func (e *Engine) enableNodeJSSDKDocker(svc *openlit.ServiceState, payload openlit.SDKActionPayload) error {
+ if e.container == nil || e.container.dockerClient == nil || !e.container.dockerClient.canManage() {
+ e.setAgentObservabilityState(svc.ID, "unsupported", "none", "", "Docker Agent Observability requires a writable Docker socket and a Docker-capable controller")
+ return fmt.Errorf("docker controller does not have writable Docker API access")
+ }
+ containerID := svc.ResourceAttributes["container.id"]
+ if containerID == "" {
+ e.setAgentObservabilityState(svc.ID, "unsupported", "none", "", "Docker container metadata is missing for this workload")
+ return fmt.Errorf("missing docker container id for %s", svc.ServiceName)
+ }
+ inspect, err := e.container.dockerClient.inspectContainer(containerID)
+ if err != nil {
+ e.setAgentObservabilityState(svc.ID, "error", "controller_managed", "", fmt.Sprintf("Failed to inspect Docker container: %v", err))
+ return err
+ }
+ preflight := evaluateNodeJSSDKPreflight(dockerInspectEnv(inspect), dockerInspectCommand(inspect), payload.DuplicatePolicy)
+ if err := e.applySDKPreflightResult(svc.ID, preflight); err != nil {
+ return err
+ }
+ if preflight.Decision == pythonSDKDecisionAdopt {
+ return nil
+ }
+ if err := ensureDockerContainerManageable(inspect); err != nil {
+ e.setAgentObservabilityState(svc.ID, "unsupported", "none", "", err.Error())
+ return err
+ }
+ volumeName := dockerNodeSDKVolumeName(svc)
+ if err := e.prepareDockerNodeSDKVolume(inspect, svc, volumeName, payload.SDKVersion); err != nil {
+ e.setAgentObservabilityState(svc.ID, "error", "controller_managed", "", err.Error())
+ return err
+ }
+ payloadMap, err := buildDockerNodeJSContainerCreatePayload(inspect, svc, payload, volumeName, true)
+ if err != nil {
+ e.setAgentObservabilityState(svc.ID, "error", "controller_managed", "", fmt.Sprintf("Failed to build container config: %v", err))
+ return err
+ }
+ if err := e.recreateDockerContainer(inspect, payloadMap); err != nil {
+ e.setAgentObservabilityState(svc.ID, "error", "controller_managed", "", err.Error())
+ return err
+ }
+ e.setAgentObservabilityState(svc.ID, "enabled", "controller_managed", "", fmt.Sprintf("OpenLIT SDK active via Docker container recreate (workload %s)", svc.WorkloadKey))
+ return nil
+}
+
+func (e *Engine) disableNodeJSSDKDocker(svc *openlit.ServiceState) error {
+ if e.container == nil || e.container.dockerClient == nil || !e.container.dockerClient.canManage() {
+ e.setAgentObservabilityState(svc.ID, "unsupported", "none", "", "Docker Agent Observability requires a writable Docker socket and a Docker-capable controller")
+ return fmt.Errorf("docker controller does not have writable Docker API access")
+ }
+ containerID := svc.ResourceAttributes["container.id"]
+ if containerID == "" {
+ e.setAgentObservabilityState(svc.ID, "unsupported", "none", "", "Docker container metadata is missing for this workload")
+ return fmt.Errorf("missing docker container id for %s", svc.ServiceName)
+ }
+ inspect, err := e.container.dockerClient.inspectContainer(containerID)
+ if err != nil {
+ e.setAgentObservabilityState(svc.ID, "error", "controller_managed", "", fmt.Sprintf("Failed to inspect Docker container: %v", err))
+ return err
+ }
+ volumeName := dockerNodeSDKVolumeName(svc)
+ payloadMap, err := buildDockerNodeJSContainerCreatePayload(inspect, svc, openlit.SDKActionPayload{}, volumeName, false)
+ if err != nil {
+ return err
+ }
+ if err := e.recreateDockerContainer(inspect, payloadMap); err != nil {
+ e.setAgentObservabilityState(svc.ID, "error", "controller_managed", "", err.Error())
+ return err
+ }
+ _ = e.container.dockerClient.removeVolume(volumeName)
+ e.setAgentObservabilityState(svc.ID, "disabled", "none", "", fmt.Sprintf("OpenLIT SDK removed via Docker container recreate (workload %s)", svc.WorkloadKey))
+ return nil
+}
+
+func (e *Engine) prepareDockerNodeSDKVolume(inspect map[string]any, svc *openlit.ServiceState, volumeName string, sdkVersion string) error {
+ if err := e.container.dockerClient.createVolume(volumeName, map[string]string{
+ openlitManagedLabel: "true",
+ openlitManagedVolumeLabel: svc.WorkloadKey,
+ }); err != nil {
+ return err
+ }
+ image := dockerInspectImage(inspect)
+ if image == "" {
+ return fmt.Errorf("docker sdk preparation requires image metadata")
+ }
+ helperPayload := map[string]any{
+ "Image": image,
+ "Entrypoint": []any{"sh"},
+ "Cmd": []any{"-c", buildNPMInstallShellCmd(openlitInstrumentationMountPath, sdkVersion)},
+ "HostConfig": map[string]any{
+ "Binds": []any{fmt.Sprintf("%s:%s", volumeName, openlitInstrumentationMountPath)},
+ "NetworkMode": dockerInspectHostConfigValue(inspect, "NetworkMode"),
+ },
+ }
+ helperName := "openlit-nodejs-sdk-installer-" + shortHash(svc.WorkloadKey+time.Now().String())
+ helperID, err := e.container.dockerClient.createContainer(helperName, helperPayload)
+ if err != nil {
+ return err
+ }
+ defer func() { _ = e.container.dockerClient.removeContainer(helperID, true) }()
+ if err := e.container.dockerClient.startContainer(helperID); err != nil {
+ return err
+ }
+ statusCode, err := e.container.dockerClient.waitContainer(helperID)
+ if err != nil {
+ return err
+ }
+ if statusCode != 0 {
+ return fmt.Errorf("docker sdk installer exited with status %d", statusCode)
+ }
+ return nil
+}
+
+func buildDockerNodeJSContainerCreatePayload(inspect map[string]any, svc *openlit.ServiceState, payload openlit.SDKActionPayload, volumeName string, enable bool) (map[string]any, error) {
+ configMap := dockerInspectConfig(inspect)
+ if configMap == nil {
+ return nil, fmt.Errorf("docker container config missing")
+ }
+ hostConfig := cloneMap(dockerInspectHostConfig(inspect))
+ networkingConfig := dockerInspectNetworkingConfig(inspect)
+ createPayload := map[string]any{}
+ copySelectedKeys(createPayload, configMap, []string{
+ "Hostname", "Domainname", "User", "AttachStdin", "AttachStdout", "AttachStderr",
+ "ExposedPorts", "Tty", "OpenStdin", "StdinOnce", "Env", "Cmd", "Healthcheck",
+ "ArgsEscaped", "Image", "Volumes", "WorkingDir", "Entrypoint", "NetworkDisabled",
+ "MacAddress", "Labels", "StopSignal", "StopTimeout", "Shell",
+ })
+ envValues := extractStringList(createPayload["Env"])
+ if enable {
+ envValues = upsertEnvString(envValues, "NODE_OPTIONS", prependNodeRequireOption(envValue(envValues, "NODE_OPTIONS"), dockerManagedNodeRegisterPath()))
+ envValues = appendCommonSDKEnvStrings(envValues, svc, payload, strings.Join(controllerManagedNodeDisabledInstrumentors, ","))
+ labels := extractStringMap(createPayload["Labels"])
+ labels[openlitManagedLabel] = "true"
+ labels[openlitManagedVolumeLabel] = volumeName
+ labels[openlitManagedConfigHash] = sdkConfigHash(svc, payload, nodeSDKRuntime)
+ createPayload["Labels"] = labels
+ hostConfig["Binds"] = upsertBindMount(extractStringList(hostConfig["Binds"]), fmt.Sprintf("%s:%s", volumeName, openlitInstrumentationMountPath), openlitInstrumentationMountPath)
+ } else {
+ envValues = removeCommonSDKEnvStrings(envValues)
+ envValues = removeNodeOptionsFromEnvStrings(envValues, dockerManagedNodeRegisterPath())
+ labels := extractStringMap(createPayload["Labels"])
+ delete(labels, openlitManagedLabel)
+ delete(labels, openlitManagedVolumeLabel)
+ delete(labels, openlitManagedConfigHash)
+ createPayload["Labels"] = labels
+ hostConfig["Binds"] = removeBindMount(extractStringList(hostConfig["Binds"]), openlitInstrumentationMountPath)
+ }
+ createPayload["Env"] = stringSliceToAny(envValues)
+ createPayload["HostConfig"] = hostConfig
+ if len(networkingConfig) > 0 {
+ createPayload["NetworkingConfig"] = networkingConfig
+ }
+ return createPayload, nil
+}
+
+func (e *Engine) enableNodeJSSDKLinux(svc *openlit.ServiceState, payload openlit.SDKActionPayload) error {
+ if !linuxSystemdSDKSupported() {
+ e.setAgentObservabilityState(svc.ID, "unsupported", "none", "", "Linux Agent Observability requires systemd and root-level unit management access")
+ return fmt.Errorf("linux controller does not have systemd management support")
+ }
+ unit := svc.ResourceAttributes["systemd.unit"]
+ if unit == "" {
+ e.setAgentObservabilityState(svc.ID, "unsupported", "none", "", "This Linux workload is not managed by systemd")
+ return fmt.Errorf("linux workload %s is not systemd-managed", svc.ServiceName)
+ }
+ if svc.ResourceAttributes["systemd.scope"] == "user" {
+ e.setAgentObservabilityState(svc.ID, "unsupported", "none", "", "User-scoped systemd services are not supported yet")
+ return fmt.Errorf("user-scoped systemd unit %s is not supported", unit)
+ }
+ preflight := evaluateNodeJSSDKPreflight(readEnviron(e.procRoot, svc.PID), strings.Fields(svc.Cmdline), payload.DuplicatePolicy)
+ if err := e.applySDKPreflightResult(svc.ID, preflight); err != nil {
+ return err
+ }
+ if preflight.Decision == pythonSDKDecisionAdopt {
+ return nil
+ }
+ sdkRoot := filepath.Join(nodeSystemdSDKStateDir, sanitizeSystemdUnit(unit))
+ if err := installNodeSDKFromNPM(sdkRoot, payload.SDKVersion); err != nil {
+ e.setAgentObservabilityState(svc.ID, "error", "controller_managed", "", err.Error())
+ return err
+ }
+ env := readEnviron(e.procRoot, svc.PID)
+ dropIn := buildNodeSystemdDropInContent(unit, sdkRoot, svc.ServiceName, svc.WorkloadKey, payload, strings.Join(controllerManagedNodeDisabledInstrumentors, ","), env["NODE_OPTIONS"], sdkConfigHash(svc, payload, nodeSDKRuntime))
+ if err := writeSystemdDropIn(unit, dropIn); err != nil {
+ return err
+ }
+ if err := runSystemctl("daemon-reload"); err != nil {
+ _ = removeSystemdDropIn(unit)
+ return err
+ }
+ if err := runSystemctl("try-restart", unit); err != nil {
+ _ = removeSystemdDropIn(unit)
+ _ = runSystemctl("daemon-reload")
+ return err
+ }
+ e.setAgentObservabilityState(svc.ID, "enabled", "controller_managed", "", fmt.Sprintf("OpenLIT SDK active via systemd drop-in (unit %s)", unit))
+ return nil
+}
+
+func (e *Engine) disableNodeJSSDKLinux(svc *openlit.ServiceState) error {
+ if !linuxSystemdSDKSupported() {
+ e.setAgentObservabilityState(svc.ID, "unsupported", "none", "", "Linux Agent Observability requires systemd and root-level unit management access")
+ return fmt.Errorf("linux controller does not have systemd management support")
+ }
+ unit := svc.ResourceAttributes["systemd.unit"]
+ if unit == "" {
+ e.setAgentObservabilityState(svc.ID, "unsupported", "none", "", "This Linux workload is not managed by systemd")
+ return fmt.Errorf("linux workload %s is not systemd-managed", svc.ServiceName)
+ }
+ if err := removeSystemdDropIn(unit); err != nil {
+ return err
+ }
+ if err := runSystemctl("daemon-reload"); err != nil {
+ return err
+ }
+ if err := runSystemctl("try-restart", unit); err != nil {
+ return err
+ }
+ e.setAgentObservabilityState(svc.ID, "disabled", "none", "", fmt.Sprintf("OpenLIT SDK removed via systemd drop-in (unit %s)", unit))
+ return nil
+}
+
+func (e *Engine) enableNodeJSSDKBareProcess(svc *openlit.ServiceState, payload openlit.SDKActionPayload) error {
+ preflight := evaluateNodeJSSDKPreflight(readEnviron(e.procRoot, svc.PID), strings.Fields(svc.Cmdline), payload.DuplicatePolicy)
+ if err := e.applySDKPreflightResult(svc.ID, preflight); err != nil {
+ return err
+ }
+ if preflight.Decision == pythonSDKDecisionAdopt {
+ return nil
+ }
+ fingerprint := shortHash(svc.WorkloadKey)
+ sdkRoot := filepath.Join(nodeBareProcessSDKStateDir, fingerprint)
+ if err := installNodeSDKFromNPM(sdkRoot, payload.SDKVersion); err != nil {
+ e.setDesiredAgentObservabilityState(svc.ID, "error", "controller_managed", "", fmt.Sprintf("Failed to install OpenLIT SDK: %v", err))
+ return err
+ }
+ existingEnv := readEnviron(e.procRoot, svc.PID)
+ nodeOptions := prependNodeRequireOption(existingEnv["NODE_OPTIONS"], bareManagedNodeRegisterPath(sdkRoot))
+ envOverrides := map[string]string{
+ "NODE_OPTIONS": nodeOptions,
+ "OPENLIT_CONTROLLER_MODE": controllerManagedAgentMode,
+ "OTEL_SERVICE_NAME": svc.ServiceName,
+ "OTEL_EXPORTER_OTLP_ENDPOINT": payload.OTLPEndpoint,
+ "OTEL_DEPLOYMENT_ENVIRONMENT": payload.Environment,
+ "OPENLIT_DISABLED_INSTRUMENTORS": strings.Join(controllerManagedNodeDisabledInstrumentors, ","),
+ }
+ if svc.WorkloadKey != "" {
+ envOverrides["OTEL_RESOURCE_ATTRIBUTES"] = mergeResourceAttrValue(existingEnv["OTEL_RESOURCE_ATTRIBUTES"], "service.workload.key", svc.WorkloadKey)
+ }
+ applyOTLPEnvOverrides(envOverrides, payload)
+ newPID, err := restartProcessWithEnv(e.procRoot, svc.PID, envOverrides)
+ if err != nil {
+ manualReason := fmt.Sprintf(
+ "OpenLIT SDK installed at %s. To activate, set these environment variables and restart your process:\n"+
+ " NODE_OPTIONS=\"--require %s $NODE_OPTIONS\"\n"+
+ " OPENLIT_CONTROLLER_MODE=agent_observability\n"+
+ " OTEL_SERVICE_NAME=%s\n"+
+ " OTEL_EXPORTER_OTLP_ENDPOINT=%s\n"+
+ " OTEL_DEPLOYMENT_ENVIRONMENT=%s\n"+
+ " OPENLIT_DISABLED_INSTRUMENTORS=%s",
+ sdkRoot,
+ bareManagedNodeRegisterPath(sdkRoot),
+ svc.ServiceName,
+ payload.OTLPEndpoint,
+ payload.Environment,
+ strings.Join(controllerManagedNodeDisabledInstrumentors, ","),
+ )
+ e.setDesiredAgentObservabilityState(svc.ID, "manual", "controller_managed", "", manualReason)
+ return nil
+ }
+ e.mu.Lock()
+ if s, ok := e.services[svc.ID]; ok {
+ s.PID = newPID
+ }
+ e.mu.Unlock()
+ e.setDesiredAgentObservabilityState(svc.ID, "enabled", "controller_managed", "", fmt.Sprintf("OpenLIT SDK active via process restart (PID %d -> %d)", svc.PID, newPID))
+ return nil
+}
+
+func (e *Engine) disableNodeJSSDKBareProcess(svc *openlit.ServiceState) error {
+ fingerprint := shortHash(svc.WorkloadKey)
+ sdkRoot := filepath.Join(nodeBareProcessSDKStateDir, fingerprint)
+ existingEnv := readEnviron(e.procRoot, svc.PID)
+ if existingEnv == nil {
+ existingEnv = make(map[string]string)
+ }
+ for _, key := range []string{
+ "OPENLIT_CONTROLLER_MODE",
+ "OTEL_SERVICE_NAME",
+ "OTEL_EXPORTER_OTLP_ENDPOINT",
+ "OTEL_EXPORTER_OTLP_PROTOCOL",
+ "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT",
+ "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT",
+ "OTEL_EXPORTER_OTLP_LOGS_ENDPOINT",
+ "OTEL_EXPORTER_OTLP_HEADERS",
+ "OTEL_DEPLOYMENT_ENVIRONMENT",
+ "OPENLIT_DISABLED_INSTRUMENTORS",
+ } {
+ delete(existingEnv, key)
+ }
+ if filtered := removeNodeRequireOption(existingEnv["NODE_OPTIONS"], bareManagedNodeRegisterPath(sdkRoot)); filtered == "" {
+ delete(existingEnv, "NODE_OPTIONS")
+ } else {
+ existingEnv["NODE_OPTIONS"] = filtered
+ }
+ if existing := existingEnv["OTEL_RESOURCE_ATTRIBUTES"]; existing != "" {
+ if filtered := removeResourceAttrKey(existing, "service.workload.key"); filtered == "" {
+ delete(existingEnv, "OTEL_RESOURCE_ATTRIBUTES")
+ } else {
+ existingEnv["OTEL_RESOURCE_ATTRIBUTES"] = filtered
+ }
+ }
+ newPID, err := restartProcess(e.procRoot, svc.PID, existingEnv)
+ if err != nil {
+ e.setDesiredAgentObservabilityState(svc.ID, "disabled", "none", "", "Agent O11y disabled. Remove the OpenLIT --require entry from NODE_OPTIONS and restart the process.")
+ } else {
+ e.mu.Lock()
+ if s, ok := e.services[svc.ID]; ok {
+ s.PID = newPID
+ }
+ e.mu.Unlock()
+ e.setDesiredAgentObservabilityState(svc.ID, "disabled", "none", "", fmt.Sprintf("Agent O11y disabled via process restart (PID %d -> %d)", svc.PID, newPID))
+ }
+ _ = os.RemoveAll(sdkRoot)
+ return nil
+}
+
+func (e *Engine) applySDKPreflightResult(serviceID string, preflight pythonSDKPreflightResult) error {
+ if preflight.Decision == pythonSDKDecisionBlock {
+ e.setAgentObservabilityState(serviceID, "conflict", preflight.Source, preflight.Conflict, preflight.Reason)
+ return fmt.Errorf("%s", preflight.Reason)
+ }
+ if preflight.Decision == pythonSDKDecisionAdopt {
+ e.setAgentObservabilityState(serviceID, "enabled", preflight.Source, "", preflight.Reason)
+ }
+ return nil
+}
+
+func evaluateNodeJSSDKPreflight(env map[string]string, command []string, duplicatePolicy string) pythonSDKPreflightResult {
+ lowerCommand := strings.ToLower(strings.Join(command, " "))
+ nodeOptions := env["NODE_OPTIONS"]
+ isControllerManaged := strings.EqualFold(env["OPENLIT_CONTROLLER_MODE"], controllerManagedAgentMode) ||
+ strings.Contains(nodeOptions, openlitInstrumentationMountPath) ||
+ strings.Contains(nodeOptions, nodeOpenLITRegisterModule)
+ if isControllerManaged {
+ return pythonSDKPreflightResult{Decision: pythonSDKDecisionAdopt, Source: "controller_managed", Reason: "Existing controller-managed OpenLIT JavaScript/TypeScript SDK configuration detected"}
+ }
+ if containsOpenLITNodeRequire(command) || containsOpenLITNodeRequire(strings.Fields(nodeOptions)) ||
+ env["OPENLIT_DISABLED_INSTRUMENTORS"] != "" || env["OPENLIT_DISABLE_METRICS"] != "" ||
+ env["OPENLIT_DISABLE_EVENTS"] != "" || strings.Contains(lowerCommand, "openlit") {
+ return pythonSDKPreflightResult{Decision: pythonSDKDecisionAdopt, Source: "existing_openlit", Reason: "Existing OpenLIT JavaScript/TypeScript SDK configuration detected and adopted"}
+ }
+ hasExistingOTel := containsOTelNodeRequire(command) || containsOTelNodeRequire(strings.Fields(nodeOptions)) ||
+ env["OTEL_NODE_RESOURCE_DETECTORS"] != "" ||
+ env["OTEL_NODE_ENABLED_INSTRUMENTATIONS"] != "" ||
+ env["OTEL_NODE_DISABLED_INSTRUMENTATIONS"] != "" ||
+ env["OTEL_TRACES_EXPORTER"] != "" ||
+ env["OTEL_METRICS_EXPORTER"] != "" ||
+ env["OTEL_LOGS_EXPORTER"] != "" ||
+ strings.Contains(lowerCommand, "@opentelemetry")
+ if hasExistingOTel && duplicatePolicy == defaultDuplicatePolicy {
+ return pythonSDKPreflightResult{Decision: pythonSDKDecisionBlock, Source: "existing_otel", Conflict: "existing_otel", Reason: "Existing OpenTelemetry Node.js instrumentation detected on target workload"}
+ }
+ return pythonSDKPreflightResult{Decision: pythonSDKDecisionApply, Source: "controller_managed", Reason: "Controller-managed OpenLIT JavaScript/TypeScript SDK will be applied"}
+}
+
+func containsOpenLITNodeRequire(args []string) bool {
+ return argsContainRequireModule(args, func(module string) bool {
+ m := strings.ToLower(module)
+ return strings.Contains(m, "openlit/register") || strings.Contains(m, "openlit/dist/register")
+ })
+}
+
+func containsOTelNodeRequire(args []string) bool {
+ return argsContainRequireModule(args, func(module string) bool {
+ m := strings.ToLower(module)
+ return strings.Contains(m, nodeOTelAutoRegisterModule) || strings.Contains(m, nodeOTelSDKModule)
+ })
+}
+
+func argsContainRequireModule(args []string, match func(string) bool) bool {
+ for i, arg := range args {
+ if arg == "--require" || arg == "-r" {
+ if i+1 < len(args) && match(args[i+1]) {
+ return true
+ }
+ continue
+ }
+ for _, prefix := range []string{"--require=", "-r="} {
+ if strings.HasPrefix(arg, prefix) && match(strings.TrimPrefix(arg, prefix)) {
+ return true
+ }
+ }
+ }
+ return false
+}
+
+func k8sManagedNodeRegisterPath() string {
+ return filepath.Join(openlitInstrumentationMountPath, nodeSDKDirName, nodeSDKRegisterRelPath)
+}
+
+func dockerManagedNodeRegisterPath() string {
+ return k8sManagedNodeRegisterPath()
+}
+
+func bareManagedNodeRegisterPath(sdkRoot string) string {
+ return filepath.Join(sdkRoot, nodeSDKRegisterRelPath)
+}
+
+func dockerNodeSDKVolumeName(svc *openlit.ServiceState) string {
+ return "openlit-nodejs-sdk-" + shortHash(svc.WorkloadKey)
+}
+
+func isNodeRuntime(runtime string) bool {
+ r := strings.ToLower(runtime)
+ return r == "nodejs" || r == "node" || strings.Contains(r, "javascript") || strings.Contains(r, "typescript")
+}
+
+func envValue(env []string, key string) string {
+ for _, entry := range env {
+ k, v, ok := strings.Cut(entry, "=")
+ if ok && k == key {
+ return v
+ }
+ }
+ return ""
+}
+
+func prependNodeRequireOption(existing, requirePath string) string {
+ return strings.TrimSpace("--require " + requirePath + " " + removeNodeRequireOption(existing, requirePath))
+}
+
+func removeNodeRequireOption(existing, requirePath string) string {
+ if existing == "" {
+ return ""
+ }
+ parts := strings.Fields(existing)
+ out := make([]string, 0, len(parts))
+ for i := 0; i < len(parts); i++ {
+ part := parts[i]
+ if (part == "--require" || part == "-r") && i+1 < len(parts) {
+ if parts[i+1] == requirePath {
+ i++
+ continue
+ }
+ out = append(out, part, parts[i+1])
+ i++
+ continue
+ }
+ if part == "--require="+requirePath || part == "-r="+requirePath {
+ continue
+ }
+ out = append(out, part)
+ }
+ return strings.Join(out, " ")
+}
+
+func removeNodeOptionsFromEnvStrings(env []string, requirePath string) []string {
+ for i, entry := range env {
+ key, value, ok := strings.Cut(entry, "=")
+ if !ok || key != "NODE_OPTIONS" {
+ continue
+ }
+ filtered := removeNodeRequireOption(value, requirePath)
+ if filtered == "" {
+ return append(env[:i], env[i+1:]...)
+ }
+ env[i] = "NODE_OPTIONS=" + filtered
+ return env
+ }
+ return env
+}
+
+func removeNodeOptionsFromK8sEnv(env []map[string]any, requirePath string) []map[string]any {
+ for i, item := range env {
+ if item["name"] != "NODE_OPTIONS" {
+ continue
+ }
+ value, _ := item["value"].(string)
+ filtered := removeNodeRequireOption(value, requirePath)
+ if filtered == "" {
+ return append(env[:i], env[i+1:]...)
+ }
+ item["value"] = filtered
+ env[i] = item
+ return env
+ }
+ return env
+}
+
+func upsertNodeOptionsInK8sEnv(env []map[string]any, requirePath string) ([]map[string]any, error) {
+ for index, item := range env {
+ if item["name"] != "NODE_OPTIONS" {
+ continue
+ }
+ if _, hasValueFrom := item["valueFrom"]; hasValueFrom {
+ return nil, fmt.Errorf("NODE_OPTIONS uses valueFrom and cannot be safely rewritten")
+ }
+ existing, _ := item["value"].(string)
+ env[index]["value"] = prependNodeRequireOption(existing, requirePath)
+ return env, nil
+ }
+ return append(env, map[string]any{"name": "NODE_OPTIONS", "value": prependNodeRequireOption("", requirePath)}), nil
+}
+
+func appendCommonSDKEnvStrings(envValues []string, svc *openlit.ServiceState, payload openlit.SDKActionPayload, disabledInstrumentors string) []string {
+ envValues = upsertEnvString(envValues, "OPENLIT_CONTROLLER_MODE", controllerManagedAgentMode)
+ envValues = upsertEnvString(envValues, "OTEL_SERVICE_NAME", svc.ServiceName)
+ envValues = upsertEnvString(envValues, "OTEL_EXPORTER_OTLP_ENDPOINT", payload.OTLPEndpoint)
+ envValues = upsertEnvString(envValues, "OTEL_DEPLOYMENT_ENVIRONMENT", payload.Environment)
+ if svc.WorkloadKey != "" {
+ envValues = mergeOtelResourceAttrInEnvString(envValues, "service.workload.key", svc.WorkloadKey)
+ }
+ if payload.OTLPProtocol != "" {
+ envValues = upsertEnvString(envValues, "OTEL_EXPORTER_OTLP_PROTOCOL", payload.OTLPProtocol)
+ }
+ if payload.OTLPTracesEndpoint != "" {
+ envValues = upsertEnvString(envValues, "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT", payload.OTLPTracesEndpoint)
+ }
+ if payload.OTLPMetricsEndpoint != "" {
+ envValues = upsertEnvString(envValues, "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT", payload.OTLPMetricsEndpoint)
+ }
+ if payload.OTLPLogsEndpoint != "" {
+ envValues = upsertEnvString(envValues, "OTEL_EXPORTER_OTLP_LOGS_ENDPOINT", payload.OTLPLogsEndpoint)
+ }
+ if len(payload.OTLPHeaders) > 0 {
+ envValues = upsertEnvString(envValues, "OTEL_EXPORTER_OTLP_HEADERS", formatOTLPHeaders(payload.OTLPHeaders))
+ }
+ return upsertEnvString(envValues, "OPENLIT_DISABLED_INSTRUMENTORS", disabledInstrumentors)
+}
+
+func removeCommonSDKEnvStrings(envValues []string) []string {
+ for _, key := range []string{
+ "OPENLIT_CONTROLLER_MODE",
+ "OTEL_EXPORTER_OTLP_ENDPOINT",
+ "OTEL_EXPORTER_OTLP_PROTOCOL",
+ "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT",
+ "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT",
+ "OTEL_EXPORTER_OTLP_LOGS_ENDPOINT",
+ "OTEL_EXPORTER_OTLP_HEADERS",
+ "OTEL_DEPLOYMENT_ENVIRONMENT",
+ "OPENLIT_DISABLED_INSTRUMENTORS",
+ } {
+ envValues = removeEnvString(envValues, key)
+ }
+ return removeOtelResourceAttrFromEnvString(envValues, "service.workload.key")
+}
+
+func applyOTLPEnvOverrides(env map[string]string, payload openlit.SDKActionPayload) {
+ if payload.OTLPProtocol != "" {
+ env["OTEL_EXPORTER_OTLP_PROTOCOL"] = payload.OTLPProtocol
+ }
+ if payload.OTLPTracesEndpoint != "" {
+ env["OTEL_EXPORTER_OTLP_TRACES_ENDPOINT"] = payload.OTLPTracesEndpoint
+ }
+ if payload.OTLPMetricsEndpoint != "" {
+ env["OTEL_EXPORTER_OTLP_METRICS_ENDPOINT"] = payload.OTLPMetricsEndpoint
+ }
+ if payload.OTLPLogsEndpoint != "" {
+ env["OTEL_EXPORTER_OTLP_LOGS_ENDPOINT"] = payload.OTLPLogsEndpoint
+ }
+ if len(payload.OTLPHeaders) > 0 {
+ env["OTEL_EXPORTER_OTLP_HEADERS"] = formatOTLPHeaders(payload.OTLPHeaders)
+ }
+}
+
+func buildNodeSystemdDropInContent(unit, sdkRoot, serviceName, workloadKey string, payload openlit.SDKActionPayload, disabledInstrumentors, existingNodeOptions, configHash string) string {
+ registerPath := bareManagedNodeRegisterPath(sdkRoot)
+ nodeOptions := prependNodeRequireOption(existingNodeOptions, registerPath)
+ var buf strings.Builder
+ buf.WriteString("[Service]\n")
+ buf.WriteString(fmt.Sprintf("# openlit-managed-unit=%s\n", unit))
+ buf.WriteString(fmt.Sprintf("# openlit-managed-config-hash=%s\n", configHash))
+ buf.WriteString(fmt.Sprintf("Environment=\"NODE_OPTIONS=%s\"\n", escapeSystemdValue(nodeOptions)))
+ buf.WriteString("Environment=\"OPENLIT_CONTROLLER_MODE=agent_observability\"\n")
+ buf.WriteString(fmt.Sprintf("Environment=\"OTEL_SERVICE_NAME=%s\"\n", escapeSystemdValue(serviceName)))
+ if workloadKey != "" {
+ buf.WriteString(fmt.Sprintf("Environment=\"OTEL_RESOURCE_ATTRIBUTES=service.workload.key=%s\"\n", escapeSystemdValue(workloadKey)))
+ }
+ buf.WriteString(fmt.Sprintf("Environment=\"OTEL_EXPORTER_OTLP_ENDPOINT=%s\"\n", escapeSystemdValue(payload.OTLPEndpoint)))
+ buf.WriteString(fmt.Sprintf("Environment=\"OTEL_DEPLOYMENT_ENVIRONMENT=%s\"\n", escapeSystemdValue(payload.Environment)))
+ if payload.OTLPProtocol != "" {
+ buf.WriteString(fmt.Sprintf("Environment=\"OTEL_EXPORTER_OTLP_PROTOCOL=%s\"\n", escapeSystemdValue(payload.OTLPProtocol)))
+ }
+ if payload.OTLPTracesEndpoint != "" {
+ buf.WriteString(fmt.Sprintf("Environment=\"OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=%s\"\n", escapeSystemdValue(payload.OTLPTracesEndpoint)))
+ }
+ if payload.OTLPMetricsEndpoint != "" {
+ buf.WriteString(fmt.Sprintf("Environment=\"OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=%s\"\n", escapeSystemdValue(payload.OTLPMetricsEndpoint)))
+ }
+ if payload.OTLPLogsEndpoint != "" {
+ buf.WriteString(fmt.Sprintf("Environment=\"OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=%s\"\n", escapeSystemdValue(payload.OTLPLogsEndpoint)))
+ }
+ if len(payload.OTLPHeaders) > 0 {
+ buf.WriteString(fmt.Sprintf("Environment=\"OTEL_EXPORTER_OTLP_HEADERS=%s\"\n", escapeSystemdValue(formatOTLPHeaders(payload.OTLPHeaders))))
+ }
+ buf.WriteString(fmt.Sprintf("Environment=\"OPENLIT_DISABLED_INSTRUMENTORS=%s\"\n", escapeSystemdValue(disabledInstrumentors)))
+ return buf.String()
+}
+
+func setManagedSDKAnnotations(annotations map[string]string, svc *openlit.ServiceState, payload openlit.SDKActionPayload, runtime string) {
+ annotations[openlitManagedAnnotation] = "true"
+ annotations[openlitManagedProfileAnnotation] = controllerManagedObservability
+ annotations[openlitManagedConfigHash] = sdkConfigHash(svc, payload, runtime)
+ annotations["openlit.io/sdk-runtime"] = runtime
+ versionLabel := payload.SDKVersion
+ if versionLabel == "" {
+ versionLabel = "latest"
+ }
+ annotations[openlitManagedSDKVersion] = versionLabel
+}
+
+func removeManagedSDKAnnotations(annotations map[string]string) {
+ delete(annotations, openlitManagedAnnotation)
+ delete(annotations, openlitManagedProfileAnnotation)
+ delete(annotations, openlitManagedConfigHash)
+ delete(annotations, openlitManagedSDKVersion)
+ delete(annotations, "openlit.io/sdk-runtime")
+}
+
+func sdkConfigHash(svc *openlit.ServiceState, payload openlit.SDKActionPayload, runtime string) string {
+ data, err := json.Marshal(map[string]any{
+ "service": svc.ID,
+ "runtime": runtime,
+ "payload": payload,
+ })
+ if err != nil {
+ data = []byte(fmt.Sprintf("%s|%s|%+v", svc.ID, runtime, payload))
+ }
+ sum := sha256.Sum256(data)
+ return hex.EncodeToString(sum[:8])
+}
diff --git a/openlit-controller/internal/engine/node_sdk_test.go b/openlit-controller/internal/engine/node_sdk_test.go
new file mode 100644
index 00000000..8f85aca1
--- /dev/null
+++ b/openlit-controller/internal/engine/node_sdk_test.go
@@ -0,0 +1,254 @@
+package engine
+
+import (
+ "strings"
+ "testing"
+
+ "github.com/openlit/openlit/openlit-controller/internal/openlit"
+)
+
+func TestEvaluateNodeJSSDKPreflight(t *testing.T) {
+ tests := []struct {
+ name string
+ command []string
+ env map[string]string
+ decision pythonSDKDecision
+ source string
+ }{
+ {
+ name: "plain node app applies controller sdk",
+ command: []string{"node", "server.js"},
+ env: map[string]string{},
+ decision: pythonSDKDecisionApply,
+ source: "controller_managed",
+ },
+ {
+ name: "controller managed node options adopts",
+ command: []string{"node", "server.js"},
+ env: map[string]string{"NODE_OPTIONS": "--require /instrumentation-packages/node-sdk/node_modules/openlit/dist/register.js"},
+ decision: pythonSDKDecisionAdopt,
+ source: "controller_managed",
+ },
+ {
+ name: "manual openlit register adopts",
+ command: []string{"node", "--require", "openlit/register", "server.js"},
+ env: map[string]string{},
+ decision: pythonSDKDecisionAdopt,
+ source: "existing_openlit",
+ },
+ {
+ name: "otel auto instrumentation blocks",
+ command: []string{"node", "server.js"},
+ env: map[string]string{"NODE_OPTIONS": "--require=@opentelemetry/auto-instrumentations-node/register"},
+ decision: pythonSDKDecisionBlock,
+ source: "existing_otel",
+ },
+ {
+ name: "otel sdk shorthand blocks",
+ command: []string{"node", "-r", "@opentelemetry/sdk-node", "server.js"},
+ env: map[string]string{},
+ decision: pythonSDKDecisionBlock,
+ source: "existing_otel",
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ got := evaluateNodeJSSDKPreflight(tt.env, tt.command, defaultDuplicatePolicy)
+ if got.Decision != tt.decision || got.Source != tt.source {
+ t.Fatalf("expected %s/%s, got %+v", tt.decision, tt.source, got)
+ }
+ })
+ }
+}
+
+func TestNodeRequireOptionMergeAndRemove(t *testing.T) {
+ const registerPath = "/opt/openlit/node_modules/openlit/dist/register.js"
+ got := prependNodeRequireOption("--inspect=0.0.0.0:9229 -r ./user-hook.js", registerPath)
+ if got != "--require "+registerPath+" --inspect=0.0.0.0:9229 -r ./user-hook.js" {
+ t.Fatalf("unexpected NODE_OPTIONS merge: %q", got)
+ }
+ if again := prependNodeRequireOption(got, registerPath); again != got {
+ t.Fatalf("expected idempotent merge, got %q", again)
+ }
+ removed := removeNodeRequireOption(got, registerPath)
+ if removed != "--inspect=0.0.0.0:9229 -r ./user-hook.js" {
+ t.Fatalf("unexpected NODE_OPTIONS removal: %q", removed)
+ }
+}
+
+func TestBuildNodeJSSDKWorkloadPatch(t *testing.T) {
+ workload := map[string]any{
+ "spec": map[string]any{
+ "template": map[string]any{
+ "metadata": map[string]any{"annotations": map[string]any{}},
+ "spec": map[string]any{
+ "containers": []any{
+ map[string]any{
+ "name": "app",
+ "image": "node:20-alpine",
+ "env": []any{
+ map[string]any{"name": "NODE_OPTIONS", "value": "--max-old-space-size=512"},
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+ svc := &openlit.ServiceState{
+ ID: "svc-node",
+ ServiceName: "node-demo",
+ WorkloadKey: "k8s:default:deployment/node-demo",
+ }
+ payload := openlit.SDKActionPayload{
+ TargetRuntime: "nodejs",
+ OTLPEndpoint: "http://otel:4318",
+ Environment: "prod",
+ }
+
+ patch, err := buildNodeJSSDKWorkloadPatch(workload, "app", svc, payload, true)
+ if err != nil {
+ t.Fatalf("enable patch failed: %v", err)
+ }
+ template := patch["spec"].(map[string]any)["template"].(map[string]any)
+ templateSpec := template["spec"].(map[string]any)
+ containers := extractObjectSlice(templateSpec["containers"])
+ env := extractContainerEnv(containers[0])
+ if !strings.HasPrefix(env["NODE_OPTIONS"], "--require /instrumentation-packages/node-sdk/node_modules/openlit/dist/register.js ") {
+ t.Fatalf("expected managed register in NODE_OPTIONS, got %q", env["NODE_OPTIONS"])
+ }
+ if !strings.Contains(env["NODE_OPTIONS"], "--max-old-space-size=512") {
+ t.Fatalf("expected user NODE_OPTIONS preserved, got %q", env["NODE_OPTIONS"])
+ }
+ if env["OTEL_SERVICE_NAME"] != "node-demo" || env["OTEL_EXPORTER_OTLP_ENDPOINT"] != "http://otel:4318" {
+ t.Fatalf("expected common OTLP env, got %+v", env)
+ }
+ if !strings.Contains(env["OPENLIT_DISABLED_INSTRUMENTORS"], "openai") || strings.Contains(env["OPENLIT_DISABLED_INSTRUMENTORS"], "langchain") {
+ t.Fatalf("expected direct-client disabled list without agent framework instrumentors, got %q", env["OPENLIT_DISABLED_INSTRUMENTORS"])
+ }
+ initContainers := extractObjectSlice(templateSpec["initContainers"])
+ if len(initContainers) != 1 {
+ t.Fatalf("expected init container")
+ }
+ initCmd := extractStringSlice(initContainers[0]["command"])
+ if len(initCmd) < 3 || !strings.Contains(initCmd[2], "npm install") || !strings.Contains(initCmd[2], "openlit") {
+ t.Fatalf("expected npm install openlit command, got %v", initCmd)
+ }
+
+ disablePatch, err := buildNodeJSSDKWorkloadPatch(patch, "app", svc, payload, false)
+ if err != nil {
+ t.Fatalf("disable patch failed: %v", err)
+ }
+ disableSpec := disablePatch["spec"].(map[string]any)["template"].(map[string]any)["spec"].(map[string]any)
+ disableEnv := extractContainerEnv(extractObjectSlice(disableSpec["containers"])[0])
+ if strings.Contains(disableEnv["NODE_OPTIONS"], "openlit") {
+ t.Fatalf("expected managed register removed, got %q", disableEnv["NODE_OPTIONS"])
+ }
+ if disableEnv["NODE_OPTIONS"] != "--max-old-space-size=512" {
+ t.Fatalf("expected user NODE_OPTIONS preserved, got %q", disableEnv["NODE_OPTIONS"])
+ }
+ if _, ok := disableEnv["OPENLIT_CONTROLLER_MODE"]; ok {
+ t.Fatalf("expected common SDK env removed, got %+v", disableEnv)
+ }
+}
+
+func TestBuildDockerNodeJSContainerCreatePayload(t *testing.T) {
+ inspect := map[string]any{
+ "Config": map[string]any{
+ "Env": []any{"NODE_OPTIONS=--trace-warnings"},
+ "Image": "node:20",
+ "Cmd": []any{"node", "server.js"},
+ "Labels": map[string]any{},
+ },
+ "HostConfig": map[string]any{"Binds": []any{}},
+ }
+ svc := &openlit.ServiceState{
+ ID: "docker:node-demo",
+ WorkloadKey: "docker:node-demo",
+ ServiceName: "node-demo",
+ }
+ payload := openlit.SDKActionPayload{TargetRuntime: "nodejs", OTLPEndpoint: "http://otel:4318"}
+ result, err := buildDockerNodeJSContainerCreatePayload(inspect, svc, payload, "openlit-nodejs-sdk-abc", true)
+ if err != nil {
+ t.Fatalf("build docker payload failed: %v", err)
+ }
+ env := strings.Join(extractStringList(result["Env"]), "\n")
+ if !strings.Contains(env, "NODE_OPTIONS=--require /instrumentation-packages/node-sdk/node_modules/openlit/dist/register.js --trace-warnings") {
+ t.Fatalf("expected managed NODE_OPTIONS with user flags preserved, got %s", env)
+ }
+ if !strings.Contains(env, "OPENLIT_CONTROLLER_MODE=agent_observability") {
+ t.Fatalf("expected controller mode env, got %s", env)
+ }
+ hostConfig := result["HostConfig"].(map[string]any)
+ binds := extractStringList(hostConfig["Binds"])
+ if len(binds) != 1 || binds[0] != "openlit-nodejs-sdk-abc:/instrumentation-packages" {
+ t.Fatalf("expected instrumentation bind mount, got %v", binds)
+ }
+}
+
+func TestBuildNodeSystemdDropInContent(t *testing.T) {
+ content := buildNodeSystemdDropInContent(
+ "node-ai.service",
+ "/var/lib/openlit/nodejs-sdk/node-ai.service",
+ "node-ai",
+ "linux:systemd:node-ai.service",
+ openlit.SDKActionPayload{
+ OTLPEndpoint: "http://otel:4318",
+ Environment: "production",
+ },
+ "openai,anthropic",
+ "--trace-warnings",
+ "abc123",
+ )
+
+ if !strings.Contains(content, "NODE_OPTIONS=--require /var/lib/openlit/nodejs-sdk/node-ai.service/node_modules/openlit/dist/register.js --trace-warnings") {
+ t.Fatalf("expected managed NODE_OPTIONS with existing flags preserved, got %s", content)
+ }
+ if !strings.Contains(content, "OTEL_SERVICE_NAME=node-ai") {
+ t.Fatalf("expected service name, got %s", content)
+ }
+ if !strings.Contains(content, "OTEL_RESOURCE_ATTRIBUTES=service.workload.key=linux:systemd:node-ai.service") {
+ t.Fatalf("expected workload resource attr, got %s", content)
+ }
+ if !strings.Contains(content, "OPENLIT_DISABLED_INSTRUMENTORS=openai,anthropic") {
+ t.Fatalf("expected disabled instrumentors, got %s", content)
+ }
+}
+
+func TestNormalizeSDKPayloadRuntimeVersionSelection(t *testing.T) {
+ eng := newTestEngine()
+ eng.sdkVersion = "1.34.0" // PyPI version
+ eng.nodeSDKVersion = "1.13.0" // independent npm version
+
+ // Node target must take the npm-side default, never the PyPI version.
+ nodePayload := eng.normalizeSDKPayload(openlit.SDKActionPayload{TargetRuntime: "nodejs"}, "python")
+ if nodePayload.SDKVersion != "1.13.0" {
+ t.Fatalf("expected node payload to use nodeSDKVersion, got %q", nodePayload.SDKVersion)
+ }
+
+ // Python target keeps the PyPI default.
+ pyPayload := eng.normalizeSDKPayload(openlit.SDKActionPayload{TargetRuntime: "python"}, "python")
+ if pyPayload.SDKVersion != "1.34.0" {
+ t.Fatalf("expected python payload to use sdkVersion, got %q", pyPayload.SDKVersion)
+ }
+
+ // An explicit version is always respected and never overridden by defaults.
+ pinned := eng.normalizeSDKPayload(openlit.SDKActionPayload{TargetRuntime: "nodejs", SDKVersion: "2.0.0"}, "python")
+ if pinned.SDKVersion != "2.0.0" {
+ t.Fatalf("expected explicit version preserved, got %q", pinned.SDKVersion)
+ }
+}
+
+func TestDetectAgentObservabilityNodeJS(t *testing.T) {
+ status, source, conflict, reason := detectAgentObservability("nodejs", "node server.js", map[string]string{})
+ if status != "disabled" || source != "none" || conflict != "" || !strings.Contains(reason, "JavaScript/TypeScript") {
+ t.Fatalf("unexpected default node observability state: %s %s %s %q", status, source, conflict, reason)
+ }
+ status, source, conflict, _ = detectAgentObservability("nodejs", "node server.js", map[string]string{
+ "NODE_OPTIONS": "--require /instrumentation-packages/node-sdk/node_modules/openlit/dist/register.js",
+ })
+ if status != "enabled" || source != "controller_managed" || conflict != "" {
+ t.Fatalf("expected controller-managed node sdk detection, got %s %s %s", status, source, conflict)
+ }
+}
diff --git a/openlit-controller/internal/engine/obi.go b/openlit-controller/internal/engine/obi.go
index 8e320415..19cc0a05 100644
--- a/openlit-controller/internal/engine/obi.go
+++ b/openlit-controller/internal/engine/obi.go
@@ -282,17 +282,18 @@ type obiHTTP struct {
GenAI obiGenAI `yaml:"genai"`
}
-// obiGenAI mirrors OBI v0.9.0's genai payload-extraction config, plus our two
+// obiGenAI mirrors OBI v0.10.0's genai payload-extraction config, plus our two
// added extractors (custom, ollama). OBI natively parses OpenAI, Anthropic,
-// Gemini, Qwen, and Bedrock; the many OpenAI-compatible SaaS providers
-// (Groq, Mistral, Together, ...) are all handled by the OpenAI parser, so we do
-// not carry a separate flag per vendor — discovery maps them to "openai".
+// Gemini, Qwen, Bedrock, and vector retrieval; the many OpenAI-compatible SaaS
+// providers (Groq, Mistral, Together, ...) are all handled by the OpenAI parser,
+// so we do not carry a separate flag per vendor - discovery maps them to "openai".
type obiGenAI struct {
OpenAI obiEnabled `yaml:"openai"`
Anthropic obiEnabled `yaml:"anthropic"`
Gemini obiEnabled `yaml:"gemini"`
Qwen obiEnabled `yaml:"qwen"`
Bedrock obiEnabled `yaml:"bedrock"`
+ Retrieval obiEnabled `yaml:"retrieval"`
Custom obiCustomEnabled `yaml:"custom"`
Ollama obiEnabled `yaml:"ollama"`
}
@@ -407,6 +408,7 @@ func BuildInstrumentConfig(
cfg.EBPF.PayloadExtraction.HTTP.GenAI.Gemini.Enabled = enabledProviders["gemini"]
cfg.EBPF.PayloadExtraction.HTTP.GenAI.Qwen.Enabled = enabledProviders["qwen"]
cfg.EBPF.PayloadExtraction.HTTP.GenAI.Bedrock.Enabled = enabledProviders["bedrock"]
+ cfg.EBPF.PayloadExtraction.HTTP.GenAI.Retrieval.Enabled = enabledProviders["retrieval"]
// Self-hosted gateways discovered via custom_llm_hosts.
cfg.EBPF.PayloadExtraction.HTTP.GenAI.Custom.Enabled = enabledProviders["custom"]
if enabledProviders["custom"] {
diff --git a/openlit-controller/internal/engine/obi_genai_test.go b/openlit-controller/internal/engine/obi_genai_test.go
index 9a60b781..e40eecd3 100644
--- a/openlit-controller/internal/engine/obi_genai_test.go
+++ b/openlit-controller/internal/engine/obi_genai_test.go
@@ -53,6 +53,9 @@ func TestBuildInstrumentConfigNativeProviders(t *testing.T) {
if g := buildGenAI(t, "qwen"); !g.Qwen.Enabled || g.OpenAI.Enabled {
t.Fatalf("qwen mapping wrong: %+v", g)
}
+ if g := buildGenAI(t, "retrieval"); !g.Retrieval.Enabled || g.OpenAI.Enabled {
+ t.Fatalf("retrieval mapping wrong: %+v", g)
+ }
}
// Custom gateways enable the custom extractor only.
@@ -98,7 +101,8 @@ func TestBuildInstrumentConfigOllama(t *testing.T) {
func TestBuildInstrumentConfigEmpty(t *testing.T) {
g := buildGenAI(t)
if g.OpenAI.Enabled || g.Anthropic.Enabled || g.Gemini.Enabled ||
- g.Qwen.Enabled || g.Bedrock.Enabled || g.Custom.Enabled || g.Ollama.Enabled {
+ g.Qwen.Enabled || g.Bedrock.Enabled || g.Retrieval.Enabled ||
+ g.Custom.Enabled || g.Ollama.Enabled {
t.Fatalf("no providers should enable nothing: %+v", g)
}
}
diff --git a/openlit-controller/internal/engine/process.go b/openlit-controller/internal/engine/process.go
index 853c6c90..0d3cb371 100644
--- a/openlit-controller/internal/engine/process.go
+++ b/openlit-controller/internal/engine/process.go
@@ -213,18 +213,29 @@ func detectSystemdUnit(cgroup string) (unit string, isUserService bool) {
}
func detectAgentObservability(runtime, cmdline string, env map[string]string) (status, source, conflict, reason string) {
- if runtime != "python" {
- return "unsupported", "none", "", "Agent observability is only available for Python runtimes"
- }
-
- preflight := evaluatePythonSDKPreflight(env, strings.Fields(cmdline), defaultDuplicatePolicy)
- switch preflight.Decision {
- case pythonSDKDecisionAdopt:
- return "enabled", preflight.Source, "", preflight.Reason
- case pythonSDKDecisionBlock:
- return "disabled", preflight.Source, preflight.Conflict, preflight.Reason
+ switch runtime {
+ case "python":
+ preflight := evaluatePythonSDKPreflight(env, strings.Fields(cmdline), defaultDuplicatePolicy)
+ switch preflight.Decision {
+ case pythonSDKDecisionAdopt:
+ return "enabled", preflight.Source, "", preflight.Reason
+ case pythonSDKDecisionBlock:
+ return "disabled", preflight.Source, preflight.Conflict, preflight.Reason
+ default:
+ return "disabled", "none", "", "Python runtime detected but OpenLIT Python SDK not enabled"
+ }
+ case "nodejs":
+ preflight := evaluateNodeJSSDKPreflight(env, strings.Fields(cmdline), defaultDuplicatePolicy)
+ switch preflight.Decision {
+ case pythonSDKDecisionAdopt:
+ return "enabled", preflight.Source, "", preflight.Reason
+ case pythonSDKDecisionBlock:
+ return "disabled", preflight.Source, preflight.Conflict, preflight.Reason
+ default:
+ return "disabled", "none", "", "JavaScript/TypeScript runtime detected but OpenLIT SDK not enabled"
+ }
default:
- return "disabled", "none", "", "Python runtime detected but OpenLIT Python SDK not enabled"
+ return "unsupported", "none", "", "Agent observability is only available for Python and JavaScript/TypeScript runtimes"
}
}
diff --git a/openlit-controller/internal/engine/python_sdk.go b/openlit-controller/internal/engine/python_sdk.go
index 2b0190cd..f2d73179 100644
--- a/openlit-controller/internal/engine/python_sdk.go
+++ b/openlit-controller/internal/engine/python_sdk.go
@@ -68,39 +68,12 @@ var controllerManagedDisabledInstrumentors = []string{
}
func (e *Engine) EnablePythonSDK(serviceID string, payload openlit.PythonSDKActionPayload) error {
- if payload.TargetRuntime == "" {
- payload.TargetRuntime = "python"
- }
- if payload.InstrumentationProfile == "" {
- payload.InstrumentationProfile = controllerManagedObservability
- }
- if payload.ObservabilityScope == "" {
- payload.ObservabilityScope = "agent"
- }
- if payload.DuplicatePolicy == "" {
- payload.DuplicatePolicy = defaultDuplicatePolicy
+ payload = e.normalizeSDKPayload(payload, "python")
+ if isNodeRuntime(payload.TargetRuntime) {
+ return e.EnableNodeJSSDK(serviceID, payload)
}
- expCfg := e.GetExportConfig()
- if payload.OTLPEndpoint == "" {
- payload.OTLPEndpoint = expCfg.OTLPEndpoint
- }
- if payload.OTLPProtocol == "" {
- payload.OTLPProtocol = expCfg.OTLPProtocol
- }
- if payload.OTLPHeaders == nil && len(expCfg.OTLPHeaders) > 0 {
- payload.OTLPHeaders = expCfg.OTLPHeaders
- }
- if payload.OTLPTracesEndpoint == "" {
- payload.OTLPTracesEndpoint = expCfg.OTLPTracesEndpoint
- }
- if payload.OTLPMetricsEndpoint == "" {
- payload.OTLPMetricsEndpoint = expCfg.OTLPMetricsEndpoint
- }
- if payload.OTLPLogsEndpoint == "" {
- payload.OTLPLogsEndpoint = expCfg.OTLPLogsEndpoint
- }
- if payload.SDKVersion == "" {
- payload.SDKVersion = e.sdkVersion
+ if strings.ToLower(payload.TargetRuntime) != "python" {
+ return fmt.Errorf("unsupported SDK target_runtime %q", payload.TargetRuntime)
}
// sdk_version is attacker-controllable (it arrives in the poll action payload
// and is interpolated into pip install commands, including shell strings for
@@ -109,9 +82,6 @@ func (e *Engine) EnablePythonSDK(serviceID string, payload openlit.PythonSDKActi
if !isValidSDKVersion(payload.SDKVersion) {
return fmt.Errorf("invalid sdk_version %q: must match a PEP 440 version (letters, digits, . _ + -)", payload.SDKVersion)
}
- if payload.Environment == "" {
- payload.Environment = e.environment
- }
svc, err := e.serviceSnapshot(serviceID)
if err != nil {
@@ -223,7 +193,13 @@ func (e *Engine) EnablePythonSDK(serviceID string, payload openlit.PythonSDKActi
}
}
-func (e *Engine) DisablePythonSDK(serviceID string, _ openlit.PythonSDKActionPayload) error {
+func (e *Engine) DisablePythonSDK(serviceID string, payload openlit.PythonSDKActionPayload) error {
+ if isNodeRuntime(payload.TargetRuntime) {
+ return e.DisableNodeJSSDK(serviceID, payload)
+ }
+ if payload.TargetRuntime != "" && strings.ToLower(payload.TargetRuntime) != "python" {
+ return fmt.Errorf("unsupported SDK target_runtime %q", payload.TargetRuntime)
+ }
svc, err := e.serviceSnapshot(serviceID)
if err != nil {
return err
@@ -307,6 +283,56 @@ func (e *Engine) DisablePythonSDK(serviceID string, _ openlit.PythonSDKActionPay
}
}
+func (e *Engine) normalizeSDKPayload(payload openlit.SDKActionPayload, defaultRuntime string) openlit.SDKActionPayload {
+ if payload.TargetRuntime == "" {
+ payload.TargetRuntime = defaultRuntime
+ }
+ if payload.InstrumentationProfile == "" {
+ payload.InstrumentationProfile = controllerManagedObservability
+ }
+ if payload.ObservabilityScope == "" {
+ payload.ObservabilityScope = "agent"
+ }
+ if payload.DuplicatePolicy == "" {
+ payload.DuplicatePolicy = defaultDuplicatePolicy
+ }
+ expCfg := e.GetExportConfig()
+ if payload.OTLPEndpoint == "" {
+ payload.OTLPEndpoint = expCfg.OTLPEndpoint
+ }
+ if payload.OTLPProtocol == "" {
+ payload.OTLPProtocol = expCfg.OTLPProtocol
+ }
+ if payload.OTLPHeaders == nil && len(expCfg.OTLPHeaders) > 0 {
+ payload.OTLPHeaders = expCfg.OTLPHeaders
+ }
+ if payload.OTLPTracesEndpoint == "" {
+ payload.OTLPTracesEndpoint = expCfg.OTLPTracesEndpoint
+ }
+ if payload.OTLPMetricsEndpoint == "" {
+ payload.OTLPMetricsEndpoint = expCfg.OTLPMetricsEndpoint
+ }
+ if payload.OTLPLogsEndpoint == "" {
+ payload.OTLPLogsEndpoint = expCfg.OTLPLogsEndpoint
+ }
+ if payload.SDKVersion == "" {
+ // PyPI (Python) and npm (Node) publish the `openlit` package under
+ // independent version numbers, so each runtime gets its own default.
+ // Falling the Node default back to e.sdkVersion is intentionally
+ // avoided: a version valid on PyPI is unlikely to exist on npm and
+ // would make `npm install openlit@<version>` fail.
+ if isNodeRuntime(payload.TargetRuntime) {
+ payload.SDKVersion = e.nodeSDKVersion
+ } else {
+ payload.SDKVersion = e.sdkVersion
+ }
+ }
+ if payload.Environment == "" {
+ payload.Environment = e.environment
+ }
+ return payload
+}
+
func (e *Engine) serviceSnapshot(serviceID string) (*openlit.ServiceState, error) {
e.mu.RLock()
defer e.mu.RUnlock()
diff --git a/openlit-controller/internal/engine/runtime_discovery.go b/openlit-controller/internal/engine/runtime_discovery.go
new file mode 100644
index 00000000..bd5c017a
--- /dev/null
+++ b/openlit-controller/internal/engine/runtime_discovery.go
@@ -0,0 +1,191 @@
+package engine
+
+import (
+ "context"
+ "encoding/json"
+ "os"
+ "path/filepath"
+ "sort"
+ "strconv"
+ "strings"
+ "time"
+
+ "github.com/openlit/openlit/openlit-controller/internal/openlit"
+ "go.uber.org/zap"
+)
+
+const runtimeDiscoveryInterval = 10 * time.Second
+
+var nodeAgentProviderPackages = map[string]string{
+ "@openai/agents": "openai",
+}
+
+func (e *Engine) discoverRuntimeServicesLoop(ctx context.Context) {
+ ticker := time.NewTicker(runtimeDiscoveryInterval)
+ defer ticker.Stop()
+
+ e.discoverRuntimeServices()
+ for {
+ select {
+ case <-ctx.Done():
+ return
+ case <-ticker.C:
+ e.discoverRuntimeServices()
+ }
+ }
+}
+
+func (e *Engine) discoverRuntimeServices() {
+ pids := listProcPIDs(e.procRoot)
+ for _, pid := range pids {
+ cmdline := readCmdline(e.procRoot, pid)
+ exePath := readExePath(e.procRoot, pid)
+ runtime := detectRuntime(exePath, cmdline)
+ if runtime != "nodejs" {
+ continue
+ }
+ providers := detectNodeAgentProviders(e.procRoot, pid)
+ if len(providers) == 0 {
+ continue
+ }
+
+ meta := EnrichProcess(e.procRoot, pid, e.container, e.deployMode)
+ if ignoredServiceNames[meta.ServiceName] {
+ continue
+ }
+ e.upsertRuntimeDiscoveredService(meta, providers)
+ }
+}
+
+func (e *Engine) upsertRuntimeDiscoveredService(meta *ProcessMetadata, providers []string) {
+ id := serviceID(meta, e.deployMode)
+ if id == "" {
+ e.logger.Debug("skipping runtime discovery: could not resolve workload identity",
+ zap.Int("pid", meta.PID),
+ zap.String("service", meta.ServiceName),
+ )
+ return
+ }
+
+ e.mu.Lock()
+ defer e.mu.Unlock()
+
+ now := time.Now()
+ svcAttrs := buildServiceResourceAttrs(meta, meta.PID, e.deployMode)
+ if existing, ok := e.services[id]; ok {
+ existing.ServiceName = meta.ServiceName
+ existing.Namespace = meta.Namespace
+ existing.WorkloadKey = id
+ existing.LanguageRuntime = meta.Runtime
+ existing.DeploymentName = meta.DeploymentName
+ applyObservedAgentObservability(existing, meta)
+ existing.LastSeen = now
+ existing.LLMProviders = mergeProviders(existing.LLMProviders, providers)
+ existing.PID = meta.PID
+ existing.ExePath = meta.ExePath
+ existing.Cmdline = meta.Cmdline
+ existing.ResourceAttributes = svcAttrs
+ augmentServiceAttrsFromState(existing)
+ return
+ }
+
+ e.services[id] = &openlit.ServiceState{
+ ID: id,
+ ServiceName: meta.ServiceName,
+ WorkloadKey: id,
+ Namespace: meta.Namespace,
+ LanguageRuntime: meta.Runtime,
+ LLMProviders: providers,
+ DeploymentName: meta.DeploymentName,
+ InstrumentationStatus: "discovered",
+ AgentObservabilityStatus: meta.AgentObservabilityStatus,
+ AgentObservabilitySource: meta.AgentObservabilitySource,
+ ObservabilityConflict: meta.ObservabilityConflict,
+ ObservabilityReason: meta.ObservabilityReason,
+ FirstSeen: now,
+ LastSeen: now,
+ PID: meta.PID,
+ ExePath: meta.ExePath,
+ Cmdline: meta.Cmdline,
+ ResourceAttributes: svcAttrs,
+ }
+ augmentServiceAttrsFromState(e.services[id])
+ e.logger.Info("discovered runtime AI service",
+ zap.String("service", meta.ServiceName),
+ zap.Int("pid", meta.PID),
+ zap.Strings("providers", providers),
+ )
+}
+
+func listProcPIDs(procRoot string) []int {
+ entries, err := os.ReadDir(procRoot)
+ if err != nil {
+ return nil
+ }
+ pids := make([]int, 0, len(entries))
+ for _, entry := range entries {
+ if !entry.IsDir() {
+ continue
+ }
+ pid, err := strconv.Atoi(entry.Name())
+ if err == nil && pid > 0 {
+ pids = append(pids, pid)
+ }
+ }
+ sort.Ints(pids)
+ return pids
+}
+
+func detectNodeAgentProviders(procRoot string, pid int) []string {
+ packagePath := packageJSONPathForProcess(procRoot, pid)
+ if packagePath == "" {
+ return nil
+ }
+ data, err := os.ReadFile(packagePath)
+ if err != nil {
+ return nil
+ }
+
+ var pkg struct {
+ Dependencies map[string]string `json:"dependencies"`
+ DevDependencies map[string]string `json:"devDependencies"`
+ OptionalDependencies map[string]string `json:"optionalDependencies"`
+ PeerDependencies map[string]string `json:"peerDependencies"`
+ }
+ if err := json.Unmarshal(data, &pkg); err != nil {
+ return nil
+ }
+
+ providerSet := make(map[string]struct{})
+ for _, deps := range []map[string]string{
+ pkg.Dependencies,
+ pkg.DevDependencies,
+ pkg.OptionalDependencies,
+ pkg.PeerDependencies,
+ } {
+ for dep := range deps {
+ if provider, ok := nodeAgentProviderPackages[dep]; ok {
+ providerSet[provider] = struct{}{}
+ }
+ }
+ }
+
+ providers := make([]string, 0, len(providerSet))
+ for provider := range providerSet {
+ providers = append(providers, provider)
+ }
+ sort.Strings(providers)
+ return providers
+}
+
+func packageJSONPathForProcess(procRoot string, pid int) string {
+ cwd := readCwd(procRoot, pid)
+ if cwd == "" {
+ return ""
+ }
+ cwd = strings.TrimPrefix(filepath.Clean(cwd), string(filepath.Separator))
+ if cwd == "." {
+ cwd = ""
+ }
+ return filepath.Join(procRoot, strconv.Itoa(pid), "root", cwd, "package.json")
+}
diff --git a/openlit-controller/internal/engine/runtime_discovery_test.go b/openlit-controller/internal/engine/runtime_discovery_test.go
new file mode 100644
index 00000000..15d2ee80
--- /dev/null
+++ b/openlit-controller/internal/engine/runtime_discovery_test.go
@@ -0,0 +1,77 @@
+package engine
+
+import (
+ "os"
+ "path/filepath"
+ "strconv"
+ "testing"
+
+ "github.com/openlit/openlit/openlit-controller/internal/config"
+)
+
+func writeFakeNodeProc(t *testing.T, procRoot string, pid int, packageJSON string) {
+ t.Helper()
+ pidDir := filepath.Join(procRoot, strconv.Itoa(pid))
+ if err := os.MkdirAll(filepath.Join(pidDir, "root", "app"), 0755); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.Symlink("/app", filepath.Join(pidDir, "cwd")); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.WriteFile(filepath.Join(pidDir, "root", "app", "package.json"), []byte(packageJSON), 0644); err != nil {
+ t.Fatal(err)
+ }
+}
+
+func TestDetectNodeAgentProvidersRequiresAgentFrameworkPackage(t *testing.T) {
+ procRoot := t.TempDir()
+ writeFakeNodeProc(t, procRoot, 1234, `{
+ "dependencies": {
+ "openai": "^6.0.0",
+ "@ai-sdk/openai": "^2.0.0"
+ }
+ }`)
+
+ if got := detectNodeAgentProviders(procRoot, 1234); len(got) != 0 {
+ t.Fatalf("generic provider SDKs should not trigger passive discovery, got %v", got)
+ }
+}
+
+func TestDetectNodeAgentProvidersFindsOpenAIAgents(t *testing.T) {
+ procRoot := t.TempDir()
+ writeFakeNodeProc(t, procRoot, 1234, `{
+ "dependencies": {
+ "@openai/agents": "0.12.0",
+ "openai": "^6.42.0"
+ }
+ }`)
+
+ got := detectNodeAgentProviders(procRoot, 1234)
+ if len(got) != 1 || got[0] != "openai" {
+ t.Fatalf("expected openai provider, got %v", got)
+ }
+}
+
+func TestUpsertRuntimeDiscoveredService(t *testing.T) {
+ eng := newTestEngine()
+ eng.deployMode = config.DeployLinux
+ meta := &ProcessMetadata{
+ PID: 1234,
+ ExePath: "/usr/local/bin/node",
+ Cmdline: "node app.mjs",
+ ServiceName: "agent-js",
+ Runtime: "nodejs",
+ }
+
+ eng.upsertRuntimeDiscoveredService(meta, []string{"openai"})
+ services := eng.GetServices()
+ if len(services) != 1 {
+ t.Fatalf("expected 1 service, got %d", len(services))
+ }
+ if services[0].LanguageRuntime != "nodejs" {
+ t.Fatalf("expected nodejs runtime, got %q", services[0].LanguageRuntime)
+ }
+ if len(services[0].LLMProviders) != 1 || services[0].LLMProviders[0] != "openai" {
+ t.Fatalf("expected openai provider, got %v", services[0].LLMProviders)
+ }
+}
diff --git a/openlit-controller/internal/engine/sdk_bundle.go b/openlit-controller/internal/engine/sdk_bundle.go
index bb6cf46a..cd9d7cf4 100644
--- a/openlit-controller/internal/engine/sdk_bundle.go
+++ b/openlit-controller/internal/engine/sdk_bundle.go
@@ -11,6 +11,8 @@ import (
const (
pythonSDKPackagesDirName = "packages"
pythonSDKBootstrapDirName = "bootstrap"
+ nodeSDKDirName = "node-sdk"
+ nodeSDKRegisterRelPath = "node_modules/openlit/dist/register.js"
)
// sdkVersionPattern allows only PEP 440-ish version strings: letters, digits,
@@ -43,6 +45,24 @@ func pypiPackageSpec(version string) string {
return "openlit==" + version
}
+func npmPackageSpec(version string) string {
+ if version == "" || !isValidSDKVersion(version) {
+ return "openlit"
+ }
+ return "openlit@" + version
+}
+
+func buildNPMInstallShellCmd(targetRoot, version string) string {
+ pkg := npmPackageSpec(version)
+ nodeRoot := targetRoot + "/" + nodeSDKDirName
+ return fmt.Sprintf(
+ `set -e; mkdir -p %s && npm install --omit=dev --no-audit --no-fund --prefix %s %s && `+
+ `node -e "const p=require('%s/node_modules/openlit/package.json'); require('fs').writeFileSync('%s/.openlit-version', p.version || 'unknown')"`,
+ nodeRoot, nodeRoot, pkg,
+ nodeRoot, targetRoot,
+ )
+}
+
func buildPyPIInstallShellCmd(targetRoot, version string) string {
pkg := pypiPackageSpec(version)
packagesDir := targetRoot + "/" + pythonSDKPackagesDirName
@@ -93,3 +113,17 @@ func installPythonSDKFromPyPI(pythonBinaryPath, targetRoot, version string) erro
return nil
}
+
+func installNodeSDKFromNPM(targetRoot, version string) error {
+ if err := os.MkdirAll(targetRoot, 0755); err != nil {
+ return fmt.Errorf("create node sdk target dir: %w", err)
+ }
+ pkg := npmPackageSpec(version)
+ cmd := exec.Command("npm", "install", "--omit=dev", "--no-audit", "--no-fund", "--prefix", targetRoot, pkg)
+ cmd.Env = os.Environ()
+ output, err := cmd.CombinedOutput()
+ if err != nil {
+ return fmt.Errorf("npm install openlit: %w: %s", err, string(output))
+ }
+ return nil
+}
diff --git a/openlit-controller/internal/engine/systemd.go b/openlit-controller/internal/engine/systemd.go
index c9646463..779e4d79 100644
--- a/openlit-controller/internal/engine/systemd.go
+++ b/openlit-controller/internal/engine/systemd.go
@@ -12,8 +12,9 @@ import (
var systemdDropInBaseDir = "/etc/systemd/system"
const (
- systemdSDKStateDir = "/var/lib/openlit/python-sdk"
- systemdDropInName = "openlit-python-sdk.conf"
+ systemdSDKStateDir = "/var/lib/openlit/python-sdk"
+ systemdDropInName = "openlit-sdk.conf"
+ legacySystemdDropInName = "openlit-python-sdk.conf"
)
func linuxSystemdSDKSupported() bool {
@@ -33,6 +34,10 @@ func systemdDropInPath(unit string) string {
return filepath.Join(systemdDropInBaseDir, unit+".d", systemdDropInName)
}
+func legacySystemdDropInPath(unit string) string {
+ return filepath.Join(systemdDropInBaseDir, unit+".d", legacySystemdDropInName)
+}
+
func writeSystemdDropIn(unit string, content string) error {
dropInPath := systemdDropInPath(unit)
if err := os.MkdirAll(filepath.Dir(dropInPath), 0755); err != nil {
@@ -45,9 +50,10 @@ func writeSystemdDropIn(unit string, content string) error {
}
func removeSystemdDropIn(unit string) error {
- dropInPath := systemdDropInPath(unit)
- if err := os.Remove(dropInPath); err != nil && !os.IsNotExist(err) {
- return fmt.Errorf("remove systemd drop-in: %w", err)
+ for _, dropInPath := range []string{systemdDropInPath(unit), legacySystemdDropInPath(unit)} {
+ if err := os.Remove(dropInPath); err != nil && !os.IsNotExist(err) {
+ return fmt.Errorf("remove systemd drop-in: %w", err)
+ }
}
return nil
}
@@ -140,13 +146,15 @@ func escapeSystemdValue(value string) string {
}
func readSystemdDropInConfigHash(unit string) string {
- data, err := os.ReadFile(systemdDropInPath(unit))
- if err != nil {
- return ""
- }
- for _, line := range strings.Split(string(data), "\n") {
- if strings.HasPrefix(line, "# openlit-managed-config-hash=") {
- return strings.TrimSpace(strings.TrimPrefix(line, "# openlit-managed-config-hash="))
+ for _, dropInPath := range []string{systemdDropInPath(unit), legacySystemdDropInPath(unit)} {
+ data, err := os.ReadFile(dropInPath)
+ if err != nil {
+ continue
+ }
+ for _, line := range strings.Split(string(data), "\n") {
+ if strings.HasPrefix(line, "# openlit-managed-config-hash=") {
+ return strings.TrimSpace(strings.TrimPrefix(line, "# openlit-managed-config-hash="))
+ }
}
}
return ""
diff --git a/openlit-controller/internal/openlit/types.go b/openlit-controller/internal/openlit/types.go
index 670af278..b63b633b 100644
--- a/openlit-controller/internal/openlit/types.go
+++ b/openlit-controller/internal/openlit/types.go
@@ -13,6 +13,8 @@ const (
const (
ActionInstrument = "instrument"
ActionUninstrument = "uninstrument"
+ ActionEnableSDK = "enable_sdk"
+ ActionDisableSDK = "disable_sdk"
ActionEnablePythonSDK = "enable_python_sdk"
ActionDisablePythonSDK = "disable_python_sdk"
ActionStartWorkload = "start_workload"
@@ -50,7 +52,7 @@ type PendingAction struct {
Payload string `json:"payload,omitempty"`
}
-type PythonSDKActionPayload struct {
+type SDKActionPayload struct {
TargetRuntime string `json:"target_runtime"`
InstrumentationProfile string `json:"instrumentation_profile"`
DuplicatePolicy string `json:"duplicate_policy"`
@@ -65,6 +67,10 @@ type PythonSDKActionPayload struct {
Environment string `json:"environment,omitempty"`
}
+// PythonSDKActionPayload is kept as a compatibility alias for existing queued
+// actions and tests. The payload is now runtime-aware via TargetRuntime.
+type PythonSDKActionPayload = SDKActionPayload
+
type ActionResult struct {
ActionID string `json:"action_id"`
Status string `json:"status"`
diff --git a/openlit-controller/internal/server/server_test.go b/openlit-controller/internal/server/server_test.go
index 8e517cd7..0e7840fa 100644
--- a/openlit-controller/internal/server/server_test.go
+++ b/openlit-controller/internal/server/server_test.go
@@ -13,7 +13,7 @@ import (
func newTestServer() *Server {
logger, _ := zap.NewDevelopment()
- eng := engine.New(logger, "/nonexistent/obi", "http://localhost:4318", "/proc", "test", "", config.DeployLinux)
+ eng := engine.New(logger, "/nonexistent/obi", "http://localhost:4318", "/proc", "test", "", "", config.DeployLinux)
return New(":0", eng, logger)
}
diff --git a/openlit-controller/patches/README.md b/openlit-controller/patches/README.md
index 5d5863d3..1890fa17 100644
--- a/openlit-controller/patches/README.md
+++ b/openlit-controller/patches/README.md
@@ -1,32 +1,32 @@
# OBI Patches
This directory contains patch files applied on top of upstream OBI (OpenTelemetry
-eBPF Instrumentation) **v0.9.0** during the Docker build (see the obi-builder stage
+eBPF Instrumentation) **v0.10.0** during the Docker build (see the obi-builder stage
in `../Dockerfile`).
## What we add
-OBI v0.9.0 natively supports OpenAI, Anthropic, Gemini, Qwen, Bedrock, MCP,
-Embedding, and Rerank. On top of that we add two GenAI extractors:
+OBI v0.10.0 natively supports OpenAI, Anthropic, Gemini, Qwen, Bedrock, MCP,
+Embedding, Rerank, and Retrieval. On top of that we add two GenAI extractors:
- **`custom`** — a generic OpenAI-compatible gateway extractor (LiteLLM, vLLM,
LocalAI, OpenRouter, Ollama's `/v1/` endpoint, ...). It reuses upstream
`OpenAISpan` and is safe to enable broadly because `OpenAISpan` returns
- `ok=false` on non-OpenAI-shaped bodies. Spans report no provider name (the
- backend vendor behind the gateway is unknown); discovery (IP+port) is the
- authoritative attribution.
+ `ok=false` on non-OpenAI-shaped bodies. Trace attributes report provider
+ `custom` because the backend vendor behind the gateway is unknown; discovery
+ (IP+port) remains the authoritative attribution.
- **`ollama`** — a parser for Ollama's NATIVE API (`/api/chat`, `/api/generate`),
whose JSON schema differs from OpenAI (`prompt_eval_count`/`eval_count`,
`message.content`/`response`). Path-gated so it never matches the `/v1/` path.
## Files
-- `providers/ollama/ollama.go` (in the repo root, NOT a patch) — the standalone
- `OllamaSpan` parser. The Dockerfile copies `providers/*/*.go` into
+- `_obi-providers/ollama/ollama.go` (in the repo root, NOT a patch) — the standalone
+ `OllamaSpan` parser. The Dockerfile copies `_obi-providers/*/*.go` into
`pkg/ebpf/common/http/` before applying patches.
- `config.patch` — adds `CustomConfig` + `OllamaConfig` to `GenAIConfig` and ORs
them into `GenAIConfig.Enabled()`.
-- `span.patch` — adds `HTTPSubtypeCustom` (15) + `HTTPSubtypeOllama` (16), extends
+- `span.patch` — adds `HTTPSubtypeCustom` (16) + `HTTPSubtypeOllama` (17), extends
`IsGenAISubtype`, adds the `Custom *VendorOpenAI` and `Ollama *VendorOllama`
fields + the `VendorOllama` struct, and extends the GenAI getters.
- `http_transform.patch` — adds the routing branches (`OllamaSpan` for the native
@@ -38,11 +38,13 @@ Embedding, and Rerank. On top of that we add two GenAI extractors:
```bash
git clone --depth 1 --branch <version> <OBI_REPO> /tmp/obi-rebase
cd /tmp/obi-rebase
-cp <repo>/openlit-controller/providers/ollama/ollama.go pkg/ebpf/common/http/
+cp <repo>/openlit-controller/_obi-providers/ollama/ollama.go pkg/ebpf/common/http/
+cp <repo>/openlit-controller/_obi-providers/custom/custom.go pkg/ebpf/common/http/
# edit the four files, then:
git diff -- pkg/config/payload_extraction.go > <repo>/openlit-controller/patches/config.patch
git diff -- pkg/appolly/app/request/span.go > <repo>/openlit-controller/patches/span.patch
git diff -- pkg/ebpf/common/http_transform.go pkg/export/otel/tracesgen/tracesgen.go > <repo>/openlit-controller/patches/http_transform.patch
```
-Verify on a clean checkout: copy `ollama.go` in, then `git apply --check patches/*.patch`.
+Verify on a clean checkout: copy `ollama.go` and `custom.go` in, then
+`git apply --check patches/*.patch`.
diff --git a/openlit-controller/patches/config.patch b/openlit-controller/patches/config.patch
index 3ff91ac1..b50086a6 100644
--- a/openlit-controller/patches/config.patch
+++ b/openlit-controller/patches/config.patch
@@ -1,11 +1,11 @@
diff --git a/pkg/config/payload_extraction.go b/pkg/config/payload_extraction.go
-index 1b67d5c..339fa8a 100644
+index 16e5a77..f4c7ce8 100644
--- a/pkg/config/payload_extraction.go
+++ b/pkg/config/payload_extraction.go
-@@ -85,13 +85,20 @@ type GenAIConfig struct {
- Embedding EmbeddingProviderConfig `yaml:"embedding"`
- // Rerank payload extraction and parsing (Cohere, Jina AI, Voyage AI, etc.)
+@@ -87,13 +87,20 @@ type GenAIConfig struct {
Rerank RerankConfig `yaml:"rerank"`
+ // Vector retrieval payload extraction and parsing (Pinecone, Qdrant, Milvus, Chroma, Weaviate, etc.)
+ Retrieval RetrievalConfig `yaml:"retrieval"`
+ // Custom OpenAI-compatible gateway (LiteLLM, vLLM, LocalAI, OpenRouter, ...)
+ // payload extraction and parsing. Reuses the OpenAI parser; safe to enable
+ // broadly because OpenAISpan returns ok=false on non-OpenAI-shaped bodies.
@@ -18,14 +18,14 @@ index 1b67d5c..339fa8a 100644
return g.Anthropic.Enabled || g.OpenAI.Enabled ||
g.Gemini.Enabled || g.Qwen.Enabled || g.Bedrock.Enabled ||
g.MCP.Enabled ||
-- g.Embedding.Enabled || g.Rerank.Enabled
-+ g.Embedding.Enabled || g.Rerank.Enabled ||
+- g.Embedding.Enabled || g.Rerank.Enabled || g.Retrieval.Enabled
++ g.Embedding.Enabled || g.Rerank.Enabled || g.Retrieval.Enabled ||
+ g.Custom.Enabled || g.Ollama.Enabled
}
type OpenAIConfig struct {
-@@ -129,6 +136,21 @@ type EmbeddingProviderConfig struct {
- Enabled bool `yaml:"enabled" env:"OTEL_EBPF_HTTP_GENAI_EMBEDDING_ENABLED" validate:"boolean"`
+@@ -141,6 +148,21 @@ type RetrievalConfig struct {
+ Enabled bool `yaml:"enabled" env:"OTEL_EBPF_HTTP_RETRIEVAL_ENABLED" validate:"boolean"`
}
+type CustomConfig struct {
@@ -43,6 +43,6 @@ index 1b67d5c..339fa8a 100644
+ Enabled bool `yaml:"enabled" env:"OTEL_EBPF_HTTP_OLLAMA_ENABLED" validate:"boolean"`
+}
+
- type RerankConfig struct {
- // Enable Rerank (Cohere, Jina AI, Voyage AI, etc.) payload extraction and parsing
- Enabled bool `yaml:"enabled" env:"OTEL_EBPF_HTTP_RERANK_ENABLED" validate:"boolean"`
+ type JSONRPCConfig struct {
+ // Enable JSON-RPC payload extraction and parsing
+ Enabled bool `yaml:"enabled" env:"OTEL_EBPF_HTTP_JSONRPC_ENABLED" validate:"boolean"`
diff --git a/openlit-controller/patches/http_transform.patch b/openlit-controller/patches/http_transform.patch
index 513c266b..a168dcab 100644
--- a/openlit-controller/patches/http_transform.patch
+++ b/openlit-controller/patches/http_transform.patch
@@ -1,8 +1,8 @@
diff --git a/pkg/ebpf/common/http_transform.go b/pkg/ebpf/common/http_transform.go
-index 7fe38be..3ee401e 100644
+index a3e1265..e590595 100644
--- a/pkg/ebpf/common/http_transform.go
+++ b/pkg/ebpf/common/http_transform.go
-@@ -222,6 +222,28 @@ func httpRequestResponseToSpan(parseCtx *EBPFParseContext, event *BPFHTTPInfo, r
+@@ -232,6 +232,28 @@ func httpRequestResponseToSpan(parseCtx *EBPFParseContext, event *BPFHTTPInfo, r
}
}
@@ -32,16 +32,16 @@ index 7fe38be..3ee401e 100644
// detection, since MCP is a protocol layer on top of JSON-RPC.
if parseCtx != nil && (parseCtx.payloadExtraction.HTTP.GenAI.MCP.Enabled || parseCtx.payloadExtraction.HTTP.JSONRPC.Enabled) {
diff --git a/pkg/export/otel/tracesgen/tracesgen.go b/pkg/export/otel/tracesgen/tracesgen.go
-index e5ceb57..fbb4ee7 100644
+index ae18472..faff0b1 100644
--- a/pkg/export/otel/tracesgen/tracesgen.go
+++ b/pkg/export/otel/tracesgen/tracesgen.go
-@@ -593,6 +593,75 @@ func TraceAttributesSelector(span *request.Span, optionalAttrs map[attr.Name]str
+@@ -1132,6 +1132,74 @@ func traceAttributesSelectorInternal(span *request.Span, optionalAttrs map[attr.
}
}
+ // Custom OpenAI-compatible gateway (LiteLLM, vLLM, LocalAI, ...). Reuses
-+ // the OpenAI-shaped VendorOpenAI payload but emits no provider name, since
-+ // the backend vendor behind the gateway is unknown.
++ // the OpenAI-shaped VendorOpenAI payload and emits the generic "custom"
++ // provider name because the backend vendor behind the gateway is unknown.
+ if span.SubType == request.HTTPSubtypeCustom && span.GenAI != nil && span.GenAI.Custom != nil {
+ ai := span.GenAI.Custom
+ // gen_ai.provider.name is intentionally a generic marker: the actual
@@ -66,7 +66,7 @@ index e5ceb57..fbb4ee7 100644
+ attrs = append(attrs, semconv.GenAIUsageInputTokens(ai.Usage.GetInputTokens()))
+ attrs = append(attrs, semconv.GenAIUsageOutputTokens(ai.Usage.GetOutputTokens()))
+ // Messages are emitted in the GenAI semantic-conventions structure
-+ // (role + parts[]), normalized by the custom parser — NOT the raw
++ // (role + parts[]), normalized by the custom parser - NOT the raw
+ // OpenAI shape returned by the VendorOpenAI getters.
+ if _, ok := optionalAttrs[attr.GenAIInput]; ok && span.GenAI.CustomInputMessages != "" {
+ attrs = append(attrs, semconv.GenAIInputMessagesKey.String(span.GenAI.CustomInputMessages))
@@ -84,7 +84,6 @@ index e5ceb57..fbb4ee7 100644
+ }
+ if ai.Error.Type != "" {
+ attrs = append(attrs, semconv.ErrorTypeKey.String(ai.Error.Type))
-+ attrs = append(attrs, semconv.ErrorMessage(ai.Error.Message))
+ }
+ if ai.OperationName == request.EmbeddingOperationName && ai.Request.Dimensions > 0 {
+ attrs = append(attrs, attribute.Int("gen_ai.request.embedding.dimensions", ai.Request.Dimensions))
@@ -108,6 +107,6 @@ index e5ceb57..fbb4ee7 100644
+ }
+ }
+
- if span.SubType == request.HTTPSubtypeAnthropic && span.GenAI != nil && span.GenAI.Anthropic != nil {
- ai := span.GenAI.Anthropic
- attrs = append(attrs, semconv.GenAIProviderNameAnthropic)
+ attrs = append(attrs, jsonRPCAttributes(span)...)
+ attrs = append(attrs, httpEnrichmentAttributes(span)...)
+ case request.EventTypeGRPCClient:
diff --git a/openlit-controller/patches/span.patch b/openlit-controller/patches/span.patch
index 3297429c..5db8c644 100644
--- a/openlit-controller/patches/span.patch
+++ b/openlit-controller/patches/span.patch
@@ -1,31 +1,31 @@
diff --git a/pkg/appolly/app/request/span.go b/pkg/appolly/app/request/span.go
-index 54776da..77aa795 100644
+index 3f7a63a..95bb87a 100644
--- a/pkg/appolly/app/request/span.go
+++ b/pkg/appolly/app/request/span.go
-@@ -105,6 +105,8 @@ const (
- HTTPSubtypeMCP = 12 // http + Model Context Protocol
+@@ -110,6 +110,8 @@ const (
HTTPSubtypeEmbedding = 13 // http + generic embedding provider (Voyage, Cohere, Jina)
HTTPSubtypeRerank = 14 // http + Rerank (Cohere, Jina, Voyage, etc.)
-+ HTTPSubtypeCustom = 15 // http + custom OpenAI-compatible gateway (LiteLLM, vLLM, ...)
-+ HTTPSubtypeOllama = 16 // http + Ollama native API
+ HTTPSubtypeRetrieval = 15 // http + vector retrieval (Pinecone, Qdrant, Milvus, Chroma, Weaviate, etc.)
++ HTTPSubtypeCustom = 16 // http + custom OpenAI-compatible gateway (LiteLLM, vLLM, ...)
++ HTTPSubtypeOllama = 17 // http + Ollama native API
)
func IsGenAISubtype(subtype int) bool {
-@@ -115,7 +117,9 @@ func IsGenAISubtype(subtype int) bool {
- subtype == HTTPSubtypeAWSBedrock ||
+@@ -121,7 +123,9 @@ func IsGenAISubtype(subtype int) bool {
subtype == HTTPSubtypeMCP ||
subtype == HTTPSubtypeEmbedding ||
-- subtype == HTTPSubtypeRerank
-+ subtype == HTTPSubtypeRerank ||
+ subtype == HTTPSubtypeRerank ||
+- subtype == HTTPSubtypeRetrieval
++ subtype == HTTPSubtypeRetrieval ||
+ subtype == HTTPSubtypeCustom ||
+ subtype == HTTPSubtypeOllama
}
//nolint:cyclop
-@@ -282,6 +286,33 @@ type GenAI struct {
- MCP *MCPCall
+@@ -293,6 +297,33 @@ type GenAI struct {
Embedding *VendorEmbedding
Rerank *VendorRerank
+ Retrieval *VendorRetrieval
+ // Custom OpenAI-compatible gateway (LiteLLM, vLLM, LocalAI, ...). Reuses
+ // VendorOpenAI for tokens/model/params because the wire format is
+ // OpenAI-compatible. The message bodies, however, are normalized by the
@@ -55,8 +55,8 @@ index 54776da..77aa795 100644
+ Output string
}
- type OpenAIUsage struct {
-@@ -1490,6 +1521,23 @@ func (s *Span) TraceName() string {
+ type OpenAIPromptTokensDetails struct {
+@@ -1804,6 +1835,23 @@ func (s *Span) TraceName() string {
}
}
@@ -80,8 +80,22 @@ index 54776da..77aa795 100644
if s.Type == EventTypeHTTPClient && s.SubType == HTTPSubtypeAnthropic && s.GenAI != nil && s.GenAI.Anthropic != nil {
name := s.GenAI.Anthropic.Output.Type
if name != "" {
-@@ -1819,6 +1867,14 @@ func (s *Span) GenAIInputTokens() int {
- return s.GenAI.Rerank.Output.GetTotalTokens()
+@@ -1889,6 +1937,13 @@ func (s *Span) TraceName() string {
+ return RetrievalOperationName
+ }
+
++ if s.Type == EventTypeHTTPClient && s.SubType == HTTPSubtypeOllama && s.GenAI != nil && s.GenAI.Ollama != nil {
++ if s.GenAI.Ollama.Model != "" {
++ return s.GenAI.Ollama.Operation + " " + s.GenAI.Ollama.Model
++ }
++ return s.GenAI.Ollama.Operation
++ }
++
+ if s.SubType == HTTPSubtypeJSONRPC && s.JSONRPC != nil {
+ if s.JSONRPC.Method != "" {
+ return s.JSONRPC.Method
+@@ -2155,6 +2210,14 @@ func (s *Span) GenAIInputTokens() int {
+ return s.GenAI.Retrieval.GetInputTokens()
}
+ if s.GenAI.Custom != nil {
@@ -95,7 +109,7 @@ index 54776da..77aa795 100644
return 0
}
-@@ -1851,6 +1907,14 @@ func (s *Span) GenAIOutputTokens() int {
+@@ -2187,6 +2250,14 @@ func (s *Span) GenAIOutputTokens() int {
return s.GenAI.Embedding.GetOutputTokens()
}
@@ -110,9 +124,9 @@ index 54776da..77aa795 100644
return 0
}
-@@ -1879,6 +1943,12 @@ func (s *Span) GenAIOperationName() string {
- if s.GenAI.Rerank != nil {
- return "rerank"
+@@ -2218,6 +2289,12 @@ func (s *Span) GenAIOperationName() string {
+ if s.GenAI.Retrieval != nil {
+ return s.GenAI.Retrieval.OperationName()
}
+ if s.GenAI.Custom != nil {
+ return s.GenAI.Custom.OperationName
@@ -123,9 +137,9 @@ index 54776da..77aa795 100644
return ""
}
-@@ -1907,6 +1977,12 @@ func (s *Span) GenAIProviderName() string {
- if s.GenAI.Rerank != nil {
- return s.GenAI.Rerank.Provider
+@@ -2249,6 +2326,12 @@ func (s *Span) GenAIProviderName() string {
+ if s.GenAI.Retrieval != nil {
+ return s.GenAI.Retrieval.Provider
}
+ if s.GenAI.Ollama != nil {
+ return "ollama"
@@ -136,9 +150,9 @@ index 54776da..77aa795 100644
return ""
}
-@@ -1938,6 +2014,12 @@ func (s *Span) GenAIRequestModel() string {
- if s.GenAI.Rerank != nil {
- return s.GenAI.Rerank.Input.Model
+@@ -2283,6 +2366,12 @@ func (s *Span) GenAIRequestModel() string {
+ if s.GenAI.Retrieval != nil {
+ return s.GenAI.Retrieval.Input.Model
}
+ if s.GenAI.Custom != nil {
+ return s.GenAI.Custom.Request.Model
@@ -149,9 +163,9 @@ index 54776da..77aa795 100644
return ""
}
-@@ -1978,5 +2060,14 @@ func (s *Span) GenAIResponseModel() string {
+@@ -2329,5 +2418,14 @@ func (s *Span) GenAIResponseModel() string {
}
- return s.GenAI.Rerank.Input.Model
+ return s.GenAI.Retrieval.Input.Model
}
+ if s.GenAI.Custom != nil {
+ if s.GenAI.Custom.ResponseModel != "" {
diff --git a/sdk/typescript/.gitignore b/sdk/typescript/.gitignore
index 43df0e48..a42e3637 100644
--- a/sdk/typescript/.gitignore
+++ b/sdk/typescript/.gitignore
@@ -1,3 +1,4 @@
node_modules
-dist*.tsbuildinfo
+dist
+*.tsbuildinfo
tsconfig.tsbuildinfo
diff --git a/sdk/typescript/package-lock.json b/sdk/typescript/package-lock.json
index 100e3206..493caf9a 100644
--- a/sdk/typescript/package-lock.json
+++ b/sdk/typescript/package-lock.json
@@ -40,6 +40,9 @@
"typescript": "^5.8.3",
"typescript-eslint": "^7.8.0"
},
+ "engines": {
+ "node": ">=18.0.0"
+ },
"peerDependencies": {
"@opentelemetry/instrumentation-express": ">=0.40.0",
"@opentelemetry/instrumentation-fastify": ">=0.38.0",
diff --git a/sdk/typescript/package.json b/sdk/typescript/package.json
index 9fc4d802..ee3ad58d 100644
--- a/sdk/typescript/package.json
+++ b/sdk/typescript/package.json
@@ -24,6 +24,19 @@
"description": "OpenTelemetry-native Auto instrumentation library for monitoring LLM Applications, facilitating the integration of observability into your GenAI-driven projects",
"main": "dist/index.js",
"types": "dist/index.d.ts",
+ "exports": {
+ ".": {
+ "types": "./dist/index.d.ts",
+ "default": "./dist/index.js"
+ },
+ "./register": {
+ "types": "./dist/register.d.ts",
+ "default": "./dist/register.js"
+ }
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ },
"keywords": [
"OpenTelemetry",
"otel",
diff --git a/sdk/typescript/src/__tests__/register.test.ts b/sdk/typescript/src/__tests__/register.test.ts
new file mode 100644
index 00000000..0866bd5f
--- /dev/null
+++ b/sdk/typescript/src/__tests__/register.test.ts
@@ -0,0 +1,65 @@
+describe('openlit/register', () => {
+ const originalEnv = process.env;
+ const originalVersion = process.versions.node;
+ let initMock: jest.Mock;
+
+ beforeEach(() => {
+ jest.resetModules();
+ initMock = jest.fn();
+ jest.doMock('../index', () => ({
+ __esModule: true,
+ default: { init: initMock },
+ }));
+ process.env = {
+ ...originalEnv,
+ OTEL_SERVICE_NAME: 'node-ai-app',
+ OTEL_DEPLOYMENT_ENVIRONMENT: 'prod',
+ OTEL_RESOURCE_ATTRIBUTES: 'service.workload.key=k8s:demo,team=ai',
+ OPENLIT_DISABLED_INSTRUMENTORS: 'openai,anthropic',
+ };
+ delete (globalThis as any).__openlit_register_initialized__;
+ });
+
+ afterEach(() => {
+ process.env = originalEnv;
+ Object.defineProperty(process.versions, 'node', {
+ value: originalVersion,
+ configurable: true,
+ });
+ delete (globalThis as any).__openlit_register_initialized__;
+ jest.dontMock('../index');
+ });
+
+ it('initializes once with controller environment values', async () => {
+ await import('../register');
+ await import('../register');
+
+ expect(initMock).toHaveBeenCalledTimes(1);
+ expect(initMock).toHaveBeenCalledWith({
+ applicationName: 'node-ai-app',
+ environment: 'prod',
+ disabledInstrumentors: ['openai', 'anthropic'],
+ customSpanAttributes: {
+ 'service.workload.key': 'k8s:demo',
+ team: 'ai',
+ },
+ });
+ });
+
+ it('skips unsupported Node.js versions', async () => {
+ Object.defineProperty(process.versions, 'node', {
+ value: '16.20.2',
+ configurable: true,
+ });
+ const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
+
+ await import('../register');
+
+ expect(initMock).not.toHaveBeenCalled();
+ expect(errorSpy).toHaveBeenCalledWith(
+ expect.stringContaining('requires Node.js 18 or newer')
+ );
+ errorSpy.mockRestore();
+ });
+});
+
diff --git a/sdk/typescript/src/register.ts b/sdk/typescript/src/register.ts
new file mode 100644
index 00000000..02348a71
--- /dev/null
+++ b/sdk/typescript/src/register.ts
@@ -0,0 +1,60 @@
+import Openlit from './index';
+import type { OpenlitOptions } from './types';
+
+const GLOBAL_SENTINEL = '__openlit_register_initialized__';
+const MIN_NODE_MAJOR = 18;
+
+declare global {
+ // eslint-disable-next-line no-var
+ var __openlit_register_initialized__: boolean | undefined;
+}
+
+function parseCSV(value?: string): string[] | undefined {
+ if (!value) return undefined;
+ const items = value
+ .split(',')
+ .map((item) => item.trim())
+ .filter(Boolean);
+ return items.length > 0 ? items : undefined;
+}
+
+function parseResourceAttributes(value?: string): Record<string, string> | null {
+ if (!value) return null;
+ const attrs: Record<string, string> = {};
+ for (const item of value.split(',')) {
+ const [rawKey, ...rawValue] = item.split('=');
+ const key = rawKey?.trim();
+ const attrValue = rawValue.join('=').trim();
+ if (key && attrValue) attrs[key] = attrValue;
+ }
+ return Object.keys(attrs).length > 0 ? attrs : null;
+}
+
+function nodeVersionSupported(): boolean {
+ const major = Number(process.versions.node.split('.')[0]);
+ return Number.isFinite(major) && major >= MIN_NODE_MAJOR;
+}
+
+function initFromEnv() {
+ if ((globalThis as any)[GLOBAL_SENTINEL]) return;
+ (globalThis as any)[GLOBAL_SENTINEL] = true;
+
+ if (!nodeVersionSupported()) {
+ console.error(
+ `OpenLIT auto-instrumentation requires Node.js ${MIN_NODE_MAJOR} or newer; current runtime is ${process.version}.`
+ );
+ return;
+ }
+
+ const options: OpenlitOptions = {
+ applicationName: process.env.OTEL_SERVICE_NAME,
+ environment: process.env.OTEL_DEPLOYMENT_ENVIRONMENT,
+ disabledInstrumentors: parseCSV(process.env.OPENLIT_DISABLED_INSTRUMENTORS),
+ customSpanAttributes: parseResourceAttributes(process.env.OTEL_RESOURCE_ATTRIBUTES),
+ };
+
+ Openlit.init(options);
+}
+
+initFromEnv();
+
diff --git a/src/README.md b/src/README.md
index 9a88cd73..83b511f2 100644
--- a/src/README.md
+++ b/src/README.md
@@ -5,7 +5,7 @@ This guide covers the steps needed to set up the development environment for Ope
| Mode | What starts | Use case |
|------|-------------|----------|
| **Default** | ClickHouse + OpenLIT UI | Working on the OpenLIT dashboard/UI |
-| **Full** (`--profile full`) | + Controller + sample apps (OpenAI, Anthropic, Gemini, CrewAI) | Testing the full end-to-end setup |
+| **Full** (`--profile full`) | + Controller + sample apps (OpenAI, Anthropic, Gemini, CrewAI, OpenAI Agents JS) | Testing the full end-to-end setup |
## Running the Development Environment
@@ -36,6 +36,7 @@ This guide covers the steps needed to set up the development environment for Ope
| **anthropic-app** | Sample Anthropic chat app (from `examples/`) |
| **gemini-app** | Sample Gemini chat app (from `examples/`) |
| **crewai-app** | Sample CrewAI agent app (from `examples/`) |
+| **openai-agents-js-app** | Sample JavaScript/TypeScript OpenAI Agents SDK app with an in-process mock LLM (from `examples/`) |
## Stopping the environment
diff --git a/src/client/src/__tests__/lib/platform/controller/agent-feature.test.ts b/src/client/src/__tests__/lib/platform/controller/agent-feature.test.ts
new file mode 100644
index 00000000..41c68f13
--- /dev/null
+++ b/src/client/src/__tests__/lib/platform/controller/agent-feature.test.ts
@@ -0,0 +1,83 @@
+jest.mock("@/lib/platform/controller", () => ({
+ getServiceById: jest.fn(),
+ getControllerInstanceById: jest.fn(),
+ getControllerIdsForWorkload: jest.fn(),
+ getControllerConfig: jest.fn(),
+ getFeatureDesiredStates: jest.fn(),
+ queueAction: jest.fn(),
+ updateFeatureDesiredState: jest.fn(),
+}));
+
+import agentHandler from "@/lib/platform/controller/features/agent";
+import { KNOWN_ACTIONS } from "@/types/controller";
+
+describe("agent controller feature", () => {
+ it("queues nodejs runtime payloads for JavaScript/TypeScript services", () => {
+ const actions = agentHandler.reconcile(
+ [
+ {
+ workload_key: "k8s:default:deployment/js-ai-app",
+ instrumentation_status: "discovered",
+ language_runtime: "nodejs",
+ resource_attributes: {
+ "openlit.agent_observability.status": "disabled",
+ },
+ },
+ ],
+ new Map([
+ [
+ "k8s:default:deployment/js-ai-app",
+ {
+ workload_key: "k8s:default:deployment/js-ai-app",
+ cluster_id: "default",
+ feature: "agent",
+ desired_status: "enabled",
+ config: "{}",
+ updated_at: "2026-06-30 00:00:00",
+ },
+ ],
+ ])
+ );
+
+ expect(actions).toHaveLength(1);
+ expect(actions[0].actionType).toBe(KNOWN_ACTIONS.ENABLE_AGENT);
+ expect(JSON.parse(actions[0].payload)).toMatchObject({
+ target_runtime: "nodejs",
+ instrumentation_profile: "controller_managed",
+ duplicate_policy: "block_if_existing_otel_detected",
+ observability_scope: "agent",
+ });
+ });
+
+ it("keeps python runtime payloads for existing Python services", () => {
+ const actions = agentHandler.reconcile(
+ [
+ {
+ workload_key: "linux:python-ai-app",
+ instrumentation_status: "discovered",
+ language_runtime: "python",
+ resource_attributes: {
+ "openlit.agent_observability.status": "enabled",
+ },
+ },
+ ],
+ new Map([
+ [
+ "linux:python-ai-app",
+ {
+ workload_key: "linux:python-ai-app",
+ cluster_id: "default",
+ feature: "agent",
+ desired_status: "none",
+ config: "{}",
+ updated_at: "2026-06-30 00:00:00",
+ },
+ ],
+ ])
+ );
+
+ expect(actions).toHaveLength(1);
+ expect(actions[0].actionType).toBe(KNOWN_ACTIONS.DISABLE_AGENT);
+ expect(JSON.parse(actions[0].payload).target_runtime).toBe("python");
+ });
+});
diff --git a/src/client/src/__tests__/lib/platform/controller/validate-config.test.ts b/src/client/src/__tests__/lib/platform/controller/validate-config.test.ts
new file mode 100644
index 00000000..78c7885e
--- /dev/null
+++ b/src/client/src/__tests__/lib/platform/controller/validate-config.test.ts
@@ -0,0 +1,20 @@
+import { validateControllerConfig } from "@/lib/platform/controller/validate-config";
+
+describe("validateControllerConfig", () => {
+ it("preserves the retrieval payload-extraction toggle", () => {
+ const config = validateControllerConfig({
+ export: {},
+ discovery: {},
+ payload_extraction: {
+ openai: true,
+ retrieval: true,
+ ollama: false,
+ },
+ });
+
+ expect(config.payload_extraction.openai).toBe(true);
+ expect(config.payload_extraction.retrieval).toBe(true);
+ expect(config.payload_extraction.ollama).toBe(false);
+ expect(config.payload_extraction.bedrock).toBe(false);
+ });
+});
diff --git a/src/client/src/app/(playground)/agents/controller/[instance_id]/page.tsx b/src/client/src/app/(playground)/agents/controller/[instance_id]/page.tsx
index d1d9d1bb..d18e664a 100644
--- a/src/client/src/app/(playground)/agents/controller/[instance_id]/page.tsx
+++ b/src/client/src/app/(playground)/agents/controller/[instance_id]/page.tsx
@@ -43,6 +43,7 @@ const SUPPORTED_PROVIDERS: Array<keyof PayloadExtractionConfig> = [
"gemini",
"qwen",
"bedrock",
+ "retrieval",
"custom",
"ollama",
];
@@ -73,6 +74,7 @@ function providerToExtractor(
if (provider === "gemini") return "gemini";
if (provider === "qwen") return "qwen";
if (provider === "bedrock") return "bedrock";
+ if (provider === "retrieval") return "retrieval";
if (provider === "custom") return "custom";
if (provider === "ollama") return "ollama";
return null;
@@ -96,6 +98,7 @@ const PROVIDER_LABELS: Record<string, string> = {
vertex_ai: getMessage().AGENTS_PROVIDER_VERTEX_AI,
azure_inference: getMessage().AGENTS_PROVIDER_AZURE_INFERENCE,
bedrock: getMessage().AGENTS_PROVIDER_BEDROCK,
+ retrieval: getMessage().AGENTS_PROVIDER_RETRIEVAL,
ollama: getMessage().AGENTS_PROVIDER_OLLAMA,
custom: getMessage().AGENTS_PROVIDER_CUSTOM,
};
@@ -106,6 +109,7 @@ const DEFAULT_PAYLOAD_EXTRACTION: PayloadExtractionConfig = {
gemini: false,
qwen: false,
bedrock: false,
+ retrieval: false,
custom: false,
ollama: false,
};
diff --git a/src/client/src/app/(playground)/agents/service-table.tsx b/src/client/src/app/(playground)/agents/service-table.tsx
index da7f8057..aebdd791 100644
--- a/src/client/src/app/(playground)/agents/service-table.tsx
+++ b/src/client/src/app/(playground)/agents/service-table.tsx
@@ -17,6 +17,7 @@ import LinuxSvg from "@/components/svg/linux";
import KubernetesSvg from "@/components/svg/kubernetes";
import DockerSvg from "@/components/svg/docker";
import { ProviderIcon } from "@/components/svg/providers";
+import { RuntimeIcon } from "@/components/svg/runtime";
import getMessage from "@/constants/messages";
import {
getObservabilityView,
@@ -51,14 +52,33 @@ interface EnrichedAgent extends UnifiedAgent {
type ServiceColumnKey =
| "service"
| "system"
+ | "runtime"
| "providers"
| "lifecycle"
| "aiObservability"
| "agentObservability"
| "lastSeen";
-function StaticDash() {
- return <span className="text-xs text-stone-400 dark:text-stone-500">—</span>;
+function StaticDash({ title }: { title?: string }) {
+ return (
+ <span className="text-xs text-stone-400 dark:text-stone-500" title={title}>
+ —
+ </span>
+ );
+}
+
+function runtimeTitle(runtime: string) {
+ switch ((runtime || "").toLowerCase()) {
+ case "nodejs":
+ case "node":
+ case "javascript":
+ case "typescript":
+ return "JavaScript/TypeScript";
+ case "python":
+ return "Python";
+ default:
+ return "";
+ }
}
/**
@@ -427,7 +447,9 @@ const columns: Columns<ServiceColumnKey, EnrichedAgent> = {
header: () => getMessage().AGENTS_COLUMN_SYSTEM,
cell: ({ row }) => {
if (row.isSdkOnly) {
- return <span className="text-xs text-stone-400 dark:text-stone-500">—</span>;
+ return (
+ <StaticDash title="SDK telemetry only; no controller system metadata" />
+ );
}
const title =
row.mode === "kubernetes"
@@ -451,6 +473,21 @@ const columns: Columns<ServiceColumnKey, EnrichedAgent> = {
);
},
},
+ runtime: {
+ header: () => "Runtime",
+ cell: ({ row }) => {
+ const title = runtimeTitle(row.sdk_language);
+ if (!title) return <StaticDash />;
+ return (
+ <span
+ className="inline-flex h-6 w-6 items-center justify-center"
+ title={title}
+ >
+ <RuntimeIcon runtime={row.sdk_language} className="h-5 w-5" />
+ </span>
+ );
+ },
+ },
providers: {
header: () => getMessage().AGENTS_COLUMN_PROVIDERS,
cell: ({ row }) => (
@@ -507,6 +544,7 @@ const columns: Columns<ServiceColumnKey, EnrichedAgent> = {
const VISIBILITY_COLUMNS: Record<ServiceColumnKey, boolean> = {
service: true,
system: true,
+ runtime: true,
providers: true,
lastSeen: true,
aiObservability: true,
diff --git a/src/client/src/app/api/controller/poll/route.ts b/src/client/src/app/api/controller/poll/route.ts
index fb64c103..08614c53 100644
--- a/src/client/src/app/api/controller/poll/route.ts
+++ b/src/client/src/app/api/controller/poll/route.ts
@@ -184,6 +184,7 @@ async function phaseUpsertServices(
reportedServices.push({
workload_key: workloadKey,
instrumentation_status: status,
+ language_runtime: cStr(svc.language_runtime),
resource_attributes: attrs,
});
diff --git a/src/client/src/components/svg/runtime.tsx b/src/client/src/components/svg/runtime.tsx
new file mode 100644
index 00000000..f3740fc6
--- /dev/null
+++ b/src/client/src/components/svg/runtime.tsx
@@ -0,0 +1,65 @@
+type SvgProps = {
+ className?: string;
+ title?: string;
+};
+
+export function JavascriptSvg({ className, title = "JavaScript" }: SvgProps) {
+ return (
+ <svg
+ role="img"
+ aria-label={title}
+ viewBox="0 0 32 32"
+ xmlns="http://www.w3.org/2000/svg"
+ className={className}
+ >
+ <rect width="32" height="32" fill="#F7DF1E" />
+ <path
+ fill="#000"
+ d="M8.44 26.78l2.45-1.48c.47.83.9 1.53 1.94 1.53 1 0 1.63-.39 1.63-1.91V14.6h3.01v10.36c0 3.12-1.83 4.54-4.5 4.54-2.41 0-3.81-1.25-4.53-2.72zm10.66-.32l2.45-1.42c.65 1.06 1.49 1.84 2.98 1.84 1.25 0 2.05-.62 2.05-1.49 0-1.04-.82-1.4-2.2-2l-.76-.32c-2.18-.93-3.63-2.09-3.63-4.55 0-2.26 1.72-3.98 4.41-3.98 1.91 0 3.29.67 4.28 2.41l-2.34 1.5c-.52-.93-1.08-1.29-1.94-1.29-.88 0-1.44.56-1.44 1.29 0 .91.56 1.28 1.86 1.84l.76.32c2.57 1.1 4.02 2.21 4.02 4.72 0 2.71-2.13 4.19-4.98 4.19-2.79 0-4.59-1.33-5.48-3.06z"
+ />
+ </svg>
+ );
+}
+
+export function PythonSvg({ className, title = "Python" }: SvgProps) {
+ return (
+ <svg
+ role="img"
+ aria-label={title}
+ viewBox="0 0 64 64"
+ xmlns="http://www.w3.org/2000/svg"
+ className={className}
+ >
+ <path
+ fill="#3776AB"
+ d="M31.8 4.1c-14.3 0-13.4 6.2-13.4 6.2l.02 6.4h13.6v1.9H13c0 0-9.1-1-9.1 13.3 0 14.2 7.9 13.7 7.9 13.7h4.7v-6.6s-.25-7.9 7.8-7.9h13.5s7.6.12 7.6-7.4V11.5S46.5 4.1 31.8 4.1zm-7.5 4.3a2.4 2.4 0 110 4.8 2.4 2.4 0 010-4.8z"
+ />
+ <path
+ fill="#FFD43B"
+ d="M32.2 59.9c14.3 0 13.4-6.2 13.4-6.2l-.02-6.4H32v-1.9h19c0 0 9.1 1 9.1-13.3 0-14.2-7.9-13.7-7.9-13.7h-4.7v6.6s.25 7.9-7.8 7.9H26.2s-7.6-.12-7.6 7.4v12.2s-1.1 7.4 13.6 7.4zm7.5-4.3a2.4 2.4 0 110-4.8 2.4 2.4 0 010 4.8z"
+ />
+ </svg>
+ );
+}
+
+export function RuntimeIcon({
+ runtime,
+ className,
+}: {
+ runtime: string;
+ className?: string;
+}) {
+ const normalized = runtime.toLowerCase();
+ if (
+ normalized === "nodejs" ||
+ normalized === "node" ||
+ normalized === "javascript" ||
+ normalized === "typescript"
+ ) {
+ return <JavascriptSvg className={className} title="JavaScript/TypeScript" />;
+ }
+ if (normalized === "python") {
+ return <PythonSvg className={className} />;
+ }
+ return null;
+}
diff --git a/src/client/src/constants/messages/en.ts b/src/client/src/constants/messages/en.ts
index bbe4b219..f73968aa 100644
--- a/src/client/src/constants/messages/en.ts
+++ b/src/client/src/constants/messages/en.ts
@@ -822,7 +822,7 @@ export const AGENTS_CONFIG_AUTO_DISCOVER_DESCRIPTION = "Automatically scan for a
export const AGENTS_CONFIG_CUSTOM_LLM_HOSTS = "Custom LLM Hosts";
export const AGENTS_CONFIG_CUSTOM_LLM_HOSTS_HELP = "Add custom hostnames for self-hosted LLM proxies (e.g. LiteLLM, Ollama, Azure per-deployment endpoints). Comma-separated. The controller will resolve these and monitor traffic to them.";
export const AGENTS_CONFIG_CUSTOM_LLM_HOSTS_PLACEHOLDER = "litellm.internal:4000, ollama.internal:11434, my-azure.openai.azure.com";
-export const AGENTS_CONFIG_PAYLOAD_EXTRACTION = "Payload Extraction (LLM Providers)";
+export const AGENTS_CONFIG_PAYLOAD_EXTRACTION = "Payload Extraction (AI Providers)";
export const AGENTS_CONFIG_PAYLOAD_EXTRACTION_HELP = "Enable payload extraction to capture GenAI span attributes (prompts, completions, tokens) for each provider.";
export const AGENTS_CONFIG_OTLP_HEADERS = "OTLP Headers";
export const AGENTS_CONFIG_HEADER_NAME_PLACEHOLDER = "Header name";
@@ -842,6 +842,7 @@ export const AGENTS_PROVIDER_VERCEL_AI = "Vercel AI Gateway";
export const AGENTS_PROVIDER_VERTEX_AI = "Vertex AI";
export const AGENTS_PROVIDER_AZURE_INFERENCE = "Azure AI Inference";
export const AGENTS_PROVIDER_BEDROCK = "AWS Bedrock";
+export const AGENTS_PROVIDER_RETRIEVAL = "Vector Retrieval";
export const AGENTS_PROVIDER_QWEN = "Qwen";
export const AGENTS_PROVIDER_OLLAMA = "Ollama";
export const AGENTS_PROVIDER_CUSTOM = "Custom LLM Gateway";
diff --git a/src/client/src/lib/platform/agents/materialize.ts b/src/client/src/lib/platform/agents/materialize.ts
index fd6004fa..e9d7213f 100644
--- a/src/client/src/lib/platform/agents/materialize.ts
+++ b/src/client/src/lib/platform/agents/materialize.ts
@@ -69,7 +69,7 @@ interface DiscoveredAgent {
last_seen: string;
instrumentation_status: string;
// Provider candidates the controller detected by scanning the process
- // (Python imports for `openai`, `anthropic`, etc.). Lets the agents
+ // (SDK packages or provider connection events). Lets the agents
// table render provider logos for controller-discovered workloads
// before any GenAI trace has arrived. Empty for SDK-only rows.
controller_llm_providers: string[];
@@ -236,6 +236,7 @@ async function discoverAgents(
argMax(s.service_name, s.last_seen) AS service_name,
argMax(s.workload_key, s.last_seen) AS workload_key,
argMax(s.instrumentation_status, s.last_seen) AS instrumentation_status,
+ argMax(s.language_runtime, s.last_seen) AS language_runtime,
argMax(s.resource_attributes, s.last_seen) AS resource_attributes,
argMax(s.llm_providers, s.last_seen) AS llm_providers,
min(s.first_seen) AS first_seen,
@@ -269,6 +270,7 @@ async function discoverAgents(
argMax(s.service_name, s.last_seen) AS service_name,
argMax(s.workload_key, s.last_seen) AS workload_key,
argMax(s.instrumentation_status, s.last_seen) AS instrumentation_status,
+ argMax(s.language_runtime, s.last_seen) AS language_runtime,
argMax(s.resource_attributes, s.last_seen) AS resource_attributes,
argMax(s.llm_providers, s.last_seen) AS llm_providers,
min(s.first_seen) AS first_seen,
@@ -292,6 +294,7 @@ async function discoverAgents(
latest.service_name AS service_name,
latest.workload_key AS workload_key,
latest.instrumentation_status AS instrumentation_status,
+ latest.language_runtime AS language_runtime,
latest.resource_attributes AS resource_attributes,
latest.llm_providers AS llm_providers,
latest.first_seen AS first_seen,
@@ -311,6 +314,7 @@ async function discoverAgents(
service_name: string;
workload_key: string;
instrumentation_status: string;
+ language_runtime: string;
resource_attributes: Record<string, string> | string[][] | null;
llm_providers: string[] | null;
first_seen: string;
@@ -395,6 +399,7 @@ async function discoverAgents(
existing.controller_instance_id = row.controller_instance_id;
existing.instrumentation_status =
row.instrumentation_status || existing.instrumentation_status;
+ existing.sdk_language = row.language_runtime || existing.sdk_language;
existing.first_seen = earliest(existing.first_seen, row.first_seen);
existing.last_seen = latest(existing.last_seen, row.last_seen);
existing.controller_llm_providers = ctrlProviders;
@@ -409,7 +414,7 @@ async function discoverAgents(
controller_service_id: row.id,
controller_instance_id: row.controller_instance_id,
sdk_version: attrs["telemetry.sdk.version"] || "",
- sdk_language: attrs["telemetry.sdk.language"] || "",
+ sdk_language: attrs["telemetry.sdk.language"] || row.language_runtime || "",
first_seen: row.first_seen,
last_seen: row.last_seen,
instrumentation_status: row.instrumentation_status || "discovered",
diff --git a/src/client/src/lib/platform/controller/features/agent.ts b/src/client/src/lib/platform/controller/features/agent.ts
index 009408c2..b9258041 100644
--- a/src/client/src/lib/platform/controller/features/agent.ts
+++ b/src/client/src/lib/platform/controller/features/agent.ts
@@ -10,6 +10,7 @@ import {
import { KNOWN_ACTIONS } from "@/types/controller";
import type {
PythonSDKActionPayload,
+ PythonSDKActionRuntime,
FeatureDesiredState,
EnvironmentFeatureConfig,
} from "@/types/controller";
@@ -23,27 +24,41 @@ import { registerFeature } from "./registry";
const FEATURE = "agent";
function capabilityForMode(
- mode: string | undefined
+ mode: string | undefined,
+ runtime: string
): { value: string; prefix: boolean } {
+ const runtimePrefix = runtime === "nodejs" ? "nodejs_sdk_injection" : "python_sdk_injection";
switch (mode) {
case "kubernetes":
- return { value: "python_sdk_injection_kubernetes_v1", prefix: false };
+ return { value: `${runtimePrefix}_kubernetes_v1`, prefix: false };
case "docker":
- return { value: "python_sdk_injection_docker_v1", prefix: false };
+ return { value: `${runtimePrefix}_docker_v1`, prefix: false };
case "linux":
- return { value: "python_sdk_injection_linux_", prefix: true };
+ return { value: `${runtimePrefix}_linux_`, prefix: true };
default:
return { value: "", prefix: false };
}
}
-function preflightReasonForMode(mode: string, supportsPythonSDK: boolean) {
- if (supportsPythonSDK) return "";
+function isSupportedAgentRuntime(runtime: string): runtime is PythonSDKActionRuntime {
+ return runtime === "python" || runtime === "nodejs";
+}
+
+function normalizeAgentRuntime(runtime?: string) {
+ return runtime === "node" ? "nodejs" : runtime || "python";
+}
+
+function runtimeLabel(runtime: string) {
+ return normalizeAgentRuntime(runtime) === "nodejs" ? "JavaScript/TypeScript" : "Python";
+}
+
+function preflightReasonForMode(mode: string, supportsSDK: boolean, runtime: string) {
+ if (supportsSDK) return "";
switch (mode) {
case "docker":
return "Docker Agent Observability requires a writable Docker socket and a Docker-capable controller.";
case "linux":
- return "Linux Agent Observability requires a Python runtime on the target host.";
+ return `Linux Agent Observability requires a supported ${runtimeLabel(runtime)} runtime on the target host.`;
default:
return "Selected controller does not advertise Agent Observability support for this mode yet.";
}
@@ -54,17 +69,18 @@ async function resolveAgentContext(
dbConfigId?: string
): Promise<
| { error: Response }
- | { service: any; supportsPythonSDK: boolean; mode: string }
+ | { service: any; supportsPythonSDK: boolean; mode: string; runtime: PythonSDKActionRuntime }
> {
const serviceRes = await getServiceById(serviceId, dbConfigId);
if (!serviceRes.data || serviceRes.data.length === 0) {
return { error: Response.json({ error: "Service not found" }, { status: 404 }) };
}
const service = serviceRes.data[0];
- if (service.language_runtime !== "python") {
+ const runtime = normalizeAgentRuntime(service.language_runtime);
+ if (!isSupportedAgentRuntime(runtime)) {
return {
error: Response.json(
- { error: "Agent observability is only available for Python services." },
+ { error: "Agent observability is only available for Python and JavaScript/TypeScript services." },
{ status: 400 }
),
};
@@ -75,7 +91,7 @@ async function resolveAgentContext(
dbConfigId
);
const instance = instanceRes.data?.[0];
- const expected = capabilityForMode(instance?.mode);
+ const expected = capabilityForMode(instance?.mode, runtime);
const capabilities =
instance?.resource_attributes?.["controller.capabilities"] || "";
const supportsPythonSDK = capabilities
@@ -87,7 +103,7 @@ async function resolveAgentContext(
: cap === expected.value
);
- return { service, supportsPythonSDK, mode: instance?.mode || "linux" };
+ return { service, supportsPythonSDK, mode: instance?.mode || "linux", runtime };
}
export async function buildAgentStatusResponse(
@@ -97,6 +113,7 @@ export async function buildAgentStatusResponse(
dbConfigId?: string
) {
const attrs = service.resource_attributes || {};
+ const runtime = normalizeAgentRuntime(service.language_runtime);
const status = attrs["openlit.agent_observability.status"] || "disabled";
const source = attrs["openlit.agent_observability.source"] || "none";
// Desired status no longer lives on the service's resource_attributes
@@ -116,9 +133,9 @@ export async function buildAgentStatusResponse(
}
let reason =
attrs["openlit.observability.reason"] ||
- (service.language_runtime === "python"
- ? "Python runtime detected but OpenLIT Python SDK not enabled"
- : "Agent observability is only available for Python services");
+ (isSupportedAgentRuntime(runtime)
+ ? `${runtimeLabel(runtime)} runtime detected but OpenLIT SDK not enabled`
+ : "Agent observability is only available for Python and JavaScript/TypeScript services");
const conflict = attrs["openlit.observability.conflict"] || "";
let automatable = supportsPythonSDK;
const isContainerized = attrs["openlit.is_containerized"] === "true";
@@ -137,7 +154,7 @@ export async function buildAgentStatusResponse(
"Existing OpenLIT instrumentation was detected, but it is not controller-managed and will not be removed automatically.";
}
if (!automatable && !attrs["openlit.observability.reason"]) {
- reason = preflightReasonForMode(mode, supportsPythonSDK) || reason;
+ reason = preflightReasonForMode(mode, supportsPythonSDK, runtime) || reason;
}
const transitioning = desiredStatus !== "" && desiredStatus !== status;
@@ -148,7 +165,7 @@ export async function buildAgentStatusResponse(
return {
enabled: status === "enabled" || status === "manual",
- supported: service.language_runtime === "python",
+ supported: isSupportedAgentRuntime(runtime),
automatable,
mode,
status,
@@ -267,7 +284,7 @@ const agentHandler: FeatureHandler = {
}
const actionPayload: PythonSDKActionPayload = {
- target_runtime: "python",
+ target_runtime: ctx.runtime,
instrumentation_profile: "controller_managed",
duplicate_policy: "block_if_existing_otel_detected",
observability_scope: "agent",
@@ -306,8 +323,8 @@ const agentHandler: FeatureHandler = {
return Response.json({
status: "queued",
message: enabling
- ? "Controller-managed Python SDK rollout queued. Workload-level changes will be applied on the next controller poll."
- : "Controller-managed Python SDK removal queued.",
+ ? "Controller-managed OpenLIT SDK rollout queued. Workload-level changes will be applied on the next controller poll."
+ : "Controller-managed OpenLIT SDK removal queued.",
service: ctx.service.service_name,
namespace: ctx.service.namespace || "default",
controllers: targets.length,
@@ -327,7 +344,6 @@ const agentHandler: FeatureHandler = {
): ReconcileAction[] {
const actions: ReconcileAction[] = [];
const defaultPayload = JSON.stringify({
- target_runtime: "python",
instrumentation_profile: "controller_managed",
duplicate_policy: "block_if_existing_otel_detected",
observability_scope: "agent",
@@ -336,6 +352,8 @@ const agentHandler: FeatureHandler = {
for (const svc of reportedServices) {
const desired = desiredStates.get(svc.workload_key);
if (!desired) continue;
+ const runtime = normalizeAgentRuntime(svc.language_runtime);
+ if (!isSupportedAgentRuntime(runtime)) continue;
const agentStatus =
svc.resource_attributes?.[
@@ -349,7 +367,10 @@ const agentHandler: FeatureHandler = {
actions.push({
actionType: KNOWN_ACTIONS.ENABLE_AGENT,
serviceKey: svc.workload_key,
- payload: desired.config !== "{}" ? desired.config : defaultPayload,
+ payload: desired.config !== "{}" ? desired.config : JSON.stringify({
+ ...JSON.parse(defaultPayload),
+ target_runtime: runtime,
+ }),
});
}
if (
@@ -359,7 +380,10 @@ const agentHandler: FeatureHandler = {
actions.push({
actionType: KNOWN_ACTIONS.DISABLE_AGENT,
serviceKey: svc.workload_key,
- payload: defaultPayload,
+ payload: JSON.stringify({
+ ...JSON.parse(defaultPayload),
+ target_runtime: runtime,
+ }),
});
}
}
diff --git a/src/client/src/lib/platform/controller/features/registry.ts b/src/client/src/lib/platform/controller/features/registry.ts
index b5c2ac8d..315cc92a 100644
--- a/src/client/src/lib/platform/controller/features/registry.ts
+++ b/src/client/src/lib/platform/controller/features/registry.ts
@@ -6,6 +6,7 @@ import type {
export interface ReportedService {
workload_key: string;
instrumentation_status: string;
+ language_runtime?: string;
resource_attributes?: Record<string, string>;
}
diff --git a/src/client/src/lib/platform/controller/validate-config.ts b/src/client/src/lib/platform/controller/validate-config.ts
index c5a26efd..b75199c2 100644
--- a/src/client/src/lib/platform/controller/validate-config.ts
+++ b/src/client/src/lib/platform/controller/validate-config.ts
@@ -111,6 +111,7 @@ function sanitizePayloadExtraction(raw: unknown): PayloadExtractionConfig {
gemini: bool(p.gemini),
qwen: bool(p.qwen),
bedrock: bool(p.bedrock),
+ retrieval: bool(p.retrieval),
custom: bool(p.custom),
ollama: bool(p.ollama),
};
diff --git a/src/client/src/types/controller.ts b/src/client/src/types/controller.ts
index b35096fa..a9eef4c1 100644
--- a/src/client/src/types/controller.ts
+++ b/src/client/src/types/controller.ts
@@ -82,10 +82,10 @@ export interface DiscoveryConfig {
}
// Payload extraction toggles map 1:1 to OBI GenAI extractors the controller can
-// actually enable. OBI natively parses openai/anthropic/gemini/qwen/bedrock; all
-// OpenAI-compatible SaaS vendors are parsed by the OpenAI extractor; `custom`
-// covers self-hosted OpenAI-compatible gateways; `ollama` covers Ollama's native
-// API. (Discovery may still surface other vendor names as chips — see
+// actually enable. OBI natively parses openai/anthropic/gemini/qwen/bedrock and
+// retrieval; all OpenAI-compatible SaaS vendors are parsed by the OpenAI
+// extractor; `custom` covers self-hosted OpenAI-compatible gateways; `ollama`
+// covers Ollama's native API. (Discovery may still surface other vendor names as chips - see
// PROVIDER_LABELS — but only these have a dedicated extractor toggle.)
export interface PayloadExtractionConfig {
openai: boolean;
@@ -93,6 +93,7 @@ export interface PayloadExtractionConfig {
gemini: boolean;
qwen: boolean;
bedrock: boolean;
+ retrieval: boolean;
custom: boolean;
ollama: boolean;
}
@@ -140,7 +141,7 @@ export interface EnvironmentFeatureConfig {
updated_at: string;
}
-export type PythonSDKActionRuntime = "python";
+export type PythonSDKActionRuntime = "python" | "nodejs";
export type PythonSDKInstrumentationProfile = "controller_managed";
export type PythonSDKDuplicatePolicy =
| "prefer_sdk_agent_spans"
diff --git a/src/dev-docker-compose.yml b/src/dev-docker-compose.yml
index f905c498..8fbc238d 100644
--- a/src/dev-docker-compose.yml
+++ b/src/dev-docker-compose.yml
@@ -148,6 +148,23 @@ services:
openlit:
condition: service_healthy
+ # JavaScript/TypeScript agent-framework sample app.
+ # Runs the real @openai/agents SDK against an in-process OpenAI-compatible
+ # mock LLM. It intentionally does not call openlit.init(); use the Agents
+ # page to enable controller-managed JS/TS SDK injection and verify framework
+ # spans from the injected OpenLIT preload.
+ openai-agents-js-app:
+ build: ../examples/openai-agents-js-app
+ container_name: demo-openai-agents-js-app
+ profiles: [full]
+ environment:
+ AGENT_MODEL: gpt-4o-mini
+ REQUEST_INTERVAL_SECONDS: "20"
+ restart: unless-stopped
+ depends_on:
+ openlit:
+ condition: service_healthy
+
non-llm-app:
build: ../examples/non-llm-http-app
container_name: demo-non-llm-app