Skip to content

Skip telemetry work when it cannot be sent#5071

Merged
Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
optimize-telemetry-init-path
Jul 10, 2026
Merged

Skip telemetry work when it cannot be sent#5071
Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
optimize-telemetry-init-path

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

This pull request improves the telemetry system by ensuring that telemetry events are only collected and sent when telemetry is enabled and valid OpenSearch credentials are configured. This prevents unnecessary work and event accumulation in unofficial or community builds, and makes the code more efficient and robust. Additionally, the platform info object is now cached for reuse, reducing redundant object creation.

Telemetry event gating and efficiency:

  • All telemetry logic now checks both if telemetry is enabled and if OpenSearch credentials are configured (via CredentialsConfigured()) before proceeding, ensuring no telemetry data is collected or sent in unofficial/community builds or when the user has opted out. This applies to initialization, event enqueuing, event flushing, and bundle event tracking (TelemetryHandler.cs).

Performance improvement:

  • The TelemetryPlatformInfo object is now constructed once and cached for reuse across all telemetry events, avoiding redundant allocations and improving performance (TelemetryHandler.cs).

@GabrielDuf Gabriel Dufresne (GabrielDuf) merged commit ef88356 into main Jul 10, 2026
5 checks passed
@GabrielDuf Gabriel Dufresne (GabrielDuf) deleted the optimize-telemetry-init-path branch July 10, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants