FlaskIntegration / AwsLambdaIntegration version 0.6.2 has incorrect url and transaction tags
See original GitHub issue_Originally posted by @untitaker in https://github.com/getsentry/sentry-python/issues/190#issuecomment-446722477_
After upgrading to 0.6.2 tags in our event stream are not accurate. Specifically the url and transaction tag.
For example if an exception occurs at http://www.example.com/path/1234 the url tag in our stream is showing as http://www.example.com. Furthermore the transaction tag, which we expect to be /path/1234 is registering as the name of our AWS lambda function.
We instantiate the SDK as follows:
sentry_sdk.init(
dsn=os.environ.get('SENTRY_DSN'),
environment=os.environ.get('FLASK_ENV', 'development'),
integrations=[FlaskIntegration(transaction_style='url'), AwsLambdaIntegration()]
)
Reverting to 0.5.5 solves the issue, I have not tried to apply the Zappa patch https://github.com/Miserlou/Zappa/issues/1723
It might be worth mentioning that we initialize the SDK in a common __init__.py
file and import the sentry_sdk file in files that require it. Perhaps when sentry is initially created it is yet to know about the flask app?
__init__.py
sentry_sdk.init(
dsn=os.environ.get('SENTRY_DSN'),
environment=os.environ.get('FLASK_ENV', 'development'),
integrations=[FlaskIntegration(transaction_style='url'), AwsLambdaIntegration()]
)
def create_app(name, config=None):
pass
someapp.py
from apps import create_app
import sentry_sdk
app = create_app(__name__)
def exception_handler(e, event, context):
sentry_sdk.capture_exception()
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (6 by maintainers)
@untitaker, yes release 0.6.4 seems to resolve issues for us. Thanks
@iteratelance yes I believe that setting the transaction to random user input is not great (and since this is a 404 the raw URL would be truly arbitrary).