Skip to content

Added CosmosDB telemetry logging option#1881

Open
robgruen wants to merge 11 commits intomainfrom
dev/robgruen/mongodb_migration
Open

Added CosmosDB telemetry logging option#1881
robgruen wants to merge 11 commits intomainfrom
dev/robgruen/mongodb_migration

Conversation

@robgruen
Copy link
Collaborator

@robgruen robgruen commented Feb 3, 2026

This pull request introduces support for Azure Cosmos DB as a logging backend in the telemetry system, replacing direct MongoDB usage with a more flexible approach that can automatically select between Cosmos DB and MongoDB based on environment configuration. It also updates dependencies and environment variable handling to support this change.

Database logging backend enhancements:

  • Added a new createCosmosDBLoggerSink implementation in cosmosDBLoggerSink.ts for logging events to Azure Cosmos DB, including batching, retries, and error handling.
  • Introduced createDatabaseLoggerSink in databaseLoggerSink.ts, which selects Cosmos DB or MongoDB for logging based on available environment variables, prioritizing Cosmos DB.
  • Updated imports and logger initialization in commandHandlerContext.ts and promptLogger.ts to use createDatabaseLoggerSink instead of createMongoDBLoggerSink. [1] [2] [3] [4] [5] [6]
  • Exported new logger sink creators from indexNode.ts for external usage.

Dependency and configuration updates:

  • Added @azure/cosmos and @azure/identity as dependencies in telemetry/package.json to support Cosmos DB integration.
  • Updated getKeys.config.json to reference COSMOSDB_CONNECTION_STRING instead of MONGODB_CONNECTION_STRING and to remove the MongoDB connection string from managed secrets. [1] [2]This pull request migrates the telemetry logging system from MongoDB to Azure Cosmos DB across the codebase. The migration includes replacing all MongoDB logger sink imports and usage with Cosmos DB equivalents, updating environment variable handling, and removing the MongoDB-specific logger sink implementation. Additionally, the necessary Azure Cosmos DB and identity packages are added as dependencies.

Migration from MongoDB to Cosmos DB for Telemetry Logging:

  • Replaced all imports and usages of createMongoDBLoggerSink with createCosmosDBLoggerSink in commandHandlerContext.ts (both in dispatcher and spelunker), and in promptLogger.ts to use Cosmos DB for logging. [1] [2] [3] [4] [5] [6]

  • Updated the telemetry package's public API to export createCosmosDBLoggerSink instead of createMongoDBLoggerSink, and added the new Cosmos DB logger sink implementation in cosmosDBLoggerSink.ts. [1] [2]

Dependency and Configuration Updates:

  • Added @azure/cosmos and @azure/identity as dependencies in telemetry/package.json, and removed the mongodb dependency.

  • Updated environment variable configuration in getKeys.config.json to use COSMOSDB_CONNECTION_STRING instead of MONGODB_CONNECTION_STRING, and removed the MongoDB connection string from the list of managed secrets. [1] [2]

Code Cleanup:

  • Removed the entire MongoDB logger sink implementation (mongoLoggerSink.ts) from the codebase.

@robgruen robgruen marked this pull request as ready for review February 3, 2026 01:08
@robgruen robgruen enabled auto-merge February 3, 2026 01:08
@robgruen robgruen temporarily deployed to development-fork February 3, 2026 01:09 — with GitHub Actions Inactive
@robgruen robgruen temporarily deployed to development-fork February 3, 2026 01:09 — with GitHub Actions Inactive
…gth for AI client. Updated all calls to retain existing logging logic.
@robgruen robgruen deployed to development-fork February 4, 2026 22:00 — with GitHub Actions Active
@robgruen robgruen temporarily deployed to development-fork February 4, 2026 22:00 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant