-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add log filtering processor distro (#41665)
* draft * fix pooling issue * file header * clean up * Add test * rmv using * refactor * log * rmv unused * fix test * changelog * feedback * refactor * fix test * Update Packages.Data.props --------- Co-authored-by: Timothy Mothra <[email protected]>
- Loading branch information
1 parent
e72e285
commit 5e2352c
Showing
5 changed files
with
109 additions
and
1 deletion.
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
24 changes: 24 additions & 0 deletions
24
sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LogFilteringProcessor.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,24 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using OpenTelemetry.Logs; | ||
using OpenTelemetry; | ||
|
||
namespace Azure.Monitor.OpenTelemetry.AspNetCore | ||
{ | ||
internal class LogFilteringProcessor : BatchLogRecordExportProcessor | ||
{ | ||
public LogFilteringProcessor(BaseExporter<LogRecord> exporter) | ||
: base(exporter) | ||
{ | ||
} | ||
|
||
public override void OnEnd(LogRecord logRecord) | ||
{ | ||
if (logRecord.SpanId == default || logRecord.TraceFlags == ActivityTraceFlags.Recorded) | ||
{ | ||
base.OnEnd(logRecord); | ||
} | ||
} | ||
} | ||
} |
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