Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Add sentry context #47

Open
stefanprokopdev opened this issue Aug 5, 2020 · 2 comments
Open

Add sentry context #47

stefanprokopdev opened this issue Aug 5, 2020 · 2 comments
Assignees

Comments

@stefanprokopdev
Copy link

Can we add sentry capture context to the logger options?

{
    user: User;
    level: Severity;
    extra: {
        [key: string]: any;
    };
    contexts: {
        [key: string]: any;
    };
    tags: {
        [key: string]: string;
    };
    fingerprint: string[];
}

I would like to add tags for each message and then create an alert rule for some tags and send email notification. It would be nice if these options can be sent with message for example logger.error({ data, error }, "Message", { tags: {test: "testTag"} })

@smolijar
Copy link
Contributor

smolijar commented Aug 6, 2020

Then this would not be a part of logger options, but of each logged entry non? This would require either changing the API that is inherited from pino, or adding some reserved fields to message. Which of the two options is more desirable @stefan-prokop-cz @vlasy?

@stefanprokopdev
Copy link
Author

Well i think its not necessary to have sentry options as a part of each logged entry. Its ok for me to have sentry options as part of logger options.

My use case: add sentry tag to one concrete log entry - it would be nice to add this tag to the specific log entry instead of create a new logger instance .. but i dont care

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants