diff --git a/.github/workflows/chatbot.yaml b/.github/workflows/chatbot.yaml index 5036d5de..4a67983b 100644 --- a/.github/workflows/chatbot.yaml +++ b/.github/workflows/chatbot.yaml @@ -56,6 +56,8 @@ jobs: protocols: grpc: endpoint: "0.0.0.0:4317" + http: + endpoint: "0.0.0.0:4318" exporters: otlphttp: endpoint: https://apps.platform-sts.pcbk.p1.openshiftapps.com @@ -65,7 +67,7 @@ jobs: key_pem: ${{ secrets.CLIENT_KEY_ROSA_OTEL }} ca_pem: ${{ secrets.SERVER_CERT_ROSA_OTEL }} logging: - loglevel: debug + verbosity: detailed service: pipelines: traces: diff --git a/.github/workflows/test-trace-steps.yaml b/.github/workflows/test-trace-steps.yaml index 011893dc..b5a688c2 100644 --- a/.github/workflows/test-trace-steps.yaml +++ b/.github/workflows/test-trace-steps.yaml @@ -36,6 +36,8 @@ jobs: protocols: grpc: endpoint: "0.0.0.0:4317" + http: + endpoint: "0.0.0.0:4318" exporters: otlphttp: endpoint: https://apps.platform-sts.pcbk.p1.openshiftapps.com @@ -45,7 +47,7 @@ jobs: key_pem: ${{ secrets.CLIENT_KEY_ROSA_OTEL }} ca_pem: ${{ secrets.SERVER_CERT_ROSA_OTEL }} logging: - loglevel: debug + verbosity: detailed service: pipelines: traces: diff --git a/.github/workflows/testing_framework.yaml b/.github/workflows/testing_framework.yaml index 5bcc3a30..55b795d5 100644 --- a/.github/workflows/testing_framework.yaml +++ b/.github/workflows/testing_framework.yaml @@ -4,7 +4,7 @@ on: schedule: # schedule the job to run once a day - cron: '0 0 * * *' - workflow_dispatch: + #workflow_dispatch: # pull_request: ## temporary for debugging development purposes # branches: @@ -65,6 +65,8 @@ jobs: protocols: grpc: endpoint: "0.0.0.0:4317" + http: + endpoint: "0.0.0.0:4318" exporters: otlphttp: endpoint: https://apps.platform-sts.pcbk.p1.openshiftapps.com @@ -74,7 +76,7 @@ jobs: key_pem: ${{ secrets.CLIENT_KEY_ROSA_OTEL }} ca_pem: ${{ secrets.SERVER_CERT_ROSA_OTEL }} logging: - loglevel: debug + verbosity: detailed service: pipelines: traces: diff --git a/ci/trace-steps.py b/ci/trace-steps.py index 19e51eae..3e654df5 100644 --- a/ci/trace-steps.py +++ b/ci/trace-steps.py @@ -1,6 +1,4 @@ import os -import time -import logging from opentelemetry import trace from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter from opentelemetry.sdk.resources import Resource @@ -8,10 +6,6 @@ from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter from opentelemetry.trace import SpanContext, TraceFlags, TraceState, NonRecordingSpan -# Set up logging -logging.basicConfig(level=logging.INFO) -logger = logging.getLogger(__name__) - # Set up OpenTelemetry tracing trace.set_tracer_provider( TracerProvider( @@ -21,30 +15,15 @@ tracer = trace.get_tracer(__name__) # Set up OTLP exporter to send to OpenTelemetry Collector -otlp_exporter = OTLPSpanExporter(endpoint="http://localhost:4317", insecure=True) - -# Set up span processor -span_processor = BatchSpanProcessor(otlp_exporter) -trace.get_tracer_provider().add_span_processor(span_processor) +otlp_exporter = OTLPSpanExporter(endpoint="0.0.0.0:4317", insecure=True) +trace.get_tracer_provider().add_span_processor(BatchSpanProcessor(otlp_exporter)) # Export to console for debugging console_exporter = ConsoleSpanExporter() trace.get_tracer_provider().add_span_processor(BatchSpanProcessor(console_exporter)) -def retry_operation(operation, retries=3, delay=5): - for attempt in range(retries): - try: - return operation() - except Exception as e: - logger.error(f"Attempt {attempt + 1} failed with error: {e}") - if attempt < retries - 1: - time.sleep(delay) - else: - raise - def start_trace(step_name): - span = tracer.start_span(name=step_name) - return span + return tracer.start_span(name=step_name) def end_trace(span): span.end() @@ -54,7 +33,7 @@ def end_trace(span): action = os.getenv("TRACE_ACTION", "start") if action == "start": - span = retry_operation(lambda: start_trace(step_name)) + span = start_trace(step_name) with open(f"/tmp/trace_{step_name}.txt", "w") as f: f.write(str(span.get_span_context().trace_id)) elif action == "end": @@ -71,6 +50,6 @@ def end_trace(span): is_remote=True ) with tracer.start_as_current_span(name=step_name, context=trace.set_span_in_context(NonRecordingSpan(span_context))): - span = retry_operation(lambda: tracer.start_span(name=step_name)) - retry_operation(lambda: end_trace(span)) + span = start_trace(step_name) + end_trace(span)