Skip to content

Commit

Permalink
Merge pull request #21 from TogetherCrew/setup-traceloop
Browse files Browse the repository at this point in the history
feat: trying traceloop without pointing to endpoint!
  • Loading branch information
cyri113 authored Jan 22, 2024
2 parents 5fdfda4 + 3f6363c commit cbdaa4a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 0 additions & 8 deletions celery_app/server.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import os

from celery import Celery
from dotenv import load_dotenv
from traceloop.sdk import Traceloop
from utils.credentials import load_rabbitmq_credentials

rabbit_creds = load_rabbitmq_credentials()
Expand All @@ -11,9 +7,5 @@
host = rabbit_creds["host"]
port = rabbit_creds["port"]

load_dotenv()
otel_endpoint = os.getenv("TRACELOOP_BASE_URL")
Traceloop.init(api_endpoint=otel_endpoint, app_name="hivemind-server")

app = Celery("celery_app/tasks", broker=f"pyamqp://{user}:{password}@{host}:{port}//")
app.autodiscover_tasks(["celery_app"])
3 changes: 3 additions & 0 deletions celery_app/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
)
from tc_messageBroker.rabbit_mq.payload.payload import Payload
from tc_messageBroker.rabbit_mq.queue import Queue
from traceloop.sdk import Traceloop


@app.task
Expand All @@ -40,6 +41,8 @@ def ask_question_auto_search(
- `date`
- `content`: which is the `ChatInputCommandInteraction` as a dictionary
"""
Traceloop.init(app_name="hivemind-server")

prefix = f"COMMUNITY_ID: {community_id} | "
logging.info(f"{prefix}Processing question!")

Expand Down

0 comments on commit cbdaa4a

Please sign in to comment.