Open peterdudfield opened 5 months ago
@braddf I've put this here, as other people might be able to contribute to this
Ive tested the above code in the india-forecast-app, so it can be rolled out to other repos now
hello, can I be assigned to this issue?
@peterdudfield can I have more info about the sentry_sdk version repos need?
what do you mean version?
https://github.com/openclimatefix/india-forecast-app/pull/75/files this is a good example of what would be great to do to the other repos
for GSPConumer - https://github.com/openclimatefix/GSPConsumer/pull/76
Here's a good example - https://github.com/openclimatefix/uk-pvnet-app/pull/125
A nice simple way to do this is (this should be put in the main app)
import sentry_sdk
import os
sentry_sdk.init(
dsn=os.getenv("SENTRY_DSN", ""),
environment=f'{os.getenv("ENVIRONMENT", "local")}',
traces_sample_rate=1.0,
profiles_sample_rate=1.0,
)
sentry_sdk.set_tag("app_name", APP_NAME)
sentry_sdk.set_tag("version", VERSION)
Currently deployed on uk-pvnet-app on development, but errors not showing up in sentry. Weird
Detailed Description
It would be great to have sentry logs in all back end components
Context
Possible Implementation
SImilar to the api
https://github.com/openclimatefix/pv-site-api/blob/main/pv_site_api/main.py#L89C1-L93C2
this bit of code needs to sit at the start of the main app, and
sentry_sdk
be added to the requirements file