Skip to content

[Bug]: Customizing the severity of telemetry events has no effect: PipelineExecuted, PipelineExecuting #2750

@miko96

Description

@miko96

According to the documentation there is an ability to customize severity of telemetry events:

https://www.pollydocs.org/advanced/telemetry.html#customizing-the-severity-of-telemetry-events

telemetryOptions.SeverityProvider = args => args.Event.EventName switch
{
// Decrease severity of specific events
"PipelineExecuted" => ResilienceEventSeverity.None,
"PipelineExecuting" => ResilienceEventSeverity.None,
_ => args.Event.Severity
};

The problem is that overridden severity level has no effect for the events "PipelineExecuted", "PipelineExecuting".

var level = severity.AsLogLevel();
if (GetArgs<TArgs, PipelineExecutingArguments>(args.Arguments, out _))
{
_logger.PipelineExecuting(
args.Source.PipelineName.GetValueOrPlaceholder(),
args.Source.PipelineInstanceName.GetValueOrPlaceholder(),
args.Context.OperationKey);
}
else if (GetArgs<TArgs, PipelineExecutedArguments>(args.Arguments, out var pipelineExecuted))
{
_logger.PipelineExecuted(
LogLevel.Debug,
args.Source.PipelineName.GetValueOrPlaceholder(),
args.Source.PipelineInstanceName.GetValueOrPlaceholder(),
args.Context.OperationKey,
GetResult(args.Context, args.Outcome),
pipelineExecuted.Duration.TotalMilliseconds,
args.Outcome?.Exception);
}

Expected behavior

No response

Actual behavior

No response

Steps to reproduce

No response

Exception(s) (if any)

No response

Polly version

No response

.NET Version

No response

Anything else?

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions