From 54dec65979cbcb05e039f7ef9f71080a3530a5f2 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Mon, 11 Dec 2023 10:04:13 -0600 Subject: [PATCH] Display Python SDK version (#1035) * Fix display of opentelemetry-sdk for Python Fixes #1034 * Address comments --- .github/workflows/release-layer-python.yml | 25 ++++++++++++------- .../src/otel/otel_sdk/requirements-nodeps.txt | 1 - python/src/otel/otel_sdk/requirements.txt | 1 + 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-layer-python.yml b/.github/workflows/release-layer-python.yml index a68e874ed3..679ffdeb70 100644 --- a/.github/workflows/release-layer-python.yml +++ b/.github/workflows/release-layer-python.yml @@ -14,7 +14,7 @@ jobs: build-layer: runs-on: ubuntu-latest outputs: - PYTHON_SDK_VERSION: ${{ steps.save-python-sdk-version.outputs.PYTHON_SDK_VERSION}} + PYTHON_OPENTELEMETRY_SDK_VERSION: ${{ steps.save-python-opentelemetry-sdk-version.outputs.PYTHON_OPENTELEMETRY_SDK_VERSION}} steps: - uses: actions/checkout@v4 @@ -22,10 +22,23 @@ jobs: with: python-version: '3.9' + - name: Save PYTHON_OPENTELEMETRY_SDK_VERSION + id: save-python-opentelemetry-sdk-version + run: | + cd python/src + echo "PYTHON_OPENTELEMETRY_SDK_VERSION=$(cat otel/otel_sdk/requirements.txt | grep opentelemetry-sdk | sed 's/.*==\([^ ]*\).*/\1/')" >> $GITHUB_ENV + echo "PYTHON_OPENTELEMETRY_SDK_VERSION=$PYTHON_OPENTELEMETRY_SDK_VERSION" >> $GITHUB_OUTPUT + shell: bash + + - name: Display PYTHON_OPENTELEMETRY_SDK_VERSION + run: | + echo "PYTHON_OPENTELEMETRY_SDK_VERSION=${{ env.PYTHON_OPENTELEMETRY_SDK_VERSION }}" + shell: bash + - name: Build run: | cd python/src - PYTHON_SDK_VERSION=$(./build.sh 2>&1 > /dev/null | sed -n "s/opentelemetry-sdk==\(.*\)/\1/p") + ./build.sh shell: bash - name: Show directory contents @@ -33,11 +46,6 @@ jobs: ls -al working-directory: python/src/build - - name: Save Python SDK Version - id: save-python-sdk-version - run: | - echo "PYTHON_SDK_VERSION=$PYTHON_SDK_VERSION" >> $GITHUB_OUTPUT - - uses: actions/upload-artifact@v3 name: Save assembled layer to build with: @@ -69,8 +77,7 @@ jobs: with: artifact-name: opentelemetry-python-layer.zip layer-name: opentelemetry-python - component-version: ${{needs.build-layer.outputs.PYTHON_SDK_VERSION}} - # architecture: + component-version: ${{needs.build-layer.outputs.PYTHON_OPENTELEMETRY_SDK_VERSION}} release-group: prod aws_region: ${{ matrix.aws_region }} secrets: inherit diff --git a/python/src/otel/otel_sdk/requirements-nodeps.txt b/python/src/otel/otel_sdk/requirements-nodeps.txt index ccd62a9b6b..7c8b2214b1 100644 --- a/python/src/otel/otel_sdk/requirements-nodeps.txt +++ b/python/src/otel/otel_sdk/requirements-nodeps.txt @@ -27,4 +27,3 @@ opentelemetry-instrumentation-sqlite3==0.42b0 opentelemetry-instrumentation-starlette==0.42b0 opentelemetry-instrumentation-tornado==0.42b0 opentelemetry-instrumentation-wsgi==0.42b0 - diff --git a/python/src/otel/otel_sdk/requirements.txt b/python/src/otel/otel_sdk/requirements.txt index 5fd65153e9..f8eef1c9fb 100644 --- a/python/src/otel/otel_sdk/requirements.txt +++ b/python/src/otel/otel_sdk/requirements.txt @@ -1,3 +1,4 @@ +opentelemetry-sdk==1.21.0 opentelemetry-exporter-otlp-proto-http==1.21.0 opentelemetry-distro==0.42b0 opentelemetry-instrumentation-aws-lambda==0.42b0