Add Sentry DSN to .env.example and use computer name as environment
This commit is contained in:
@ -20,3 +20,7 @@ LOG_LEVEL=INFO
|
||||
# https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks
|
||||
# Right click channel in Discord -> Intergrations -> Webhooks -> Create Webhook.
|
||||
WEBHOOK_URL=https://discord.com/api/webhooks/582696524044304394/a3CMwZWchmHAXItB_lzSSRYBx0-AlPAHseJWqhHLfsAg_X4erac9-CeVeUDqPI1ac1vT
|
||||
|
||||
# Custom Sentry DSN for error tracking.
|
||||
# https://docs.sentry.io/concepts/key-terms/dsn-explainer/
|
||||
# SENTRY_DSN=
|
||||
|
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -5,6 +5,7 @@
|
||||
"asctime",
|
||||
"asyncio",
|
||||
"audioop",
|
||||
"autouse",
|
||||
"botuser",
|
||||
"cookiejar",
|
||||
"dateparser",
|
||||
|
@ -3,6 +3,8 @@ from __future__ import annotations
|
||||
import asyncio
|
||||
import datetime
|
||||
import json
|
||||
import os
|
||||
import platform
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Any
|
||||
@ -29,8 +31,10 @@ if TYPE_CHECKING:
|
||||
from discord_reminder_bot import settings
|
||||
|
||||
|
||||
default_sentry_dsn: str = "https://c4c61a52838be9b5042144420fba5aaa@o4505228040339456.ingest.us.sentry.io/4508707268984832"
|
||||
sentry_sdk.init(
|
||||
dsn="https://c4c61a52838be9b5042144420fba5aaa@o4505228040339456.ingest.us.sentry.io/4508707268984832",
|
||||
dsn=os.getenv("SENTRY_DSN", default_sentry_dsn),
|
||||
environment=platform.node() or "Unknown",
|
||||
traces_sample_rate=1.0,
|
||||
send_default_pii=True,
|
||||
)
|
||||
|
8
tests/conftest.py
Normal file
8
tests/conftest.py
Normal file
@ -0,0 +1,8 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
|
||||
|
||||
def pytest_configure() -> None:
|
||||
"""Ignore Sentry when running tests."""
|
||||
os.environ["SENTRY_DSN"] = ""
|
Reference in New Issue
Block a user