Skip to content

Add an ability to set tags from logger metadataΒ #827

@icehaunter

Description

@icehaunter

I believe Sentry.LoggerHandler would benefit from the option to set Sentry tags based on the log metadata as opposed to using it only as extra context.

We have a multi-tenant application, where there is a supervision sub-tree per tenant. Each process already correctly tracks their belonging to a tenant using Logger.metadata calls, and this tenant ID would be extremely useful to have as a Sentry tag for filtering and grouping. I understand the option of using set_tags_context/1, but I would rather avoid code duplication given we already set that metadata field, and LoggerHandler already reads those metadata keys correctly.

I think allowing something like tags: metadata_keys() option would be enough to cover this use-case.

Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions