Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ namespace Microsoft.Extensions.Diagnostics.ExceptionSummarization;
/// Metric tags typically support a limited number of distinct values, and as such they are not suitable
/// to represent values which are highly variable, such as the result of <see cref="Exception.ToString"/>.
/// An exception summary represents a low-cardinality version of an exception's information, suitable for such
/// cases. The summary never includes sensitive information.
/// cases.
///
/// The <see cref="ExceptionSummary.Description"/> property never include sensitive information.
/// But the <see cref="ExceptionSummary.AdditionalDetails"/> property might contain sensitive information and should thus not be used in telemetry.
/// </remarks>
public readonly struct ExceptionSummary : IEquatable<ExceptionSummary>
{
Expand Down Expand Up @@ -42,14 +45,18 @@ public ExceptionSummary(string exceptionType, string description, string additio
/// <summary>
/// Gets the summary description of the exception.
/// </summary>
/// <remarks>
/// This is a low cardinality string suitable for use as a metric dimension, and it is guaranteed not to
/// contain privacy-sensitive information.
/// </remarks>
public string Description { get; }

/// <summary>
/// Gets the additional details of the exception.
/// </summary>
/// <remarks>
/// This string can have a relatively high cardinality and is therefore not suitable as a metric dimension. It
/// is primarily intended for use in low-level diagnostics.
/// This string can have a relatively high cardinality and may contain privacy-sensitive information and is therefore not suitable
/// as a metric dimension. It is primarily intended for use in low-level diagnostics.
/// </remarks>
public string AdditionalDetails { get; }

Expand All @@ -66,6 +73,9 @@ public override int GetHashCode() => HashCode.Combine(
/// Gets a string representation of this object.
/// </summary>
/// <returns>A string representing this object.</returns>
/// <remarks>
/// The string returned by this call is not suitable to be used in telemetry as it may contain privacy-sensitive information.
/// </remarks>
public override string ToString()
{
return AdditionalDetails.Length == 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface IExceptionSummaryProvider
/// Provides the index of the description for the exception along with optional additional data.
/// </summary>
/// <param name="exception">The exception.</param>
/// <param name="additionalDetails">The additional details of the given exception, if any.</param>
/// <param name="additionalDetails">The additional details of the given exception, if any. Ideally, this string should not contain any privacy-sensitive information.</param>
/// <returns>The index of the description.</returns>
/// <remarks>
/// This method should only get invoked with an exception which is type compatible with a type
Expand Down