-
Notifications
You must be signed in to change notification settings - Fork 867
Closed
Labels
enhancementNew feature or requestNew feature or requestlogsLogging signal relatedLogging signal related
Milestone
Description
I want to prevent logs from being sent to Azure.Monitor. Based on the filtering processor example, I created:
open System.Diagnostics
open OpenTelemetry
open OpenTelemetry.Logs
/// Remove Heartbeat from Host.Results
type HeartbeatLogFilter() =
inherit BaseProcessor<LogRecord>()
override _.OnEnd log =
if log.CategoryName = "Host.Results" then
let fullName =
log.StateValues |> Seq.tryPick(fun kv ->
if kv.Key = "FullName" then
Some kv.Value
else
None
)
if fullName = Some "Heartbeat" then
log.TraceFlags <- log.TraceFlags &&& ~~~ ActivityTraceFlags.RecordedIt removes ActivityTraceFlags.Recorded from the LogRecord.TraceFlags.
Expected behavior
I was expecting the log records with ActivityTraceFlags.Recorded removed to not be exported to Azure Monitor.
Actual behavior
The log records still end up in Azure Monitor.
cijothomas, TimothyMothra, cocowalla and L-Sypniewski
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestlogsLogging signal relatedLogging signal related