Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
TypeScript agentic-aiagentsaiai-agentsaiagentsdeveloper-toolsfunction-callinggpt-4javascriptjsllmllmopsmcppythonremote-mcp-serverssetypescript
Update telemetry metadata for tracking
haxzieb3e9e7db40e6
diff --git a/packages/core/src/composio.ts b/packages/core/src/composio.tsindex 0d6d48837..e5f84ba8f 100644--- a/packages/core/src/composio.ts+++ b/packages/core/src/composio.ts@@ -19,11 +19,39 @@ import { LogLevel } from '@composio/client/client';export type ComposioConfig<TProvider extends BaseComposioProvider<unknown, unknown> = OpenAIProvider,> = {+ /**+ * The API key for the Composio API.+ * @example 'sk-1234567890'+ */apiKey?: string | null;+ /**+ * The base URL of the Composio API.+ * @example 'https://backend.composio.dev'+ */baseURL?: string | null;+ /**+ * Whether to allow tracking for the Composio instance.+ * @example true, false+ * @default true+ */allowTracking?: boolean;+ /**+ * Whether to allow tracing for the Composio instance.+ * @example true, false+ * @default true+ */allowTracing?: boolean;+ /**+ * The tool provider to use for this Composio instance.+ * @example new OpenAIProvider()+ */provider?: TProvider;+ /**+ * The host service name of the SDK where the SDK is running.+ * This is used to identify the host for telemetry. Ignore it if you are not using telemetry.+ * @example 'mcp', 'apollo', ' etc+ */+ host?: string;/*** Request options to be passed to the Composio API client.* This is useful for passing in a custom fetch implementation.@@ -150,13 +178,11 @@ export class Composio<TProvider extends BaseComposioProvider<unknown, unknown> =telemetry.setup({apiKey: apiKeyParsed ?? '',baseUrl: baseURLParsed ?? '',- frameworkRuntime: this.provider?.name ?? 'unknown',isAgentic: this.provider?._isAgentic || false,- source: 'composio-sdk-typescript',version: version,- sdkType: 'Typescript-V3',isBrowser: typeof window !== 'undefined',provider: this.provider?.name ?? 'openai',+ host: this.config.host,// @TODO: Users might want to pass their own session id// @TODO: We shouldn't be doing this as people might always have one session id throughout the process in serversessionId: this.config.allowTracing ? getRandomUUID() : undefined, // @TODO: get the session iddiff --git a/packages/core/src/services/telemetry/TelemetryService.types.ts b/packages/core/src/services/telemetry/TelemetryService.types.tsindex 36ecec377..17885adef 100644--- a/packages/core/src/services/telemetry/TelemetryService.types.ts+++ b/packages/core/src/services/telemetry/TelemetryService.types.ts@@ -1,7 +1,10 @@import { z } from 'zod';export const TelemetryMetricSourceSchema = z.object({- name: z.string().describe('The name of the source').optional(),+ host: z+ .string()+ .describe('The host of the service running the SDK, eg: mcp, apollo, etc')+ .optional(),service: z.enum(['sdk', 'apollo', 'hermes', 'thermos']).describe('The service of the source')diff --git a/packages/core/src/telemetry/Telemetry.ts b/packages/core/src/telemetry/Telemetry.tsindex e90ca66d7..f8c49dd47 100644--- a/packages/core/src/telemetry/Telemetry.ts+++ b/packages/core/src/telemetry/Telemetry.ts@@ -52,7 +52,7 @@ export class TelemetryTransport {this.telemetryMetadata = metadata;this.isTelemetryDisabled = false;this.telemetrySource = {- name: this.telemetrySourceName,+ host: this.telemetryMetadata?.host ?? this.telemetrySourceName,service: this.telemetryServiceName,language: this.telemetryLanguage,version: this.telemetryMetadata?.version,diff --git a/packages/core/src/types/telemetry.types.ts b/packages/core/src/types/telemetry.types.tsindex 9ee5e0251..be4360c8e 100644--- a/packages/core/src/types/telemetry.types.ts+++ b/packages/core/src/types/telemetry.types.ts@@ -11,15 +11,36 @@ export type TelemetryEvent = (typeof TELEMETRY_EVENTS)[keyof typeof TELEMETRY_EV* Metadata for the telemetry.*/export type TelemetryMetadata = {+ /**+ * The API key of the SDK.+ * @example 'sk-1234567890'+ */apiKey: string;+ /**+ * The base URL of the SDK.+ * @example 'https://api.composio.dev'+ */baseUrl: string;+ /**+ * The version of the SDK.+ * @example '1.0.0'+ */version: string;- frameworkRuntime: string;+ /**+ * The host service name of the SDK where the SDK is running.+ * @example 'mcp', 'apollo' etc+ */+ host?: string;+ /**+ * Whether the SDK is agentic.+ * @example true, false+ */isAgentic: boolean;- source: string;+ /**+ * The provider of the SDK.+ * @example 'openai', 'anthropic', 'google', 'azure', 'composio'+ */provider?: string;- transport?: string;- sdkType?: string;sessionId?: string;isBrowser?: boolean;};