Conversation
…rs.EnableSensitiveDataDefault Co-authored-by: JamesNK <303201+JamesNK@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Set default for EnableSensitiveTelemetryData
Default OpenAISettings.EnableSensitiveTelemetryData to TelemetryHelpers.EnableSensitiveDataDefault
Nov 17, 2025
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12992Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12992" |
1 task
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR aligns OpenAISettings.EnableSensitiveTelemetryData with AzureOpenAISettings by defaulting to TelemetryHelpers.EnableSensitiveDataDefault, ensuring consistent behavior across OpenAI integrations. The property now respects the OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT environment variable (defaults to false if unset).
Key changes:
- Updated default value for
EnableSensitiveTelemetryDatato useTelemetryHelpers.EnableSensitiveDataDefault - Enhanced XML documentation to reflect environment variable behavior
- Added comprehensive test coverage for default and configuration override scenarios
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Components/Aspire.OpenAI/OpenAISettings.cs |
Modified EnableSensitiveTelemetryData to default to TelemetryHelpers.EnableSensitiveDataDefault and updated XML documentation to describe environment variable behavior |
src/Components/Aspire.OpenAI/Aspire.OpenAI.csproj |
Linked AITelemetryHelpers.cs from Common directory to provide access to TelemetryHelpers class |
tests/Aspire.OpenAI.Tests/AspireOpenAIExtensionsTests.cs |
Added two test methods verifying default behavior based on environment variable and configuration override capability |
davidfowl
approved these changes
Nov 17, 2025
Member
|
/backport to release/13.0 |
Contributor
|
Started backporting to release/13.0: https://github.com/dotnet/aspire/actions/runs/19448161972 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #12961
Description
Aligns
OpenAISettings.EnableSensitiveTelemetryDatawithAzureOpenAISettingsby defaulting toTelemetryHelpers.EnableSensitiveDataDefault. This ensures consistent behavior across OpenAI integrations - the property now respects theOTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENTenvironment variable (defaults tofalseif unset).Changes:
EnableSensitiveTelemetryDatadefault value toTelemetryHelpers.EnableSensitiveDataDefaultAITelemetryHelpers.csinAspire.OpenAI.csprojto accessTelemetryHelpersChecklist
<remarks />and<code />elements on your triple slash comments?doc-ideatemplatebreaking-changetemplatediagnostictemplateWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
api.openai.com/home/REDACTED/work/aspire/aspire/artifacts/bin/Aspire.OpenAI.Tests/Debug/net10.0/Aspire.OpenAI.Tests --internal-msbuild-node /home/REDACTED/.local/share/37d0e97c58f3460bbe165c654539f648/.p --filter-not-trait category=failing --filter-not-trait quarantined=true --filter-not-trait outerloop=true(dns block)/usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/aspire/aspire/artifacts/bin/Aspire.OpenAI.Tests/Debug/net8.0/Aspire.OpenAI.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/aspire/aspire/artifacts/bin/Aspire.OpenAI.Tests/Debug/net8.0/Aspire.OpenAI.Tests.deps.json /home/REDACTED/work/aspire/aspire/artifacts/bin/Aspire.OpenAI.Tests/Debug/net8.0/Microsoft.DotNet.RemoteExecutor.dll Aspire.OpenAI.Tests, Version=42.42.42.42, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 Aspire.OpenAI.Tests.ConformanceTests+<>c <TracingEnablesTheRightActivitySource_Keyed>b__19_0 /tmp/d3zrawk2.bou(dns block)/usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/aspire/aspire/artifacts/bin/Aspire.OpenAI.Tests/Debug/net10.0/Aspire.OpenAI.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/aspire/aspire/artifacts/bin/Aspire.OpenAI.Tests/Debug/net10.0/Aspire.OpenAI.Tests.deps.json /home/REDACTED/work/aspire/aspire/artifacts/bin/Aspire.OpenAI.Tests/Debug/net10.0/Microsoft.DotNet.RemoteExecutor.dll Aspire.OpenAI.Tests, Version=42.42.42.42, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 Aspire.OpenAI.Tests.ConformanceTests+<>c <TracingEnablesTheRightActivitySource_Keyed>b__19_0 /tmp/5ogzjyyl.a1n(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.