UNPKG

@copilotkit/runtime

Version:

<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />

33 lines (31 loc) 1.35 kB
require("reflect-metadata"); const require_telemetry_client = require('./telemetry-client.cjs'); //#region src/v2/runtime/telemetry/instance-created.ts /** * Fire the `oss.runtime.instance_created` telemetry event for a v2 runtime * handler. Called once per handler factory invocation (not per request). * * v2 does not have a concept of remote endpoints or standalone actions, so * those counts are 0 / []. `cloud.api_key_provided` is false at this level * because in v2 the cloud public key arrives per-request via the * `x-copilotcloud-public-api-key` header — not at handler creation time. * See `handlers/handle-run.ts` for the per-request event that DOES carry * the key when present. * * Errors resolving agents are swallowed — telemetry must never break * runtime setup. */ function fireInstanceCreatedTelemetry({ runtime }) { (typeof runtime.agents === "function" ? Promise.resolve(null) : Promise.resolve(runtime.agents)).then((agents) => { require_telemetry_client.default.capture("oss.runtime.instance_created", { actionsAmount: 0, endpointTypes: [], endpointsAmount: 0, agentsAmount: agents ? Object.keys(agents).length : null, "cloud.api_key_provided": false }); }).catch(() => {}); } //#endregion exports.fireInstanceCreatedTelemetry = fireInstanceCreatedTelemetry; //# sourceMappingURL=instance-created.cjs.map