sentry-python
sentry-python copied to clipboard
APIError(Missing required attribute in authentication header: sentry_secret) when capture Exception in ThreadPoolExecutor
I want to capture exceptions from a python grpc server where running in a ThreadPoolExecutor
server = grpc.server(futures.ThreadPoolExecutor(max_workers=grpc_workers))
Then i initialized sentry before the grpc server running
if __name__ == '__main__':
sentry_sdk.init(config.GRPC_SENTRY_DSN)
serve()
The when exceptions occured in grpc calls,
"ERROR:sentry.errors:Sentry responded with an API error: APIError(Missing required attribute in authentication header: sentry_secret)" appeared.
While if I use sentry_sdk.capture_message() in main thread, everything is ok.
I find there is a sentry instance in another file with different DSN which is got from environment variable not set