From 0ee064277930414f1a3192273215c61ce0c7a528 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Mon, 22 Jan 2024 12:57:56 +0330 Subject: [PATCH 1/2] feat: added otel endpoint! --- celery_app/tasks.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/celery_app/tasks.py b/celery_app/tasks.py index 71c366b..1854a60 100644 --- a/celery_app/tasks.py +++ b/celery_app/tasks.py @@ -1,5 +1,7 @@ import json import logging +import os +from dotenv import load_dotenv from typing import Any from celery_app.server import app @@ -41,7 +43,9 @@ def ask_question_auto_search( - `date` - `content`: which is the `ChatInputCommandInteraction` as a dictionary """ - Traceloop.init() + load_dotenv() + otel_endpoint = os.getenv("TRACELOOP_BASE_URL") + Traceloop.init(api_endpoint=otel_endpoint, app_name="Hivemind-server") prefix = f"COMMUNITY_ID: {community_id} | " logging.info(f"{prefix}Processing question!") From d32151cda2c9fc8118583e0657195fdaf7b7bac8 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Mon, 22 Jan 2024 13:03:30 +0330 Subject: [PATCH 2/2] fix: isort linter issue! --- celery_app/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/celery_app/tasks.py b/celery_app/tasks.py index 1854a60..b32e1c3 100644 --- a/celery_app/tasks.py +++ b/celery_app/tasks.py @@ -1,11 +1,11 @@ import json import logging import os -from dotenv import load_dotenv from typing import Any from celery_app.server import app from celery_app.utils.fire_event import job_send +from dotenv import load_dotenv from subquery import query_multiple_source from tc_messageBroker.rabbit_mq.event import Event from tc_messageBroker.rabbit_mq.payload.discord_bot.base_types.interaction_callback_data import (