mirror of
https://github.com/katanemo/plano.git
synced 2026-06-17 15:25:17 +02:00
fix tracing
This commit is contained in:
parent
7c8205abc2
commit
295fd85525
6 changed files with 14 additions and 10 deletions
|
|
@ -28,5 +28,6 @@ COPY arch/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|||
COPY arch/stream_traces.py .
|
||||
|
||||
RUN pip install requests
|
||||
RUN touch /var/log/envoy.log
|
||||
|
||||
ENTRYPOINT ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
||||
|
|
|
|||
|
|
@ -21,3 +21,4 @@ services:
|
|||
environment:
|
||||
- OPENAI_API_KEY=${OPENAI_API_KEY:?error}
|
||||
- MISTRAL_API_KEY=${MISTRAL_API_KEY:?error}
|
||||
- OTEL_TRACING_HTTP_ENDPOINT=http://host.docker.internal:4318/v1/traces
|
||||
|
|
|
|||
|
|
@ -16,3 +16,4 @@ services:
|
|||
environment:
|
||||
- OPENAI_API_KEY=${OPENAI_API_KEY:?error}
|
||||
- MISTRAL_API_KEY=${MISTRAL_API_KEY:?error}
|
||||
- OTEL_TRACING_HTTP_ENDPOINT=http://host.docker.internal:4318/v1/traces
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ services:
|
|||
- ~/archgw_logs:/var/log/
|
||||
env_file:
|
||||
- env.list
|
||||
environment:
|
||||
- OTEL_TRACING_HTTP_ENDPOINT=http://host.docker.internal:4318/v1/traces
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
healthcheck:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
import sys
|
||||
import time
|
||||
import requests
|
||||
import logging
|
||||
|
|
@ -29,12 +30,10 @@ def process_log_line(line):
|
|||
logging.error(f"Failed to send trace to otel-tracing: {e}")
|
||||
|
||||
|
||||
with open(envoy_log_path, "r") as f:
|
||||
while True:
|
||||
line = f.readline()
|
||||
if not line:
|
||||
time.sleep(1)
|
||||
continue
|
||||
tokens = line.split("gateway: upstream_llm trace details: ")
|
||||
if len(tokens) > 1:
|
||||
process_log_line(tokens[1])
|
||||
for line in sys.stdin:
|
||||
if not line:
|
||||
time.sleep(1)
|
||||
continue
|
||||
tokens = line.split("gateway: upstream_llm trace details: ")
|
||||
if len(tokens) > 1:
|
||||
process_log_line(tokens[1])
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
nodaemon=true
|
||||
|
||||
[program:trace_streamer]
|
||||
command=python stream_traces.py
|
||||
command=sh -c "tail -F /var/log/envoy.log | python stream_traces.py"
|
||||
autostart=true
|
||||
autorestart=false
|
||||
startretries=3
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue