Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Sep 30, 2025

Backport of #11670 to release/9.5

/cc @JamesNK @copilot

Customer Impact

Just after 9.5 locked down Microsoft.Extensions.AI was updated to use the OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT env var to decide the default value of EnableSensitiveData. This property controls whether MEAI includes message content in GenAI telemetry.

Unfortunately Aspire AI integrations overwrites MEAI's EnableSensitiveData property. That means its set to what the user set (good) or back to its default of false (bad, we lose the env var default).

The end result is users have to manually enable sensitive data in local dev environment instead of it automatically being enabled.

Fixes in this PR:

  • Aspire AI integrations to also check OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT. Because of layering of the current code, it was simpler to continue to overwrite MEAI's EnableSensitiveData property, but now the new value is a sensible default based on the env var.
  • Update Microsoft.Extensions.AI to version that looks for OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT. That means if someone has a reference to MEAI via our packages, but is creating the client themselves, then they'll get a consistent experience.

The goal here is to make GenAI telemetry "just work" in local development without any additional configuration.

Testing

Manual testing

Risk

Low

Regression?

No

@github-actions
Copy link
Contributor Author

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 11726

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 11726"

@JamesNK JamesNK added the Servicing-consider Issue for next servicing release review label Sep 30, 2025
@davidfowl
Copy link
Member

Do we need this in the community toolkit as well?

cc @aaronpowell

@aaronpowell
Copy link
Contributor

Do we need this in the community toolkit as well?

cc @aaronpowell

Our last release bumped MEAI to 9.9.0, I'm not too bothered on the .1 release

@JamesNK
Copy link
Member

JamesNK commented Sep 30, 2025

There is no product toolkit code that sets the property so no changes should be required: https://github.com/search?q=repo%3ACommunityToolkit%2FAspire+EnableSensitiveData&type=code

@JamesNK JamesNK added this to the 9.5.1 milestone Sep 30, 2025
@joperezr joperezr added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Sep 30, 2025
@joperezr
Copy link
Member

Low risk, fixing a new feature. Approved for 9.5.1

@davidfowl davidfowl merged commit 84dc29a into release/9.5 Oct 1, 2025
311 checks passed
This was referenced Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants