generated from arcus-azure/arcus.github.template
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: generate request telemetry id (#252)
* feat: generate request telemetry id * pr-fix: add unit tests for generate request id * pr-fix: missing ')' * pr-sug: add xml exception docs * Update docs/preview/02-Features/sinks/azure-application-insights.md Co-authored-by: Frederik Gheysels <[email protected]> * Update docs/preview/02-Features/sinks/azure-application-insights.md Co-authored-by: Frederik Gheysels <[email protected]> Co-authored-by: Frederik Gheysels <[email protected]>
- Loading branch information
1 parent
af6f4bd
commit f364a3a
Showing
9 changed files
with
498 additions
and
59 deletions.
There are no files selected for viewing
This file contains 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 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
28 changes: 28 additions & 0 deletions
28
....Serilog.Sinks.ApplicationInsights/Configuration/ApplicationInsightsSinkRequestOptions.cs
This file contains 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using GuardNet; | ||
|
||
namespace Arcus.Observability.Telemetry.Serilog.Sinks.ApplicationInsights.Configuration | ||
{ | ||
/// <summary> | ||
/// User-defined configuration options to influence the behavior of the Azure Application Insights Serilog sink while tracking requests. | ||
/// </summary> | ||
public class ApplicationInsightsSinkRequestOptions | ||
{ | ||
private Func<string> _generatedId = Guid.NewGuid().ToString; | ||
|
||
/// <summary> | ||
/// <para>Gets or sets the function to generate the request ID of the telemetry model while tracking requests.</para> | ||
/// <para>Default: GUID generation.</para> | ||
/// </summary> | ||
/// <exception cref="ArgumentNullException">Thrown when the <paramref name="value"/> is <c>null</c>.</exception> | ||
public Func<string> GenerateId | ||
{ | ||
get => _generatedId; | ||
set | ||
{ | ||
Guard.NotNull(value, nameof(value), "Requires a function to generate the request ID of the telemetry model while tracking requests"); | ||
_generatedId = value; | ||
} | ||
} | ||
} | ||
} |
This file contains 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 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 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.