Allow telemetry exporters to GCP to utilize user's login credentials, if requested (#13778)

This commit is contained in:
Marat Boshernitsan
2025-12-02 21:27:37 -08:00
committed by GitHub
parent 92e95ed806
commit b9b3b8050d
26 changed files with 994 additions and 428 deletions
+4 -2
View File
@@ -7,7 +7,7 @@
*/
import path from 'node:path';
import fs from 'node:fs';
import * as fs from 'node:fs';
import { spawn, execSync } from 'node:child_process';
import {
OTEL_DIR,
@@ -132,11 +132,13 @@ async function main() {
fs.writeFileSync(OTEL_CONFIG_FILE, getOtelConfigContent(projectId));
console.log(`📄 Wrote OTEL collector config to ${OTEL_CONFIG_FILE}`);
const spawnEnv = { ...process.env };
console.log(`🚀 Starting OTEL collector for GCP... Logs: ${OTEL_LOG_FILE}`);
collectorLogFd = fs.openSync(OTEL_LOG_FILE, 'a');
collectorProcess = spawn(otelcolPath, ['--config', OTEL_CONFIG_FILE], {
stdio: ['ignore', collectorLogFd, collectorLogFd],
env: { ...process.env },
env: spawnEnv,
});
console.log(