Skip to content

Merge pull request #6 from jomardyan/codex/create-webapi-folder-and-i… #17

Merge pull request #6 from jomardyan/codex/create-webapi-folder-and-i…

Merge pull request #6 from jomardyan/codex/create-webapi-folder-and-i… #17

name: Example - Distributed Tracing
on:
push:
branches:
- main
- develop
workflow_dispatch:
# NOTE: Configure these secrets in your repository settings:
# - OTEL_COLLECTOR_URL: Your OpenTelemetry collector endpoint URL
jobs:
trace-integration:
runs-on: ubuntu-latest
name: Traced Background Job
steps:
- name: 'Checkout code'
uses: actions/checkout@v3
- name: 'Set up OpenTelemetry endpoint'
id: otel-config
env:
OTEL_URL: ${{ secrets.OTEL_COLLECTOR_URL }}
run: echo "OTEL_URL=${OTEL_URL}" >> $GITHUB_OUTPUT
- name: 'Run traced job'
uses: ./.github/actions/python-script-runner
with:
script-path: './services/background_worker.py'
python-version: '3.11'
timeout-minutes: 60
max-retries: 2
enable-tracing: true
extra-dependencies: |
opentelemetry-api
opentelemetry-sdk
opentelemetry-exporter-jaeger
env:
OTEL_EXPORTER_OTLP_ENDPOINT: ${{ steps.otel-config.outputs.OTEL_URL }}
OTEL_SERVICE_NAME: 'python-script-runner'
- name: 'Check trace upload'
if: always()
run: |
echo "Trace data should be visible in your collector at:"
echo "${{ steps.otel-config.outputs.OTEL_URL }}"