Skip to content

Enhancement: Allow configuring after_exception for OpenTelemetryPlugin #4472

@vikigenius

Description

@vikigenius

Summary

allow configuring the after_exception handler for the otel plugin so that it can be added to the application level after_exception handler.

Basic Example

Add this field to the config class

after_exception: list[Callable[[Exception, Scope], Awaitable[None]]] = field(default_factory=list)

The plugin can do

app_config.after_exception.extend(self.config.after_exception)

Drawbacks and Impact

Allows doing things like recording exception on the current span

Unresolved questions

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementThis is a new feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions