Repository navigation
feat: add AttachServerName to control sending the machine name as the server name #6086
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jamescrosswell
wants to merge
13
commits into
main
Choose a base branch
from
feat/attach-server-name
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+211
−27
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
59ff50c
feat: DataCollection is no longer experimental, and SendDefaultPii is…
jamescrosswell e11c61b
docs: list the behaviors that still follow SendDefaultPii
jamescrosswell 45b06f7
feat: add a parameterless ConfigureDataCollection overload
jamescrosswell 669a117
fix: stop redacting app-set URLs once ConfigureDataCollection is called
jamescrosswell b7fdf3c
feat: add AttachServerName to control sending the machine name
jamescrosswell bf500fe
docs: limit the ASP.NET AttachServerName exception to events
jamescrosswell e5e21cb
test: bind AttachServerName from config in both directions
jamescrosswell 1f8fec3
Merge branch 'main' of https://github.com/getsentry/sentry-dotnet int…
jamescrosswell 8b7a7f8
docs(samples): show how to opt out of UserInfo instead of setting it …
jamescrosswell f94b0ee
docs: list database sanitizing and app-set URL credentials among Send…
jamescrosswell 9af512c
Merge feat/deprecate-send-default-pii (#6084's final head) into feat/…
jamescrosswell 0b5ff8f
Merge branch 'main' into feat/attach-server-name
jamescrosswell 6804c32
docs: note that ASP.NET apps keep the machine name with SendDefaultPi…
jamescrosswell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -350,7 +350,10 @@ internal HttpRequestMessage CreateHttpRequest(HttpContent content) | |
| /// dataCollection.GraphQL.Document = false; | ||
| /// dataCollection.GraphQL.Variables = false; | ||
| /// }); | ||
| /// options.AttachServerName = false; | ||
| /// </code> | ||
| /// Leave out the last line in ASP.NET and ASP.NET Core apps, whose events include the machine name with | ||
| /// <c>SendDefaultPii = false</c> too. | ||
| /// This still differs from <c>SendDefaultPii = false</c> in four ways. Failed HTTP request events include | ||
| /// headers: <see cref="DataCollectionOptions.HttpHeaders"/> sets one behavior for those and for the headers of | ||
| /// incoming requests, and <c>SendDefaultPii = false</c> collected only the latter. They also include the URL | ||
|
|
@@ -360,13 +363,9 @@ internal HttpRequestMessage CreateHttpRequest(HttpContent content) | |
| /// it records. | ||
| /// </para> | ||
| /// <para> | ||
| /// Two behaviors still follow this option, whether or not <see cref="ConfigureDataCollection()"/> has been called: | ||
| /// <list type="bullet"> | ||
| /// <item>The machine name is sent as <see cref="ServerName"/> only when this option is <c>true</c>. Set | ||
| /// <see cref="ServerName"/> explicitly to keep sending it without this option.</item> | ||
| /// <item><c>Sentry.OpenTelemetry</c>'s <c>AddSentry</c> sets the user from the HTTP request only when this option | ||
| /// is <c>true</c>.</item> | ||
| /// </list> | ||
| /// <c>Sentry.OpenTelemetry</c>'s <c>AddSentry</c> still follows this option after | ||
| /// <see cref="ConfigureDataCollection()"/> has been called: it sets the user from the HTTP request only when this | ||
| /// option is <c>true</c>. | ||
| /// </para> | ||
| /// </remarks> | ||
| [Obsolete(ObsoleteSendDefaultPii)] | ||
|
|
@@ -437,12 +436,24 @@ public void ConfigureDataCollection(Action<DataCollectionOptions> configure) | |
| /// Gets or sets the name of the server running the application. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// When <see cref="SendDefaultPii"/> is set to <c>true</c>, <see cref="System.Environment.MachineName"/> is | ||
| /// automatically set as ServerName. This property can serve as an override. | ||
| /// This is relevant only to server applications. | ||
| /// Takes precedence over the machine name sent by <see cref="AttachServerName"/>. | ||
| /// </remarks> | ||
| public string? ServerName { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Whether to send <see cref="System.Environment.MachineName"/> as the <see cref="ServerName"/> when that isn't set. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// The default is <c>false</c> on Android, iOS and Mac Catalyst, where the machine name is the name of the user's | ||
| /// device, and <c>true</c> elsewhere. Until <see cref="ConfigureDataCollection()"/> is called, events and logs only | ||
| /// include it when <see cref="SendDefaultPii"/> is also <c>true</c>, except for events in ASP.NET and ASP.NET Core. | ||
| /// </remarks> | ||
| #if __MOBILE__ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Heads-up for #6066: the macOS SDK doesn't define |
||
| public bool AttachServerName { get; set; } | ||
| #else | ||
| public bool AttachServerName { get; set; } = true; | ||
| #endif | ||
|
|
||
| /// <summary> | ||
| /// Whether to send the stack trace of a event captured without an exception. | ||
| /// As of version 3.22.0, the default is <c>true</c>. | ||
|
|
||
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.