raven-python-lambda icon indicating copy to clipboard operation
raven-python-lambda copied to clipboard

Adding extra context?

Open stickystyle opened this issue 7 years ago • 2 comments

I'm trying to add some extra context to my client, but nothing is ever populating (yes, there are values that match the keys in event). The doc's say that Client is a singleton so I assumed what I have below would work...but it's not. Am I missing something obvious here?

from raven import Client
from raven_python_lambda import RavenLambdaWrapper


@RavenLambdaWrapper()
def handler(event, context):
    client = Client()
    client.extra_context({'src_key': event.get('src_key'),
                          'mapping': event.get('mapping'),
                          'prefix': event.get('s3prefix'),
                          'message_id': event.get('message_id')
                          })
...

stickystyle avatar Nov 01 '17 19:11 stickystyle

Bit of a long shot, but did you ever resolve/workaround this @stickystyle ?

Edit: After looking into it I'm going to migrate to using latest version of sentry-sdk and utilise https://docs.sentry.io/platforms/python/aws_lambda/ after a bit of initial config.

JoeAlamo avatar Apr 17 '20 15:04 JoeAlamo

@JoeAlamo Yes, for me after upgrading to sentry-sdk I've been able to add the extra context to my client.

stickystyle avatar Apr 24 '20 13:04 stickystyle