문제

How to add custom tags to get raven set it to sentry?

When I used raven in django there was several tags like OS, Browser, etc.

But I want to add such tags by myself using raven, without django.

Thanks.

도움이 되었습니까?

해결책

If I'm correctly understanding the question, you can pass to sentry whatever you want in extra dictionary, see raven docs.

You can also construct messages via capture* methods (and pass extra too):

Btw, OS, browser...etc parameters sentry gets from the passed request object.

다른 팁

It's quite easy. Just use Client.capture

from raven import Client
client = Client("https://<key>:<secret>@sentry.io/<project>")
client.capture("raven.events.Message", message='foo_bar', data={
    'tags': {
        'tag_name': "tag_value"
    }
})
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top