-
Notifications
You must be signed in to change notification settings - Fork 70
feat: Make ambient Activity tracing opt-in and enhance mapping config
#237
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
Merged
nblumhardt
merged 18 commits into
serilog-contrib:dev
from
hangy:serilog-tracing-support
Dec 24, 2025
Merged
Changes from 12 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c00d3f9
feat: Enhance telemetry with operation context properties
hangy fc1ba91
Remove unnecessary TraceId/SpanId from log event properties
hangy f7af03d
feat: Add operation name to log events using Activity context
hangy 9317b9b
refactor: Simplify sink configuration by removing unnecessary wrapper
hangy 7a3f125
fix: Don't set `OperationNameProperty` from inside the `ApplicationIn…
hangy 3db4866
feat: Add ActivityOperationNameEnricher to enrich log events with cur…
hangy 0722bae
feat: Add ActivityBaggageEnricher to enrich log events with Activity …
hangy e3d6e29
feat: Forward Activity Baggage to telemetry properties in TelemetryCo…
hangy 4140676
feat: Add enrichment extensions for operation name and baggage in Log…
hangy 2dd05c3
feat: Enhance telemetry with operation name and baggage in tests
hangy cc11781
feat: Add support for optionally including operation ID, parent span …
hangy 06a7e22
feat: Update README to enhance configuration instructions and add new…
hangy efaa9c6
refactor: Use pattern matching
hangy 18ebe29
perf: Use `Enum.GetName` instead of `.ToString()`
hangy ad2bb9e
style: dotnet_style_require_accessibility_modifiers = omit_if_default
hangy eea7447
feat: Support different casing of `OperationId`
hangy 49f1403
feat: Consolidate operation name and baggage enrichment into a single…
hangy 95f9e4f
feat: Add support for case-insensitive property name lookups in telem…
hangy 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
31 changes: 31 additions & 0 deletions
31
src/Serilog.Sinks.ApplicationInsights/LoggerEnrichmentConfigurationExtensions.cs
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 |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // SPDX-FileCopyrightText: 2025 Serilog Contributors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| using System.Diagnostics; | ||
| using Serilog.Configuration; | ||
| using Serilog.Sinks.ApplicationInsights.Enrichers; | ||
|
|
||
| namespace Serilog; | ||
|
|
||
| /// <summary> | ||
| /// Provides enrichment extensions to <see cref="LoggerConfiguration" />. | ||
| /// </summary> | ||
| public static class LoggerEnrichmentConfigurationExtensions | ||
| { | ||
| extension(LoggerEnrichmentConfiguration loggerEnrichmentConfiguration) | ||
| { | ||
| /// <summary> | ||
| /// Enriches log events with the operation name from <see cref="Activity" />. | ||
| /// </summary> | ||
| /// <returns>Logger configuration, allowing configuration to continue.</returns> | ||
| public LoggerConfiguration WithOperationName() | ||
| => loggerEnrichmentConfiguration.With<ActivityOperationNameEnricher>(); | ||
|
|
||
| /// <summary> | ||
| /// Enriches log events with the baggage from <see cref="Activity" />. | ||
| /// </summary> | ||
| /// <returns>Logger configuration, allowing configuration to continue.</returns> | ||
| public LoggerConfiguration WithBaggage() | ||
| => loggerEnrichmentConfiguration.With<ActivityBaggageEnricher>(); | ||
| } | ||
| } |
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.