Skip to content

Commit

Permalink
remove top-level span. one span per job
Browse files Browse the repository at this point in the history
  • Loading branch information
msarahan committed Oct 17, 2024
1 parent 8d5473a commit 8410ebb
Showing 1 changed file with 15 additions and 66 deletions.
81 changes: 15 additions & 66 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,23 @@ env:
OTEL_EXPORTER_OTLP_CLIENT_KEY: "/tmp/certs/client.key"
OTEL_EXPORTER_OTLP_PROTOCOL: "http/protobuf"
OTEL_EXPORTER_OTLP_HEADERS: ${{ secrets.OTEL_EXPORTER_OTLP_HEADERS }}
OTEL_RESOURCE_ATTRIBUTES: "github.repository=${{github.repository}},github.ref=${{github.ref}},github.job_link=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }},github.sha=${{github.sha}}"

jobs:
telemetry-setup:
runs-on: ubuntu-latest
outputs:
start_time: ${{ steps.timestamp.outputs.START_TIME }}
traceparent: ${{ steps.telemetry-setup.outputs.traceparent }}
endpoint: ${{ steps.var-reexports.outputs.endpoint }}
top_level_service_name: ${{ steps.var-reexports.outputs.service_name }}
resource_attributes: ${{ steps.var-reexports.outputs.resource_attributes }}
steps:
- name: Get starting timestamp
id: timestamp
run:
echo "START_TIME=$(date +%s.%N)" >> ${GITHUB_OUTPUT}
- name: Echo endpoint to make it available to shared workflows
# https://stackoverflow.com/questions/73305126/passing-env-variable-inputs-to-a-reusable-workflow
id: var-reexports
run: |
echo endpoint="${OTEL_EXPORTER_OTLP_ENDPOINT}" >> ${GITHUB_OUTPUT}
echo service_name="${OTEL_SERVICE_NAME}" >> ${GITHUB_OUTPUT}
- name: Write certificate files for mTLS
run: |
mkdir -p /tmp/certs
cat << EOF > "${OTEL_EXPORTER_OTLP_CERTIFICATE}"
${{ secrets.OTEL_EXPORTER_OTLP_CA_CERTIFICATE }}
EOF
cat << EOF > "${OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE}"
${{ secrets.OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE }}
EOF
cat << EOF > "${OTEL_EXPORTER_OTLP_CLIENT_KEY}"
${{ secrets.OTEL_EXPORTER_OTLP_CLIENT_KEY }}
EOF
- name: Telemetry setup
id: telemetry-setup
uses: rapidsai/shared-actions/telemetry-traceparent@add-telemetry
- name: Start root span
uses: rapidsai/shared-actions/telemetry-create-span@add-telemetry
with:
name: "root span"
traceparent: ${{steps.telemetry-setup.outputs.traceparent}}
start_time: ${{steps.timestamp.outputs.start_time}}
echo resource_attributes="${OTEL_RESOURCE_ATTRIBUTES}" >> ${GITHUB_OUTPUT}
pr-builder:
needs:
- changed-files
Expand All @@ -87,7 +64,7 @@ jobs:
uses: rapidsai/shared-workflows/.github/workflows/changed-files.yaml@add-telemetry
with:
default_endpoint: "${{needs.telemetry-setup.outputs.endpoint}}"
traceparent: ${{ needs.telemetry-setup.outputs.traceparent }}
resource_attributes: "${{needs.telemetry-setup.outputs.resource_attributes}}"
files_yaml: |
test_cpp:
- '**'
Expand All @@ -111,8 +88,7 @@ jobs:
with:
enable_check_generated_files: false
default_endpoint: "${{needs.telemetry-setup.outputs.endpoint}}"
traceparent: ${{ needs.telemetry-setup.outputs.traceparent }}
ignored_pr_jobs: "final_span_update"
resource_attributes: "${{needs.telemetry-setup.outputs.resource_attributes}}"
conda-cpp-build:
needs:
- telemetry-setup
Expand All @@ -122,7 +98,7 @@ jobs:
with:
build_type: pull-request
default_endpoint: "${{needs.telemetry-setup.outputs.endpoint}}"
traceparent: ${{ needs.telemetry-setup.outputs.traceparent }}
resource_attributes: "${{needs.telemetry-setup.outputs.resource_attributes}}"
conda-cpp-tests:
needs: [conda-cpp-build, changed-files, telemetry-setup]
secrets: inherit
Expand All @@ -131,7 +107,7 @@ jobs:
with:
build_type: pull-request
default_endpoint: "${{needs.telemetry-setup.outputs.endpoint}}"
traceparent: ${{ needs.telemetry-setup.outputs.traceparent }}
resource_attributes: "${{needs.telemetry-setup.outputs.resource_attributes}}"
conda-python-build:
needs:
- conda-cpp-build
Expand All @@ -141,7 +117,7 @@ jobs:
with:
build_type: pull-request
default_endpoint: "${{needs.telemetry-setup.outputs.endpoint}}"
traceparent: ${{ needs.telemetry-setup.outputs.traceparent }}
resource_attributes: "${{needs.telemetry-setup.outputs.resource_attributes}}"
conda-python-tests:
needs: [conda-python-build, changed-files, telemetry-setup]
secrets: inherit
Expand All @@ -150,7 +126,7 @@ jobs:
with:
build_type: pull-request
default_endpoint: "${{needs.telemetry-setup.outputs.endpoint}}"
traceparent: ${{ needs.telemetry-setup.outputs.traceparent }}
resource_attributes: "${{needs.telemetry-setup.outputs.resource_attributes}}"
docs-build:
needs:
- conda-python-build
Expand All @@ -164,7 +140,7 @@ jobs:
container_image: "rapidsai/ci-conda:latest"
run_script: "ci/build_docs.sh"
default_endpoint: "${{needs.telemetry-setup.outputs.endpoint}}"
traceparent: ${{ needs.telemetry-setup.outputs.traceparent }}
resource_attributes: "${{needs.telemetry-setup.outputs.resource_attributes}}"
wheel-build-cpp:
needs:
- checks
Expand All @@ -176,7 +152,7 @@ jobs:
build_type: pull-request
script: ci/build_wheel_cpp.sh
default_endpoint: "${{needs.telemetry-setup.outputs.endpoint}}"
traceparent: ${{ needs.telemetry-setup.outputs.traceparent }}
resource_attributes: "${{needs.telemetry-setup.outputs.resource_attributes}}"
wheel-build-python:
needs:
- wheel-build-cpp
Expand All @@ -187,7 +163,7 @@ jobs:
build_type: pull-request
script: ci/build_wheel_python.sh
default_endpoint: "${{needs.telemetry-setup.outputs.endpoint}}"
traceparent: ${{ needs.telemetry-setup.outputs.traceparent }}
resource_attributes: "${{needs.telemetry-setup.outputs.resource_attributes}}"
wheel-tests:
needs: [wheel-build-python, changed-files, telemetry-setup]
secrets: inherit
Expand All @@ -197,7 +173,7 @@ jobs:
build_type: pull-request
script: ci/test_wheel.sh
default_endpoint: "${{needs.telemetry-setup.outputs.endpoint}}"
traceparent: ${{ needs.telemetry-setup.outputs.traceparent }}
resource_attributes: "${{needs.telemetry-setup.outputs.resource_attributes}}"
devcontainer:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/build-in-devcontainer.yaml@add-telemetry
Expand All @@ -207,35 +183,8 @@ jobs:
arch: '["amd64"]'
cuda: '["12.5"]'
default_endpoint: "${{needs.telemetry-setup.outputs.endpoint}}"
traceparent: ${{ needs.telemetry-setup.outputs.traceparent }}
resource_attributes: "${{needs.telemetry-setup.outputs.resource_attributes}}"
build_command: |
sccache -z;
build-all -DBUILD_BENCHMARKS=ON --verbose;
sccache -s;
final_span_update:
runs-on: ubuntu-latest
needs: [pr-builder, telemetry-setup]
steps:
- name: Get final timestamp
id: timestamp
run:
echo "FINAL_TIME=$(date +%s.%N)" >> ${GITHUB_OUTPUT}
- name: Write certificate files for mTLS
run: |
mkdir -p /tmp/certs
cat << EOF > ${OTEL_EXPORTER_OTLP_CERTIFICATE}
${{ secrets.OTEL_EXPORTER_OTLP_CA_CERTIFICATE }}
EOF
cat << EOF > ${OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE}
${{ secrets.OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE }}
EOF
cat << EOF > ${OTEL_EXPORTER_OTLP_CLIENT_KEY}
${{ secrets.OTEL_EXPORTER_OTLP_CLIENT_KEY }}
EOF
- name: Update root span with final completion time
if: always()
uses: rapidsai/shared-actions/telemetry-create-span@add-telemetry
with:
traceparent: ${{needs.telemetry-setup.outputs.traceparent}}
start_time: ${{needs.telemetry-setup.outputs.start_time}}
end_time: ${{steps.timestamp.outputs.FINAL_TIME}}

0 comments on commit 8410ebb

Please sign in to comment.