Sentry_sdk not sending errors to Sentry when invoked from Docker

I have a flask application in which i initialised sentry, when i try to invoke flask server locally and trigger an exception, the issue will be sent to sentry.
If i try to place my flask application in docker container and if i try to trigger the exception then the issue is not there in sentry