Skip to content

Commit

Permalink
Add logfire
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartmaxwell committed Nov 29, 2024
1 parent 158c2bd commit aa133f2
Show file tree
Hide file tree
Showing 4 changed files with 296 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path

import environ
import logfire
import sentry_sdk
from django.contrib.messages import constants as messages
from sentry_sdk.integrations.django import DjangoIntegration
Expand Down Expand Up @@ -38,6 +39,7 @@
CONTACT_FORM_TO=(str, ""),
CONTACT_FORM_FROM=(str, ""),
DEBUGGING_APP_PATH=(str, "this-is-just-a-temporary-debugging-app-path"),
LOGFIRE_ENVIRONMENT=(str, "dev"),
)

environ.Env.read_env(Path(BASE_DIR / ".env"))
Expand Down Expand Up @@ -311,3 +313,8 @@

# Debugging app
DEBUGGING_APP_PATH = env("DEBUGGING_APP_PATH")

# Logfire
LOGFIRE_ENVIRONMENT = env("LOGFIRE_ENVIRONMENT")
logfire.configure(environment=LOGFIRE_ENVIRONMENT)
logfire.instrument_django()
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ services:
- "RESEND_API_KEY=${RESEND_API_KEY}"
- "CONTACT_FORM_TO=${CONTACT_FORM_TO}"
- "CONTACT_FORM_FROM=${CONTACT_FORM_FROM}"
- "DEBUGGING_APP_PATH=${DEBUGGING_APP_PATH}"
- "LOGFIRE_ENVIRONMENT=${LOGFIRE_ENVIRONMENT}"
- "LOGFIRE_TOKEN=${LOGFIRE_TOKEN}"
volumes:
- app_db:/app/db

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies = [
"httpx>=0.27.2",
"uvicorn>=0.32.1",
"uvicorn-worker>=0.2.0",
"logfire[asgi,django]>=2.5.0",
]

[tool.curlylint.rules]
Expand Down
Loading

0 comments on commit aa133f2

Please sign in to comment.