mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-09-21 13:12:24 +00:00
Fix Grafana tempo and observability config (#1161)
* Add database and queue observability * Update prometheus * Delete the wrong changes * Fix Grafana tempo and observability config
This commit is contained in:
@@ -9,17 +9,14 @@ from opentelemetry.instrumentation.celery import CeleryInstrumentor
|
||||
|
||||
from backend.app.task.tasks.beat import LOCAL_BEAT_SCHEDULE
|
||||
from backend.common.enums import DataBaseType
|
||||
from backend.common.observability.otel import init_resource, init_tracer
|
||||
from backend.core.conf import settings
|
||||
from backend.core.path_conf import BASE_PATH
|
||||
|
||||
|
||||
@worker_process_init.connect(weak=False)
|
||||
def init_celery_worker_tracing(*args, **kwargs) -> None:
|
||||
def init_celery_tracing(*args, **kwargs) -> None:
|
||||
"""初始化 Celery 追踪"""
|
||||
if settings.GRAFANA_METRICS_ENABLE:
|
||||
resource = init_resource('fba_celery_worker')
|
||||
init_tracer(resource)
|
||||
CeleryInstrumentor().instrument()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user