Skip to content

docs: update the .NET docs for the SendDefaultPii deprecation and AttachServerName #6089

Backlog

Description

@jamescrosswell

#6084 and #6086 both ship in 7.2.0. The .NET docs on docs.sentry.io still call ConfigureDataCollection experimental, set SendDefaultPii in their snippets, and say the machine name follows SendDefaultPii. They need updating once 7.2.0 is out, ideally in one sentry-docs PR.

What changes in 7.2.0

From #6084:

  • SendDefaultPii is deprecated in favour of ConfigureDataCollection. It's [Obsolete], so setting it in code raises CS0618. It will be removed in the next major (DataCollection phase 5: remove SendDefaultPii (next major) #5439).
  • ConfigureDataCollection and its types are no longer experimental, so they no longer raise SENTRY0001.
  • A parameterless ConfigureDataCollection() opts in with the defaults. It replaces SendDefaultPii = true.
  • Once ConfigureDataCollection has been called, the SDK no longer replaces credentials in URLs the app set itself on breadcrumbs and span descriptions. It still removes them from the URLs it records.

From #6086: AttachServerName controls whether Environment.MachineName is sent as the server name when ServerName isn't set. It defaults to true, except on Android, iOS and Mac Catalyst, where the machine name is the name of the user's device.

Without ConfigureDataCollection With ConfigureDataCollection
Events and logs AttachServerName and SendDefaultPii AttachServerName
ASP.NET and ASP.NET Core events AttachServerName AttachServerName
  • An explicitly set ServerName always wins. ASP.NET used to overwrite it with the machine name.
  • Android, iOS and Mac Catalyst apps with SendDefaultPii = true no longer send the device name. They can set AttachServerName = true to keep sending it.
  • Desktop and console apps start sending the machine name once they call ConfigureDataCollection, unless they set AttachServerName = false. The machine name there often includes the user's name.

Pages to change in getsentry/sentry-docs

Line links are pinned to sentry-docs 9286774.

Options and Data Collected

Options (docs/platforms/dotnet/common/configuration/options.mdx):

  • SendDefaultPii: mark it deprecated in favour of ConfigureDataCollection(), and say it's removed in the next major.
  • ConfigureDataCollection: drop the SENTRY0001 paragraph and show the parameterless overload. The appsettings.json paragraph mentions SENTRY0001 too.
  • "Migrating From SendDefaultPii":
    • Map SendDefaultPii = true to options.ConfigureDataCollection();.
    • Tell apps that used SendDefaultPii = false to also set AttachServerName = false.
    • The last paragraph lists what SendDefaultPii still controls. Once ConfigureDataCollection has been called, that's only the user that Sentry.OpenTelemetry sets: app-set URLs are left alone, and the machine name follows AttachServerName.
  • Add an AttachServerName option next to ServerName, and point ServerName's second paragraph at it.

Data Collected (docs/platforms/dotnet/common/data-management/data-collected.mdx):

  • "Machine Name" says ConfigureDataCollection doesn't control the machine name, and that apps other than ASP.NET and ASP.NET Core send it only with SendDefaultPii. Rewrite it around AttachServerName.
  • "Request URL" says ConfigureDataCollection doesn't change how credentials in other breadcrumbs and span descriptions are filtered. Once it has been called, the SDK sends them as they are, so they're replaced with [Filtered] only without ConfigureDataCollection and with SendDefaultPii = false.

"Experimental" and SENTRY0001

Prose that explains behavior through SendDefaultPii

These need rewriting, not just a snippet swap:

Snippets that set SendDefaultPii = true

These now raise CS0618, and several have comments that describe SendDefaultPii as the switch for request headers and user data. The samples in #6084 replace it with options.ConfigureDataCollection(dataCollection => dataCollection.UserInfo = true);, or "DataCollection": { "UserInfo": true } in appsettings.json, so readers can see which setting to change.

Lower priority:

Left alone on purpose: the v7 migration includes and migration/index.mdx, which are historical, and Xamarin, which is the separate Sentry.Xamarin SDK.

The page list started as a comment on #5437, with links updated to current sentry-docs.

Activity

  1. linear-code commented on Dec 3, 2026

    @linear-code
  2. changed the title [-]docs: document AttachServerName and update the server name wording[/-] [+]docs: update the .NET docs for the SendDefaultPii deprecation and AttachServerName[/+] on Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions