Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enabling tracing for amqp server! #94

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: enabling tracing for amqp server!
amindadgar committed Nov 12, 2024

Verified

This commit was signed with the committer’s verified signature.
amindadgar Mohammad Amin Dadgar
commit f740b2d5b91b0bf23b4baff42c82bed5699a21da
8 changes: 2 additions & 6 deletions routers/amqp.py
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
from tc_messageBroker.rabbit_mq.event import Event
from tc_messageBroker.rabbit_mq.queue import Queue
from utils.credentials import load_rabbitmq_credentials
from utils.traceloop import init_tracing
from utils.persist_payload import PersistPayload
from worker.tasks import query_data_sources
from worker.utils.fire_event import job_send
@@ -29,7 +30,7 @@ async def ask(payload: Payload, logger: Logger):
try:
question = payload.content.question.message
community_id = payload.content.communityId

init_tracing()
logger.info(f"COMMUNITY_ID: {community_id} Received job")
response = query_data_sources(community_id=community_id, query=question)
logger.info(f"COMMUNITY_ID: {community_id} Job finished")
@@ -45,11 +46,6 @@ async def ask(payload: Payload, logger: Logger):
persister = PersistPayload()
persister.persist_amqp(response_payload)

# result = Payload(
# event=payload.content.route.destination.event,
# date=str(datetime.now()),
# content=response_payload.model_dump(),
# )
job_send(
event=payload.content.route.destination.event,
queue_name=payload.content.route.destination.queue,