Skip to content

Commit 720a9af

Browse files
resolved review comment
1 parent 1e2ee1a commit 720a9af

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,26 @@
6464
)
6565
from call_processing.constants.filler_phrases import FILLER_PHRASES
6666

67-
# Step 1: Initialize OpenTelemetry with your chosen exporter
68-
exporter = OTLPSpanExporter(
69-
endpoint=os.getenv('CALL_PROCESSING_OTLP_ENDPOINT', 'http://localhost:4317'),
70-
insecure=True,
71-
)
72-
73-
setup_tracing(
74-
service_name=os.getenv('CALL_PROCESSING_TRACING_SERVICE_NAME', 'call-processing'),
75-
exporter=exporter,
76-
console_export=False, # Set to True for debug output
77-
)
78-
7967
ENABLE_TRACING = os.getenv('CALL_PROCESSING_ENABLE_TRACING', 'true').lower() == 'true'
8068
ENABLE_TURN_TRACKING = (
8169
os.getenv('CALL_PROCESSING_ENABLE_TURN_TRACKING', 'true').lower() == 'true'
8270
)
8371

72+
OTLP_ENDPOINT = os.getenv('CALL_PROCESSING_OTLP_ENDPOINT')
73+
74+
if ENABLE_TRACING and OTLP_ENDPOINT:
75+
exporter = OTLPSpanExporter(
76+
endpoint=OTLP_ENDPOINT,
77+
insecure=True,
78+
)
79+
setup_tracing(
80+
service_name=os.getenv(
81+
'CALL_PROCESSING_TRACING_SERVICE_NAME', 'call-processing'
82+
),
83+
exporter=exporter,
84+
console_export=False,
85+
)
86+
8487

8588
class STTLanguageSwitcher(ParallelPipeline):
8689
"""

0 commit comments

Comments
 (0)