From 95e4a60a83dd8e710ef69f78b3b57de4b4703344 Mon Sep 17 00:00:00 2001 From: Jerop Kipruto Date: Fri, 13 Jun 2025 03:51:41 -0400 Subject: Telemetry: Auto-export to GCP if GOOGLE_CLOUD_PROJECT is set (#1003) This change simplifies telemetry setup for users who want to integrate with GCP, as they no longer need to configure a local collector or an explicit endpoint if their project is already set up in the environment. This change updates the telemetry system to automatically export traces, logs, and metrics to Google Cloud Platform (GCP) if the `GOOGLE_CLOUD_PROJECT` environment variable is set and no explicit `telemetryOtlpEndpoint` is configured by the user. Key changes: - The default `telemetryOtlpEndpoint` in `Config` is now an empty string. - The `initializeTelemetry` SDK logic now prioritizes: - User-defined `telemetryOtlpEndpoint`. - `GOOGLE_CLOUD_PROJECT` for direct GCP export. - Console exporters as a fallback. - If an invalid `telemetryOtlpEndpoint` is provided, it falls back to console exporters with a warning. #750 --- packages/core/src/config/config.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'packages/core/src/config') diff --git a/packages/core/src/config/config.ts b/packages/core/src/config/config.ts index 3bb9815f..a54b51a1 100644 --- a/packages/core/src/config/config.ts +++ b/packages/core/src/config/config.ts @@ -141,8 +141,7 @@ export class Config { this.telemetry = params.telemetry ?? false; this.telemetryLogUserPromptsEnabled = params.telemetryLogUserPromptsEnabled ?? true; - this.telemetryOtlpEndpoint = - params.telemetryOtlpEndpoint ?? 'http://localhost:4317'; + this.telemetryOtlpEndpoint = params.telemetryOtlpEndpoint ?? ''; this.fileFilteringRespectGitIgnore = params.fileFilteringRespectGitIgnore ?? true; this.fileFilteringAllowBuildArtifacts = -- cgit v1.2.3