Skip to content
Snippets Groups Projects
Commit 88c78662 authored by Georg Krause's avatar Georg Krause
Browse files

feat(Logging): Add Sentry SDK to report errors at the backend

parent cb525e8f
No related branches found
No related tags found
No related merge requests found
Pipeline #22720 failed with stages
in 49 minutes and 26 seconds
...@@ -17,6 +17,20 @@ APPS_DIR = ROOT_DIR.path("funkwhale_api") ...@@ -17,6 +17,20 @@ APPS_DIR = ROOT_DIR.path("funkwhale_api")
env = environ.Env() env = environ.Env()
ENV = env ENV = env
LOGLEVEL = env("LOGLEVEL", default="info").upper() LOGLEVEL = env("LOGLEVEL", default="info").upper()
if env("FUNKWHALE_SENTRY_DSN", default=None) is not None:
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
sentry_sdk.init(
dsn=env("FUNKWHALE_SENTRY_DSN"),
integrations=[DjangoIntegration()],
traces_sample_rate=env("FUNKWHALE_SENTRY_SR", default="1.0"),
send_default_pii=False,
environment="api",
)
""" """
Default logging level for the Funkwhale processes Default logging level for the Funkwhale processes
......
This diff is collapsed.
...@@ -58,6 +58,7 @@ uvicorn = {version = "==0.18.2", extras = ["standard"]} ...@@ -58,6 +58,7 @@ uvicorn = {version = "==0.18.2", extras = ["standard"]}
django-cache-memoize = "0.1.10" django-cache-memoize = "0.1.10"
requests-http-message-signatures = "==0.3.1" requests-http-message-signatures = "==0.3.1"
drf-spectacular = "==0.23.1" drf-spectacular = "==0.23.1"
sentry-sdk = "==1.8.0"
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]
flake8 = "==3.9.2" flake8 = "==3.9.2"
......
Add Sentry SDK to collect errors at the backend
...@@ -197,3 +197,7 @@ AWS_STORAGE_BUCKET_NAME= ...@@ -197,3 +197,7 @@ AWS_STORAGE_BUCKET_NAME=
# Available options can be found here: https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl # Available options can be found here: https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl
# AWS_DEFAULT_ACL= # AWS_DEFAULT_ACL=
# Funkwhale allows collecting errors using Sentry compatible APIs. If you want
# to help us improving Funkwhale, feel free to use our instance:
#FUNKWHALE_SENTRY_DSN=https://5840197379c64f65aad3c5c09274994d@am.funkwhale.audio/1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment