-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure Sentry_SDK #35
base: ccloud
Are you sure you want to change the base?
Conversation
66998ed
to
339dcf3
Compare
The sentry raven library is long deprecated. The python sentry SDK replaces this library. To get the same behaviour as with raven (only enable the logging with selected loggers via the Handlers), one has to initialise the SDK but manually configure the Logging integration and set the default levels to None. Avoiding the sentry configuration in each SAPCC upstream based project (e.g. Neutron or Nova) and furthermore in each driver, this has is part of the loci build process. During the build a .pth and .py file will be placed in the site_package path. Within this path, an executable line in a .pth file is run at every Python startup. In our case, a script configuring sentry if the env variable SENTRY_USE_SDK is set. As requirements sentry-sdk must be installed. Co-authored-by: Florian Streibelt <[email protected]>
339dcf3
to
5074cea
Compare
I got some input from Seba yesterday, I think two things would make sense to add to the
This would prevent sentry getting enabled with every python process on the target which could otherwise send random logs to sentry, or interfere with debugging maybe. We however need to check if there are some "hidden" At the same time we could easily modify the list without building a new image, allowing us to add or remove scripts. That should come in handy when other services like nova want to test that approach. update: added as extra commit. |
Moved the ssentry.py to a file in a subdirectory, so it can be editied in an editor using syntax highlighting, formatting and autopep
allow filtering based on argv[0] to enable only for specific commands
changing the prefix of the variables to clearly distinguish between the namespace sentry is using and our own variables.
Configure Sentry_SDK
The sentry raven library is long deprecated. The python sentry SDK replaces this library.
To get the same behaviour as with raven (only enable the logging with selected loggers via the Handlers), one has to initialise the SDK but manually configure the Logging integration and set the default levels to None.
Avoiding the sentry configuration in each SAPCC upstream based project (e.g. Neutron or Nova) and furthermore
in each driver, this has is part of the loci build process. During the build a .pth and .py file will be placed in the
site_package path. Within this path, an executable line in a .pth file is run at every Python startup.
In our case, a script configuring sentry if the env variable SENTRY_USE_SDK is
set. As requirements sentry-sdk must be installed.