feat(sentry): added on celery

This commit is contained in:
Stan Girard 2023-12-06 12:20:41 +01:00
parent 828b39a77a
commit 5619f2e602
2 changed files with 12 additions and 3 deletions

View File

@ -2,6 +2,7 @@ import asyncio
import io
import os
import sentry_sdk
from celery import Celery
from celery.schedules import crontab
from fastapi import UploadFile
@ -16,6 +17,14 @@ from packages.files.crawl.crawler import CrawlWebsite
from packages.files.parsers.github import process_github
from packages.files.processors import filter_file
sentry_dsn = os.getenv("SENTRY_DSN")
if sentry_dsn:
sentry_sdk.init(
dsn=sentry_dsn,
sample_rate=0.1,
enable_tracing=True,
)
CELERY_BROKER_URL = os.getenv("CELERY_BROKER_URL", "")
CELERY_BROKER_QUEUE_NAME = os.getenv("CELERY_BROKER_QUEUE_NAME", "quivr")

View File

@ -71,7 +71,7 @@ services:
- .env
build:
context: backend
dockerfile: Dockerfile.dev
dockerfile: Dockerfile
container_name: worker
command: celery -A celery_worker worker -l info
restart: always
@ -86,7 +86,7 @@ services:
- .env
build:
context: backend
dockerfile: Dockerfile.dev
dockerfile: Dockerfile
container_name: beat
command: celery -A celery_worker beat -l info
restart: always
@ -100,7 +100,7 @@ services:
- .env
build:
context: backend
dockerfile: Dockerfile.dev
dockerfile: Dockerfile
container_name: flower
command: celery -A celery_worker flower -l info --port=5555
restart: always