Skip to content

Commit

Permalink
another try
Browse files Browse the repository at this point in the history
Signed-off-by: sallyom <[email protected]>
  • Loading branch information
sallyom committed Jun 23, 2024
1 parent 1f0f1f9 commit b1b6bb0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test-trace-steps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ jobs:
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.103.0/otelcol-contrib_0.103.0_linux_amd64.tar.gz
tar -xvf otelcol-contrib_0.103.0_linux_amd64.tar.gz
- name: CA secret to 1-line
- name: CA to file
env:
ROSA_OTEL_CABUNDLE: ${{ secrets.ROSA_OTEL_CABUNDLE }}
run: |
echo "$ROSA_OTEL_CABUNDLE" > /tmp/ca.crt
ls -al /tmp/ca.crt
cat /tmp/ca.crt
- name: Configure OpenTelemetry Collector
run: |
Expand Down
7 changes: 5 additions & 2 deletions ci/trace-steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,20 @@
tracer = trace.get_tracer(__name__)

# Set up OTLP exporter to send to OpenTelemetry Collector
otlp_exporter = OTLPSpanExporter(endpoint="0.0.0.0:4317", insecure=True)
otlp_exporter = OTLPSpanExporter(endpoint="http://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 start_trace(step_name):
return tracer.start_span(name=step_name)
span = tracer.start_span(name=step_name)
print(f"Started span: {span.get_span_context().trace_id}")
return span

def end_trace(span):
print(f"Ending span: {span.get_span_context().trace_id}")
span.end()

if __name__ == "__main__":
Expand Down

0 comments on commit b1b6bb0

Please sign in to comment.