Skip to content

Commit

Permalink
opentelemetry: add consumer and producer
Browse files Browse the repository at this point in the history
  • Loading branch information
naisanzaa committed Mar 27, 2024
1 parent 7e5dadb commit 2200bf6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions automon/integrations/openTelemetryWrapper/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ async def is_ready(self):
async def get_finished_spans(self):
return await self.config.get_finished_spans()

async def start_consumer(self):
"""adds spans from memory to queue"""
while True:
pass
return

async def start_producer(self):
""""""
while True:
pass
return

async def to_dict(self):
return [
json.loads(span.to_json())
Expand Down
5 changes: 5 additions & 0 deletions automon/integrations/openTelemetryWrapper/config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import asyncio

from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
Expand All @@ -20,6 +22,9 @@ def __init__(self):

self.tracer = trace.get_tracer(__name__)

self.queue_consumer = asyncio.Queue()
self.queue_producer = asyncio.Queue()

async def clear(self):
return self.memory_processor.clear()

Expand Down

0 comments on commit 2200bf6

Please sign in to comment.