Repository navigation
{Telemetry} Bypass telemetry filtering rules on debug dev/debug builds - #1492
Open
JaysonTaiMicrosoft wants to merge 10 commits into
Open
JaysonTaiMicrosoft wants to merge 10 commits into
JaysonTaiMicrosoft wants to merge 10 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unfiltered telemetry can expose plaintext passwords through an unauthenticated collector UI bound to all interfaces and local files lacking owner-only permissions.
3 open issues
What changed in this PR
Adds unfiltered local telemetry for Debug builds, addressing #1353 while keeping remote exports and Release builds filtered.
Changes:
- Resolves telemetry targets once per process and bypasses privacy filters only in Debug local-only mode.
- Separates local traces into
traces-local, preserving raw parameters, tags, events and status descriptions. - Adds targeted tests and documents local-mode behavior, isolation and sensitive-data risks.
| File | Description |
|---|---|
| wiki/02-deep-dive/telemetry.md | Explains filter bypass and local queue isolation. |
| wiki/01-getting-started/overview.md | Adds the local trace directory reference. |
| wiki/01-getting-started/environment-setup.md | Updates a source-line reference. |
| wiki/01-getting-started/cli-usage.md | Updates a source-line reference. |
| tools/observability/README.md | Documents local-mode risks and verification steps. |
| tests/Shared/TelemetryTargetIsolation.cs | Clears inherited telemetry targets before tests. |
| tests/Directory.Build.props | Includes shared test isolation code. |
| tests/Core.Telemetry.Tests/TraceReplayerTests.cs | Tests status-description replay. |
| tests/Core.Telemetry.Tests/TelemetryTargetResolverTests.cs | Tests bypass eligibility and cached resolution. |
| tests/Core.Telemetry.Tests/TelemetryServiceParameterFormattingTests.cs | Tests masked and revealed parameter formatting. |
| tests/Core.Telemetry.Tests/TelemetryServiceEnabledGateTests.cs | Verifies invocation parameters remain masked normally. |
| tests/Core.Telemetry.Tests/TelemetrySenderRegistrationTests.cs | Tests conditional filter registration. |
| tests/Core.Telemetry.Tests/PersistenceTelemetryTests.cs | Tests local and shared queue isolation. |
| tests/Core.Telemetry.Tests/HttpActivityEnricherTests.cs | Tests conditional exception sanitization. |
| tests/Core.Telemetry.Tests/FileExporterBatchTests.cs | Tests unfiltered trace serialization. |
| src/Core/Core.Telemetry/TraceReplayer.cs | Restores recorded status descriptions. |
| src/Core/Core.Telemetry/TraceEntry.cs | Adds optional status-description storage. |
| src/Core/Core.Telemetry/TelemetryUploadReservation.cs | Routes reservations to the selected queue. |
| src/Core/Core.Telemetry/TelemetryUpload.cs | Selects the matching upload queue. |
| src/Core/Core.Telemetry/TelemetryTargetResolver.cs | Caches targets and derives bypass and queue selection. |
| src/Core/Core.Telemetry/TelemetryService.cs | Reveals parameter values in local-only mode. |
| src/Core/Core.Telemetry/ITraceDirectoryProvider.cs | Selects shared or local trace storage. |
| src/Core/Core.Telemetry/HttpActivityEnricher.cs | Preserves HTTP exception text when bypassing rules. |
| src/Core/Core.Telemetry/FileTelemetrySender.cs | Passes bypass mode to the file exporter. |
| src/Core/Core.Telemetry/FileExporter.cs | Retains raw tags, events and status descriptions locally. |
| src/Core/Core.Telemetry/DIRegisterExtensions.cs | Omits filter processors when bypassing rules. |
| src/Core/Core.Abstractions/HomePaths.cs | Defines the local trace directory name. |
| eng-docs/spec/telemetry.md | Documents the local-mode privacy exception and queue. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Related command
Description
Add local dev feature requested in [Dev] Bypass telemetry tag rules when AZCLIPS_TELEMETRY_TARGET=local #1353
AZCLIPS_TELEMETRY_TARGETvariable.localunfiltered all telemetry information becomes unfiltered e.g urls, error descriptions and parameters become visible in local Jaeger telemetry.both, local AND remote telemetry exported is FILTERED.remote, telemetry is only sent to remote sinks. Therefore, all data is filtered.AZCLIPS_TELEMETRY_TARGETvariable completely and only export to remote sinks with all data filtered.Testing Guide
From Powershell terminal
DEBUG Default or
$env:AZCLIPS_TELEMETRY_TARGET = 'both'(expect data in Jaeger and bronze clusters to be filtered)./artifacts/debug/Core.Cli/az.exe group show --name <non-existent>DEBUG
$env:AZCLIPS_TELEMETRY_TARGET = 'local'(expect data in Jaeger only and UNFILTERED)./artifacts/debug/Core.Cli/az.exe group show --name <non-existent>DEBUG
$env:AZCLIPS_TELEMETRY_TARGET = 'remote'(expect data in bronze cluster only and filtered)./artifacts/debug/Core.Cli/az.exe group show --name <non-existent>RELEASE
$env:AZCLIPS_TELEMETRY_TARGET = 'both',$env:AZCLIPS_TELEMETRY_TARGET = 'local',$env:AZCLIPS_TELEMETRY_TARGET = 'remote'(expect data in bronze cluster only and filtered)./artifacts/Release/Core.Cli/az.exe group show --name <non-existent>Note: May take 10-15 minutes for data to appear in bronze cluster.
PowerShell cmdlets
Set the target first, then import the modules and run the cmdlet (use a fresh PowerShell session for each target).
DEBUG Default or
$env:AZCLIPS_TELEMETRY_TARGET = 'both'(expect data in Jaeger and bronze clusters to be filtered)Import-Module ./src/PS/Accounts/Accounts.psd1; Import-Module ./src/PS/Resources/Resources.psd1; Import-Module ./src/PS/Compute/Compute.psd1Get-AzResourceGroupDEBUG
$env:AZCLIPS_TELEMETRY_TARGET = 'local'(expect data in Jaeger only and UNFILTERED)Import-Module ./src/PS/Accounts/Accounts.psd1; Import-Module ./src/PS/Resources/Resources.psd1; Import-Module ./src/PS/Compute/Compute.psd1Get-AzResourceGroupDEBUG
$env:AZCLIPS_TELEMETRY_TARGET = 'remote'(expect data in bronze cluster only and filtered)Import-Module ./src/PS/Accounts/Accounts.psd1; Import-Module ./src/PS/Resources/Resources.psd1; Import-Module ./src/PS/Compute/Compute.psd1Get-AzResourceGroupRELEASE
$env:AZCLIPS_TELEMETRY_TARGET = 'both',$env:AZCLIPS_TELEMETRY_TARGET = 'local',$env:AZCLIPS_TELEMETRY_TARGET = 'remote'(expect data in bronze cluster only and filtered)build/Set-ModuleConfiguration.ps1 -Configuration Release, then import the staged Accounts, Resources and Compute modulesGet-AzResourceGroupHistory Notes
[Component Name]for customer-facing changes or{Component Name}for non-customer-facing changes, and does not end with trailing punctuation or spaces.