diff --git a/.github/workflows/build_publish_lambda_layer.yaml b/.github/workflows/build_publish_lambda_layer.yaml index 31bb917d4..6739015a5 100644 --- a/.github/workflows/build_publish_lambda_layer.yaml +++ b/.github/workflows/build_publish_lambda_layer.yaml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-minor: ["9", "10", "11", "12", "13"] + python-minor: ["10", "11", "12", "13"] apm-env: ["lambda"] steps: - uses: actions/checkout@v6 @@ -80,6 +80,6 @@ jobs: with: artifact-name: solarwinds_apm_lambda.zip component-version: ${{ needs.get_apm_python_version.outputs.sw-apm-version }} - runtimes: "python3.9 python3.10 python3.11 python3.12 python3.13" + runtimes: "python3.10 python3.11 python3.12 python3.13" publish-dest: ${{ inputs.publish-dest }} secrets: inherit \ No newline at end of file diff --git a/.github/workflows/run_tox_lint_format.yaml b/.github/workflows/run_tox_lint_format.yaml index 462cd4c95..4188519ad 100644 --- a/.github/workflows/run_tox_lint_format.yaml +++ b/.github/workflows/run_tox_lint_format.yaml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-minor: ["9", "10", "11", "12", "13"] + python-minor: ["10", "11", "12", "13"] steps: - uses: actions/checkout@v6 - name: Setup Python diff --git a/.github/workflows/run_tox_ruff_format.yaml b/.github/workflows/run_tox_ruff_format.yaml index d53b43b09..aa360a639 100644 --- a/.github/workflows/run_tox_ruff_format.yaml +++ b/.github/workflows/run_tox_ruff_format.yaml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-minor: ["9", "10", "11", "12", "13"] + python-minor: ["10", "11", "12", "13"] steps: - uses: actions/checkout@v6 - name: Setup Python diff --git a/.github/workflows/run_tox_tests.yaml b/.github/workflows/run_tox_tests.yaml index 3d62c8401..452435605 100644 --- a/.github/workflows/run_tox_tests.yaml +++ b/.github/workflows/run_tox_tests.yaml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-minor: ["9", "10", "11", "12", "13"] + python-minor: ["10", "11", "12", "13"] apm-env: ["test"] steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/verify_install.yaml b/.github/workflows/verify_install.yaml index 1df73edd6..2e98e18a9 100644 --- a/.github/workflows/verify_install.yaml +++ b/.github/workflows/verify_install.yaml @@ -46,17 +46,9 @@ jobs: strategy: matrix: hostname: - - py3.9-alpine3.13 - - py3.9-alpine3.16 - - py3.9-alpine3.17 - - py3.9-centos8 - - py3.9-debian10 - - py3.9-debian11 - - py3.9-rhel8 - py3.10-alpine3.13 - py3.10-alpine3.16 - py3.10-alpine3.17 - - py3.10-amazon2023 - py3.10-debian10 - py3.10-debian11 - py3.10-ubuntu22.04 @@ -78,28 +70,12 @@ jobs: - x64 - arm64 include: - - hostname: py3.9-alpine3.13 - image: python:3.9-alpine3.13 - - hostname: py3.9-alpine3.16 - image: python:3.9-alpine3.16 - - hostname: py3.9-alpine3.17 - image: python:3.9-alpine3.17 - - hostname: py3.9-centos8 - image: centos:8 - - hostname: py3.9-debian10 - image: python:3.9-buster - - hostname: py3.9-debian11 - image: python:3.9-bullseye - - hostname: py3.9-rhel8 - image: registry.fedoraproject.org/f33/python3 - hostname: py3.10-alpine3.13 image: python:3.10-alpine3.13 - hostname: py3.10-alpine3.16 image: python:3.10-alpine3.16 - hostname: py3.10-alpine3.17 image: python:3.10-alpine3.17 - - hostname: py3.10-amazon2023 - image: amazonlinux:2023 - hostname: py3.10-debian10 image: python:3.10-buster - hostname: py3.10-debian11 @@ -136,12 +112,6 @@ jobs: image: python:3.13-alpine3.20 exclude: # Note: JavaScript Actions (checkout) in Alpine only supported in x64 - - hostname: py3.9-alpine3.13 - arch: arm64 - - hostname: py3.9-alpine3.16 - arch: arm64 - - hostname: py3.9-alpine3.17 - arch: arm64 - hostname: py3.10-alpine3.13 arch: arm64 - hostname: py3.10-alpine3.16 @@ -171,12 +141,17 @@ jobs: steps: - if: contains(matrix.image, 'amazonlinux') || contains(matrix.image, 'aws-lambda-python') name: Install AmazonLinux deps to use checkout - run: dnf install -y tar gzip + run: | + if command -v dnf >/dev/null 2>&1; then + dnf install -y tar gzip + else + yum install -y tar gzip + fi # Use checkout@v4 for Alpine versions < 3.17 that don't support Node.js 24 - if: contains(matrix.hostname, 'alpine3.13') || contains(matrix.hostname, 'alpine3.14') || contains(matrix.hostname, 'alpine3.15') || contains(matrix.hostname, 'alpine3.16') uses: actions/checkout@v4 # Else use latest checkout - - if: ${{ !(contains(matrix.hostname, 'alpine3.13') || contains(matrix.hostname, 'alpine3.14') || contains(matrix.hostname, 'alpine3.15') || contains(matrix.hostname, 'alpine3.16')) }} + - if: ${{ !(contains(matrix.hostname, 'alpine3.13') || contains(matrix.hostname, 'alpine3.14') || contains(matrix.hostname, 'alpine3.15') || contains(matrix.hostname, 'alpine3.16') || contains(matrix.hostname, 'amazon2-')) }} uses: actions/checkout@v6 - name: Setup and run install test working-directory: ./tests/docker/install @@ -184,3 +159,30 @@ jobs: shell: sh env: MODE: ${{ github.event.inputs.install-registry }} + + # Amazon Linux 2 (Python 3.10) - uses docker run instead of container job to avoid GLIBC 2.26 issues + install-tests-amazon2: + runs-on: ${{ contains(matrix.image, 'arm64') && fromJSON('{"group":"apm-arm-runner"}') || 'ubuntu-latest' }} + strategy: + matrix: + image: + - amazon/aws-lambda-python:3.10-arm64 + - amazon/aws-lambda-python:3.10-x86_64 + steps: + - uses: actions/checkout@v6 + - name: Run install test in Amazon Linux 2 container + run: | + docker run --rm \ + --entrypoint sh \ + -v $GITHUB_WORKSPACE:/code/python-solarwinds \ + -w /code/python-solarwinds/tests/docker/install \ + -e MODE="${{ github.event.inputs.install-registry }}" \ + -e PYTHON_VERSION="3.10" \ + -e SOLARWINDS_APM_VERSION="${{ github.event.inputs.solarwinds-version }}" \ + -e SW_APM_COLLECTOR_PROD="${{ secrets.SW_APM_COLLECTOR_PROD }}" \ + -e SW_APM_COLLECTOR_STAGING="${{ secrets.SW_APM_COLLECTOR_STAGING }}" \ + -e SW_APM_SERVICE_KEY_PROD="${{ secrets.SW_APM_SERVICE_KEY_PROD }}" \ + -e SW_APM_SERVICE_KEY_STAGING="${{ secrets.SW_APM_SERVICE_KEY_STAGING }}" \ + -e APM_ROOT=/code/python-solarwinds \ + ${{ matrix.image }} \ + -c "set -x && ./_helper_run_install_tests.sh" diff --git a/.github/workflows/verify_install_macos.yaml b/.github/workflows/verify_install_macos.yaml index 873e14258..bf3a176c3 100644 --- a/.github/workflows/verify_install_macos.yaml +++ b/.github/workflows/verify_install_macos.yaml @@ -45,7 +45,6 @@ jobs: strategy: matrix: python-version: - - "3.9" - "3.10" - "3.11" - "3.12" diff --git a/.github/workflows/verify_install_windows.yaml b/.github/workflows/verify_install_windows.yaml index 5700c6200..0f6adfb66 100644 --- a/.github/workflows/verify_install_windows.yaml +++ b/.github/workflows/verify_install_windows.yaml @@ -45,7 +45,6 @@ jobs: strategy: matrix: python-version: - - "3.9" - "3.10" - "3.11" - "3.12" diff --git a/Makefile b/Makefile index 6c08f38cd..1c4f2b09e 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ check-zip: # Create package source distribution archive sdist: @echo -e "Generating python agent sdist package" - @python3.9 -m build --sdist + @python3.10 -m build --sdist @echo -e "\nDone." # Check local package source distribution archive contents, without install @@ -48,10 +48,10 @@ check-sdist-local: @cd ./tests/docker/install && MODE=local APM_ROOT=$(CURR_DIR) ./_helper_check_sdist.sh @cd $(CURR_DIR) -# Build the Python library package bdist (wheel) for 64 bit linux systems using Python 3.9 +# Build the Python library package bdist (wheel) for 64 bit linux systems using Python 3.10 wheel: @echo -e "Generating Python library wheel for 64 bit systems" - @/opt/python/cp39-cp39/bin/pip -v wheel . -w ./dist/ --no-deps + @/opt/python/cp310-cp310/bin/pip -v wheel . -w ./dist/ --no-deps @echo -e "\nDone." # Check local package wheel contents, without install @@ -72,13 +72,13 @@ install-lambda-modules: @echo -e "Creating target directory ${target_dir} for AWS Lambda layer artifacts." mkdir -p ${target_dir}/python @echo -e "Install setuptools" - /opt/python/cp39-cp39/bin/pip install setuptools + /opt/python/cp310-cp310/bin/pip install setuptools @echo -e "Install upstream dependencies to include in layer" - /opt/python/cp39-cp39/bin/pip install -t ${target_dir}/python -r lambda/requirements.txt + /opt/python/cp310-cp310/bin/pip install -t ${target_dir}/python -r lambda/requirements.txt @echo -e "Install upstream dependencies without deps to include in layer" - @/opt/python/cp39-cp39/bin/pip install -t ${target_dir}/nodeps -r lambda/requirements-nodeps.txt --no-deps + @/opt/python/cp310-cp310/bin/pip install -t ${target_dir}/nodeps -r lambda/requirements-nodeps.txt --no-deps @echo -e "Install solarwinds_apm to be packed up in zip archive to target directory." - @/opt/python/cp39-cp39/bin/pip install . -t ${target_dir}/nodeps --no-deps + @/opt/python/cp310-cp310/bin/pip install . -t ${target_dir}/nodeps --no-deps @echo -e "Moving no-deps dependencies, needed for full opentelemetry/instrumentation path" @cp -r ${target_dir}/nodeps/* ${target_dir}/python @rm -rf ${target_dir}/nodeps @@ -110,10 +110,10 @@ aws-lambda: check-zip install-lambda-modules check-lambda-modules # variable definitions and recipes for testing, linting, cleanup #----------------------------------------------------------------------------------------------------------------------# -# Example: make tox OPTIONS="-e py39-test" +# Example: make tox OPTIONS="-e py310-test" # Example: make tox OPTIONS="-e lint -- --check-only" tox: - @python3.9 -m tox $(OPTIONS) + @python3.10 -m tox $(OPTIONS) format: @echo -e "Not implemented." diff --git a/dev-requirements.txt b/dev-requirements.txt index d6d3aa658..2a429d85c 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,10 +1,9 @@ -opentelemetry-test-utils==0.62b1 -opentelemetry-instrumentation-flask==0.62b1 -opentelemetry-instrumentation-requests==0.62b1 +opentelemetry-test-utils==0.63b1 +opentelemetry-instrumentation-flask==0.63b1 +opentelemetry-instrumentation-requests==0.63b1 pytest pytest-cov pytest-mock requests -flask~=3.1; python_version >= '3.9' -flask~=3.0; python_version < '3.9' +flask~=3.1 werkzeug \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index f730a6b60..d51ddf9ed 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,8 +24,8 @@ services: # boto3 for interaction with AWS # twine to upload to TestPyPi # tox for automated tests - python3.9 -m pip install --upgrade pip - python3.9 -m pip install --default-timeout=100 build boto3 twine tox + python3.10 -m pip install --upgrade pip + python3.10 -m pip install --default-timeout=100 build boto3 twine tox /bin/bash aarch64: @@ -45,6 +45,6 @@ services: # boto3 for interaction with AWS # twine to upload to TestPyPi # tox for automated tests - python3.9 -m pip install --upgrade pip - python3.9 -m pip install --default-timeout=100 build boto3 twine tox + python3.10 -m pip install --upgrade pip + python3.10 -m pip install --default-timeout=100 build boto3 twine tox /bin/bash diff --git a/image/Dockerfile b/image/Dockerfile index 2e1a60e84..c3e37ba3c 100644 --- a/image/Dockerfile +++ b/image/Dockerfile @@ -10,7 +10,7 @@ # - For auto-instrumentation by container injection, the Linux command cp is # used and must be availabe in the image. -FROM python:3.9 AS build-39 +FROM python:3.10 AS build-310 WORKDIR /operator-build ADD requirements-nodeps.txt . ADD requirements.txt . @@ -18,7 +18,7 @@ RUN mkdir workspace RUN pip install --no-deps --target workspace -r requirements-nodeps.txt RUN pip install --target workspace -r requirements.txt -FROM python:3.9-alpine AS build-musl-39 +FROM python:3.10-alpine AS build-musl-310 WORKDIR /operator-build ADD requirements-nodeps.txt . ADD requirements.txt . @@ -29,8 +29,8 @@ RUN pip install --target workspace -r requirements.txt FROM busybox -COPY --from=build-39 /operator-build/workspace /autoinstrumentation -COPY --from=build-musl-39 /operator-build/workspace /autoinstrumentation-musl +COPY --from=build-310 /operator-build/workspace /autoinstrumentation +COPY --from=build-musl-310 /operator-build/workspace /autoinstrumentation-musl RUN chmod -R go+r /autoinstrumentation RUN chmod -R go+r /autoinstrumentation-musl \ No newline at end of file diff --git a/image/Dockerfile-beta b/image/Dockerfile-beta index dc8c4d686..3d58176da 100644 --- a/image/Dockerfile-beta +++ b/image/Dockerfile-beta @@ -10,7 +10,7 @@ # - For auto-instrumentation by container injection, the Linux command cp is # used and must be availabe in the image. -FROM python:3.9 AS build-39 +FROM python:3.10 AS build-310 WORKDIR /operator-build ADD requirements-nodeps-beta.txt . ADD requirements.txt . @@ -18,7 +18,7 @@ RUN mkdir workspace RUN pip install --no-deps --target workspace --extra-index-url https://test.pypi.org/simple/ -r requirements-nodeps-beta.txt RUN pip install --target workspace -r requirements.txt -FROM python:3.9-alpine AS build-musl-39 +FROM python:3.10-alpine AS build-musl-310 WORKDIR /operator-build ADD requirements-nodeps-beta.txt . ADD requirements.txt . @@ -29,8 +29,8 @@ RUN pip install --target workspace -r requirements.txt FROM busybox -COPY --from=build-39 /operator-build/workspace /autoinstrumentation -COPY --from=build-musl-39 /operator-build/workspace /autoinstrumentation-musl +COPY --from=build-310 /operator-build/workspace /autoinstrumentation +COPY --from=build-musl-310 /operator-build/workspace /autoinstrumentation-musl RUN chmod -R go+r /autoinstrumentation RUN chmod -R go+r /autoinstrumentation-musl \ No newline at end of file diff --git a/image/requirements.txt b/image/requirements.txt index b4edc4017..4b7b70123 100644 --- a/image/requirements.txt +++ b/image/requirements.txt @@ -1,65 +1,65 @@ # Install most APM Python deps -opentelemetry-api==1.41.1 -opentelemetry-sdk==1.41.1 -opentelemetry-instrumentation==0.62b1 +opentelemetry-api==1.42.1 +opentelemetry-sdk==1.42.1 +opentelemetry-instrumentation==0.63b1 urllib3 < 2.7.0 # We don't use the otlp_proto_grpc option since gRPC is not appropriate for # injected auto-instrumentation, where it has a strict dependency on the OS / Python version the artifact is built for. -opentelemetry-exporter-otlp-proto-http==1.41.1 -opentelemetry-exporter-prometheus==0.62b1 +opentelemetry-exporter-otlp-proto-http==1.42.1 +opentelemetry-exporter-prometheus==0.63b1 -opentelemetry-propagator-b3==1.41.1 -opentelemetry-propagator-jaeger==1.41.1 +opentelemetry-propagator-b3==1.42.1 +opentelemetry-propagator-jaeger==1.42.1 opentelemetry-propagator-aws-xray==1.0.2 -opentelemetry-propagator-ot-trace==0.62b1 +opentelemetry-propagator-ot-trace==0.63b1 # Copied in from https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation -opentelemetry-instrumentation-aio-pika==0.62b1 -opentelemetry-instrumentation-aiohttp-client==0.62b1 -opentelemetry-instrumentation-aiohttp-server==0.62b1 -opentelemetry-instrumentation-aiokafka==0.62b1 -opentelemetry-instrumentation-aiopg==0.62b1 -opentelemetry-instrumentation-asgi==0.62b1 -opentelemetry-instrumentation-asyncio==0.62b1 -opentelemetry-instrumentation-asyncpg==0.62b1 -opentelemetry-instrumentation-aws-lambda==0.62b1 -opentelemetry-instrumentation-boto3sqs==0.62b1 -opentelemetry-instrumentation-botocore==0.62b1 -opentelemetry-instrumentation-cassandra==0.62b1 -opentelemetry-instrumentation-celery==0.62b1 -opentelemetry-instrumentation-click==0.62b1 -opentelemetry-instrumentation-confluent-kafka==0.62b1 -opentelemetry-instrumentation-dbapi==0.62b1 -opentelemetry-instrumentation-django==0.62b1 -opentelemetry-instrumentation-elasticsearch==0.62b1 -opentelemetry-instrumentation-falcon==0.62b1 -opentelemetry-instrumentation-fastapi==0.62b1 -opentelemetry-instrumentation-flask==0.62b1 -opentelemetry-instrumentation-grpc==0.62b1 -opentelemetry-instrumentation-httpx==0.62b1 -opentelemetry-instrumentation-jinja2==0.62b1 -opentelemetry-instrumentation-kafka-python==0.62b1 -opentelemetry-instrumentation-logging==0.62b1 -opentelemetry-instrumentation-mysql==0.62b1 -opentelemetry-instrumentation-mysqlclient==0.62b1 -opentelemetry-instrumentation-pika==0.62b1 -opentelemetry-instrumentation-psycopg==0.62b1 -opentelemetry-instrumentation-psycopg2==0.62b1 -opentelemetry-instrumentation-pymemcache==0.62b1 -opentelemetry-instrumentation-pymongo==0.62b1 -opentelemetry-instrumentation-pymysql==0.62b1 -opentelemetry-instrumentation-pyramid==0.62b1 -opentelemetry-instrumentation-redis==0.62b1 -opentelemetry-instrumentation-remoulade==0.62b1 -opentelemetry-instrumentation-requests==0.62b1 -opentelemetry-instrumentation-sqlalchemy==0.62b1 -opentelemetry-instrumentation-sqlite3==0.62b1 -opentelemetry-instrumentation-starlette==0.62b1 -opentelemetry-instrumentation-threading==0.62b1 -opentelemetry-instrumentation-tornado==0.62b1 -opentelemetry-instrumentation-tortoiseorm==0.62b1 -opentelemetry-instrumentation-urllib==0.62b1 -opentelemetry-instrumentation-urllib3==0.62b1 -opentelemetry-instrumentation-wsgi==0.62b1 +opentelemetry-instrumentation-aio-pika==0.63b1 +opentelemetry-instrumentation-aiohttp-client==0.63b1 +opentelemetry-instrumentation-aiohttp-server==0.63b1 +opentelemetry-instrumentation-aiokafka==0.63b1 +opentelemetry-instrumentation-aiopg==0.63b1 +opentelemetry-instrumentation-asgi==0.63b1 +opentelemetry-instrumentation-asyncio==0.63b1 +opentelemetry-instrumentation-asyncpg==0.63b1 +opentelemetry-instrumentation-aws-lambda==0.63b1 +opentelemetry-instrumentation-boto3sqs==0.63b1 +opentelemetry-instrumentation-botocore==0.63b1 +opentelemetry-instrumentation-cassandra==0.63b1 +opentelemetry-instrumentation-celery==0.63b1 +opentelemetry-instrumentation-click==0.63b1 +opentelemetry-instrumentation-confluent-kafka==0.63b1 +opentelemetry-instrumentation-dbapi==0.63b1 +opentelemetry-instrumentation-django==0.63b1 +opentelemetry-instrumentation-elasticsearch==0.63b1 +opentelemetry-instrumentation-falcon==0.63b1 +opentelemetry-instrumentation-fastapi==0.63b1 +opentelemetry-instrumentation-flask==0.63b1 +opentelemetry-instrumentation-grpc==0.63b1 +opentelemetry-instrumentation-httpx==0.63b1 +opentelemetry-instrumentation-jinja2==0.63b1 +opentelemetry-instrumentation-kafka-python==0.63b1 +opentelemetry-instrumentation-logging==0.63b1 +opentelemetry-instrumentation-mysql==0.63b1 +opentelemetry-instrumentation-mysqlclient==0.63b1 +opentelemetry-instrumentation-pika==0.63b1 +opentelemetry-instrumentation-psycopg==0.63b1 +opentelemetry-instrumentation-psycopg2==0.63b1 +opentelemetry-instrumentation-pymemcache==0.63b1 +opentelemetry-instrumentation-pymongo==0.63b1 +opentelemetry-instrumentation-pymysql==0.63b1 +opentelemetry-instrumentation-pyramid==0.63b1 +opentelemetry-instrumentation-redis==0.63b1 +opentelemetry-instrumentation-remoulade==0.63b1 +opentelemetry-instrumentation-requests==0.63b1 +opentelemetry-instrumentation-sqlalchemy==0.63b1 +opentelemetry-instrumentation-sqlite3==0.63b1 +opentelemetry-instrumentation-starlette==0.63b1 +opentelemetry-instrumentation-threading==0.63b1 +opentelemetry-instrumentation-tornado==0.63b1 +opentelemetry-instrumentation-tortoiseorm==0.63b1 +opentelemetry-instrumentation-urllib==0.63b1 +opentelemetry-instrumentation-urllib3==0.63b1 +opentelemetry-instrumentation-wsgi==0.63b1 diff --git a/lambda/requirements-nodeps.txt b/lambda/requirements-nodeps.txt index 0b6418d0a..8e642e148 100644 --- a/lambda/requirements-nodeps.txt +++ b/lambda/requirements-nodeps.txt @@ -1,4 +1,4 @@ # TODO: move these dependencies to requirements.txt when they stopped relying on a pinned version of # opentelemetry-propagator-aws-xray -opentelemetry-instrumentation-aws-lambda==0.62b1 -opentelemetry-instrumentation-botocore==0.62b1 \ No newline at end of file +opentelemetry-instrumentation-aws-lambda==0.63b1 +opentelemetry-instrumentation-botocore==0.63b1 \ No newline at end of file diff --git a/lambda/requirements.txt b/lambda/requirements.txt index df6f15851..561d9679e 100644 --- a/lambda/requirements.txt +++ b/lambda/requirements.txt @@ -1,39 +1,39 @@ -opentelemetry-sdk==1.41.1 -opentelemetry-exporter-otlp-proto-http==1.41.1 +opentelemetry-sdk==1.42.1 +opentelemetry-exporter-otlp-proto-http==1.42.1 # Exclude default opentelemetry-distro -opentelemetry-instrumentation==0.62b1 -opentelemetry-semantic-conventions==0.62b1 +opentelemetry-instrumentation==0.63b1 +opentelemetry-semantic-conventions==0.63b1 opentelemetry-propagator-aws-xray==1.0.2 # Instrumentation dependencies -opentelemetry-instrumentation-aiohttp-client==0.62b1 -opentelemetry-util-http==0.62b1 -opentelemetry-instrumentation-asgi==0.62b1 -opentelemetry-instrumentation-asyncpg==0.62b1 -opentelemetry-instrumentation-boto3sqs==0.62b1 -opentelemetry-instrumentation-celery==0.62b1 -opentelemetry-instrumentation-dbapi==0.62b1 -opentelemetry-instrumentation-django==0.62b1 -opentelemetry-instrumentation-elasticsearch==0.62b1 -opentelemetry-instrumentation-fastapi==0.62b1 -opentelemetry-instrumentation-falcon==0.62b1 -opentelemetry-instrumentation-flask==0.62b1 -opentelemetry-instrumentation-jinja2==0.62b1 -opentelemetry-instrumentation-mysql==0.62b1 -opentelemetry-instrumentation-psycopg2==0.62b1 -opentelemetry-instrumentation-pymemcache==0.62b1 -opentelemetry-instrumentation-pymongo==0.62b1 -opentelemetry-instrumentation-pymysql==0.62b1 -opentelemetry-instrumentation-pyramid==0.62b1 -opentelemetry-instrumentation-redis==0.62b1 -opentelemetry-instrumentation-requests==0.62b1 -opentelemetry-instrumentation-sqlalchemy==0.62b1 -opentelemetry-instrumentation-sqlite3==0.62b1 -opentelemetry-instrumentation-starlette==0.62b1 -opentelemetry-instrumentation-tornado==0.62b1 -opentelemetry-instrumentation-wsgi==0.62b1 +opentelemetry-instrumentation-aiohttp-client==0.63b1 +opentelemetry-util-http==0.63b1 +opentelemetry-instrumentation-asgi==0.63b1 +opentelemetry-instrumentation-asyncpg==0.63b1 +opentelemetry-instrumentation-boto3sqs==0.63b1 +opentelemetry-instrumentation-celery==0.63b1 +opentelemetry-instrumentation-dbapi==0.63b1 +opentelemetry-instrumentation-django==0.63b1 +opentelemetry-instrumentation-elasticsearch==0.63b1 +opentelemetry-instrumentation-fastapi==0.63b1 +opentelemetry-instrumentation-falcon==0.63b1 +opentelemetry-instrumentation-flask==0.63b1 +opentelemetry-instrumentation-jinja2==0.63b1 +opentelemetry-instrumentation-mysql==0.63b1 +opentelemetry-instrumentation-psycopg2==0.63b1 +opentelemetry-instrumentation-pymemcache==0.63b1 +opentelemetry-instrumentation-pymongo==0.63b1 +opentelemetry-instrumentation-pymysql==0.63b1 +opentelemetry-instrumentation-pyramid==0.63b1 +opentelemetry-instrumentation-redis==0.63b1 +opentelemetry-instrumentation-requests==0.63b1 +opentelemetry-instrumentation-sqlalchemy==0.63b1 +opentelemetry-instrumentation-sqlite3==0.63b1 +opentelemetry-instrumentation-starlette==0.63b1 +opentelemetry-instrumentation-tornado==0.63b1 +opentelemetry-instrumentation-wsgi==0.63b1 # Additional APM dependencies -opentelemetry-instrumentation-botocore==0.62b1 -opentelemetry-instrumentation-logging==0.62b1 +opentelemetry-instrumentation-botocore==0.63b1 +opentelemetry-instrumentation-logging==0.63b1 opentelemetry-sdk-extension-aws == 2.1.0 \ No newline at end of file diff --git a/lambda/tests/requirements.txt b/lambda/tests/requirements.txt index 0fd0c09a1..0567ad171 100644 --- a/lambda/tests/requirements.txt +++ b/lambda/tests/requirements.txt @@ -1,2 +1,2 @@ -opentelemetry-instrumentation-aws-lambda == 0.62b1 +opentelemetry-instrumentation-aws-lambda == 0.63b1 opentelemetry-propagator-aws-xray == 1.0.2 diff --git a/pyproject.toml b/pyproject.toml index 5ded99a5e..25a41590b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,16 +34,16 @@ classifiers = [ "Intended Audience :: Developers", "Intended Audience :: Information Technology", ] -requires-python = ">=3.9" +requires-python = ">=3.10" dependencies = [ - 'opentelemetry-api == 1.41.1', - 'opentelemetry-sdk == 1.41.1', - 'opentelemetry-exporter-otlp == 1.41.1', - 'opentelemetry-instrumentation == 0.62b1', - 'opentelemetry-instrumentation-logging == 0.62b1', + 'opentelemetry-api == 1.42.1', + 'opentelemetry-sdk == 1.42.1', + 'opentelemetry-exporter-otlp == 1.42.1', + 'opentelemetry-instrumentation == 0.63b1', + 'opentelemetry-instrumentation-logging == 0.63b1', 'opentelemetry-sdk-extension-aws == 2.1.0', 'opentelemetry-resource-detector-azure == 0.1.5', - 'opentelemetry-resource-detector-containerid == 0.62b1', + 'opentelemetry-resource-detector-containerid == 0.63b1', ] [project.urls] diff --git a/solarwinds_apm/api/__init__.py b/solarwinds_apm/api/__init__.py index dbc3ba1b1..57a412f99 100644 --- a/solarwinds_apm/api/__init__.py +++ b/solarwinds_apm/api/__init__.py @@ -124,7 +124,7 @@ def solarwinds_ready( if isinstance(tracer_provider, SolarwindsTracerProvider): if isinstance( tracer_provider.sampler, - (ParentBasedSwSampler, HttpSampler, JsonSampler), + ParentBasedSwSampler | HttpSampler | JsonSampler, ): return tracer_provider.sampler.wait_until_ready( int(wait_milliseconds / 1000) diff --git a/tests/docker/install/README.md b/tests/docker/install/README.md index 2f0de9a85..c4c3f3b66 100644 --- a/tests/docker/install/README.md +++ b/tests/docker/install/README.md @@ -13,7 +13,7 @@ These files provide containers and scripts to test installation of packaged `sol * `SW_APM_SERVICE_KEY_PROD` * `SW_APM_SERVICE_KEY_STAGING` 4. Run one of the containers interactively, with service name specified in `docker-compose.yml`: - * For Debian / CentOS / Amazon (py3.9) /Fedora: `docker-compose run --rm /bin/bash` - * For Amazon (py3.13): `docker-compose run --rm --entrypoint="" py3.13-install-amazon2023- /bin/sh` + * For Debian / Ubuntu: `docker-compose run --rm /bin/bash` + * For Amazon Linux 2 (py3.10) / Amazon Linux 2023 (py3.13): `docker-compose run --rm --entrypoint="" /bin/sh` * For Alpine: `docker-compose run --rm /bin/sh` 5. `./_helper_run_install_tests.sh` diff --git a/tests/docker/install/_helper_run_install_tests.sh b/tests/docker/install/_helper_run_install_tests.sh index bfe92921d..daa655264 100755 --- a/tests/docker/install/_helper_run_install_tests.sh +++ b/tests/docker/install/_helper_run_install_tests.sh @@ -12,18 +12,21 @@ # * Amazon Linux not having agent install deps # * CentOS 8 being at end-of-life and needing a mirror re-point # * Ubuntu not having agent install deps -# -# Note: centos8 can only install Python 3.9 + # stop on error set -e -if [[ "$OSTYPE" == "darwin"* ]]; +if [ "${OSTYPE#darwin}" != "$OSTYPE" ] || [ -n "$PYTHON_VERSION" ]; then - # On macOS, use GitHub Actions environment variable + # On macOS or when PYTHON_VERSION is explicitly set, use environment variable python_version=$PYTHON_VERSION python_version_no_dot=$(echo "$python_version" | sed 's/\.//') - pretty_name="macOS $(sw_vers -productVersion)" + if [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then + pretty_name="macOS $(sw_vers -productVersion)" + else + pretty_name=$(grep PRETTY_NAME /etc/os-release | sed 's/PRETTY_NAME="//' | sed 's/"//') + fi else # get Python version from container hostname, e.g. "3.10" python_version=$(grep -Eo 'py3.[0-9]+[0-9]*' /etc/hostname | grep -Eo '3.[0-9]+[0-9]*') @@ -43,25 +46,6 @@ echo "Installing test dependencies for Python $python_version on $pretty_name" apk add python3 curl linux-headers gcc musl-dev pip install --upgrade pip >/dev/null - - elif grep "CentOS Linux 8" /etc/os-release; then - # fix centos8 metadata download failures for repo 'appstream' - # https://stackoverflow.com/a/71077606 - sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* - sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* - # agent and test deps - dnf install -y \ - "python$python_version_no_dot" \ - unzip \ - findutils - dnf install -y "python$python_version_no_dot-pip" "python$python_version_no_dot-setuptools" - - command -v python || - ln -s "/usr/bin/python$python_version" /usr/local/bin/python - command -v pip || - ln -s /usr/bin/pip3 /usr/local/bin/pip - - pip install --upgrade pip >/dev/null elif grep Ubuntu /etc/os-release; then ubuntu_version=$(grep VERSION_ID /etc/os-release | sed 's/VERSION_ID="//' | sed 's/"//') @@ -112,8 +96,24 @@ echo "Installing test dependencies for Python $python_version on $pretty_name" command -v pip || ln -s /usr/bin/pip3 /usr/local/bin/pip fi + elif grep "Amazon Linux 2" /etc/os-release; then + yum update -y + yum install -y \ + unzip \ + findutils \ + tar \ + gzip \ + bash \ + chkconfig + + # For AWS Lambda images, python3 and pip3 are already installed + # Just ensure python and pip symlinks exist + command -v python || + ln -s /usr/bin/python3 /usr/local/bin/python + command -v pip || + ln -s /usr/bin/pip3 /usr/local/bin/pip else - echo "ERROR: Testing on Amazon <2023 not supported." + echo "ERROR: Testing on Amazon Linux <2 not supported." exit 1 fi fi diff --git a/tests/docker/install/docker-compose.yml b/tests/docker/install/docker-compose.yml index a382e7ddc..0cdf8a33f 100755 --- a/tests/docker/install/docker-compose.yml +++ b/tests/docker/install/docker-compose.yml @@ -36,65 +36,19 @@ services: #-------------------------------------------------------------------- #-------------------------------------------------------------------- - # Python 3.9 + # Python 3.10 #-------------------------------------------------------------------- - py3.9-install-debian10: - hostname: "py3.9-debian10" - image: "python:3.9-buster" - << : [*command-install-test, *workdir, *volumes-codebase] - environment: - << : *envvars-install-test - - py3.9-install-debian11: - hostname: "py3.9-debian11" - image: "python:3.9-bullseye" + py3.10-install-amazon2-arm64: + hostname: "py3.10-amazon2-arm64" + image: "amazon/aws-lambda-python:3.10-arm64" << : [*command-install-test, *workdir, *volumes-codebase] environment: << : *envvars-install-test - py3.9-install-centos8: - hostname: "py3.9-centos8" - image: "centos:8" - << : [*command-install-test, *workdir, *volumes-codebase] - environment: - << : *envvars-install-test - - py3.9-install-alpine3.13: - hostname: "py3.9-alpine3.13" - image: "python:3.9-alpine3.13" - << : [*command-install-test, *workdir, *volumes-codebase] - environment: - << : *envvars-install-test - - py3.9-install-alpine3.16: - hostname: "py3.9-alpine3.16" - image: "python:3.9-alpine3.16" - << : [*command-install-test, *workdir, *volumes-codebase] - environment: - << : *envvars-install-test - - py3.9-install-alpine3.17: - hostname: "py3.9-alpine3.17" - image: "python:3.9-alpine3.17" - << : [*command-install-test, *workdir, *volumes-codebase] - environment: - << : *envvars-install-test - - py3.9-install-rhel8: - hostname: "py3.9-rhel8" - image: "registry.fedoraproject.org/f33/python3" - << : [*command-install-test, *workdir, *volumes-codebase] - environment: - << : *envvars-install-test - - #-------------------------------------------------------------------- - # Python 3.10 - #-------------------------------------------------------------------- - - py3.10-install-amazon2023: - hostname: "py3.10-amazon2023" - image: "amazonlinux:2023" + py3.10-install-amazon2-x86-64: + hostname: "py3.10-amazon2-x86-64" + image: "amazon/aws-lambda-python:3.10-x86_64" << : [*command-install-test, *workdir, *volumes-codebase] environment: << : *envvars-install-test diff --git a/tests/integration/test_scenario_1.py b/tests/integration/test_scenario_1.py index 38beec844..7844f2b7d 100644 --- a/tests/integration/test_scenario_1.py +++ b/tests/integration/test_scenario_1.py @@ -93,7 +93,6 @@ def test_scenario_1_sampled(self): new_span_id = traceparent_re_result.group(3) assert new_span_id is not None new_trace_flags = traceparent_re_result.group(4) - assert new_trace_flags == "01" self.assert_trace_flags_sampled(new_trace_flags) assert "tracestate" in resp_json diff --git a/tests/integration/test_scenario_8.py b/tests/integration/test_scenario_8.py index 774e6e1ae..4b5d5b364 100644 --- a/tests/integration/test_scenario_8.py +++ b/tests/integration/test_scenario_8.py @@ -764,7 +764,6 @@ def test_sampled_invalid_trace_context_and_valid_unsigned_with_tt(self): new_span_id = traceparent_re_result.group(3) assert new_span_id is not None new_trace_flags = traceparent_re_result.group(4) - assert new_trace_flags == "01" self.assert_trace_flags_sampled(new_trace_flags) assert "tracestate" in resp_json @@ -940,7 +939,6 @@ def test_not_sampled_invalid_trace_context_and_valid_unsigned_with_tt(self): new_span_id = traceparent_re_result.group(3) assert new_span_id is not None new_trace_flags = traceparent_re_result.group(4) - assert new_trace_flags == "00" self.assert_trace_flags_not_sampled(new_trace_flags) assert "tracestate" in resp_json diff --git a/tests/integration/test_signed_tt.py b/tests/integration/test_signed_tt.py index bdb43fe74..546bcc6c7 100644 --- a/tests/integration/test_signed_tt.py +++ b/tests/integration/test_signed_tt.py @@ -104,7 +104,6 @@ def test_signed_with_tt_auth_ok(self): new_span_id = traceparent_re_result.group(3) assert new_span_id is not None new_trace_flags = traceparent_re_result.group(4) - assert new_trace_flags == "01" self.assert_trace_flags_sampled(new_trace_flags) assert "tracestate" in resp_json @@ -282,7 +281,6 @@ def test_signed_without_tt_auth_ok(self): new_span_id = traceparent_re_result.group(3) assert new_span_id is not None new_trace_flags = traceparent_re_result.group(4) - assert new_trace_flags == "01" self.assert_trace_flags_sampled(new_trace_flags) assert "tracestate" in resp_json @@ -456,7 +454,6 @@ def test_signed_with_tt_rate_exceeded(self): new_span_id = traceparent_re_result.group(3) assert new_span_id is not None new_trace_flags = traceparent_re_result.group(4) - assert new_trace_flags == "00" self.assert_trace_flags_not_sampled(new_trace_flags) assert "tracestate" in resp_json @@ -562,7 +559,6 @@ def test_signed_with_tt_tracing_disabled(self): new_span_id = traceparent_re_result.group(3) assert new_span_id is not None new_trace_flags = traceparent_re_result.group(4) - assert new_trace_flags == "00" self.assert_trace_flags_not_sampled(new_trace_flags) assert "tracestate" in resp_json @@ -663,7 +659,6 @@ def test_signed_with_tt_auth_fail(self): new_span_id = traceparent_re_result.group(3) assert new_span_id is not None new_trace_flags = traceparent_re_result.group(4) - assert new_trace_flags == "00" self.assert_trace_flags_not_sampled(new_trace_flags) assert "tracestate" in resp_json @@ -764,7 +759,6 @@ def test_signed_without_tt_auth_fail(self): new_span_id = traceparent_re_result.group(3) assert new_span_id is not None new_trace_flags = traceparent_re_result.group(4) - assert new_trace_flags == "00" self.assert_trace_flags_not_sampled(new_trace_flags) assert "tracestate" in resp_json @@ -870,7 +864,6 @@ def test_signed_with_tt_auth_fail_bad_ts(self): new_span_id = traceparent_re_result.group(3) assert new_span_id is not None new_trace_flags = traceparent_re_result.group(4) - assert new_trace_flags == "00" self.assert_trace_flags_not_sampled(new_trace_flags) assert "tracestate" in resp_json @@ -975,7 +968,6 @@ def test_signed_without_tt_auth_fail_bad_ts(self): new_span_id = traceparent_re_result.group(3) assert new_span_id is not None new_trace_flags = traceparent_re_result.group(4) - assert new_trace_flags == "00" self.assert_trace_flags_not_sampled(new_trace_flags) assert "tracestate" in resp_json @@ -1077,7 +1069,6 @@ def test_signed_missing_xtraceoptions_header(self): new_span_id = traceparent_re_result.group(3) assert new_span_id is not None new_trace_flags = traceparent_re_result.group(4) - assert new_trace_flags == "00" self.assert_trace_flags_not_sampled(new_trace_flags) assert "tracestate" in resp_json diff --git a/tests/integration/test_unsigned_tt.py b/tests/integration/test_unsigned_tt.py index 89754fcca..972b68e81 100644 --- a/tests/integration/test_unsigned_tt.py +++ b/tests/integration/test_unsigned_tt.py @@ -100,7 +100,6 @@ def test_unsigned_with_tt_sampled(self): new_span_id = traceparent_re_result.group(3) assert new_span_id is not None new_trace_flags = traceparent_re_result.group(4) - assert new_trace_flags == "01" self.assert_trace_flags_sampled(new_trace_flags) assert "tracestate" in resp_json @@ -270,7 +269,6 @@ def test_unsigned_with_tt_not_sampled_rate_exceeded(self): new_span_id = traceparent_re_result.group(3) assert new_span_id is not None new_trace_flags = traceparent_re_result.group(4) - assert new_trace_flags == "00" self.assert_trace_flags_not_sampled(new_trace_flags) assert "tracestate" in resp_json @@ -372,7 +370,6 @@ def test_unsigned_with_tt_not_sampled_tt_disabled(self): new_span_id = traceparent_re_result.group(3) assert new_span_id is not None new_trace_flags = traceparent_re_result.group(4) - assert new_trace_flags == "00" self.assert_trace_flags_not_sampled(new_trace_flags) assert "tracestate" in resp_json @@ -474,7 +471,6 @@ def test_unsigned_without_tt_sampled(self): new_span_id = traceparent_re_result.group(3) assert new_span_id is not None new_trace_flags = traceparent_re_result.group(4) - assert new_trace_flags == "01" self.assert_trace_flags_sampled(new_trace_flags) assert "tracestate" in resp_json @@ -648,7 +644,6 @@ def test_unsigned_without_tt_not_sampled_rate_exceeded(self): new_span_id = traceparent_re_result.group(3) assert new_span_id is not None new_trace_flags = traceparent_re_result.group(4) - assert new_trace_flags == "00" self.assert_trace_flags_not_sampled(new_trace_flags) assert "tracestate" in resp_json diff --git a/tests/integration/test_xtraceoptions_validation.py b/tests/integration/test_xtraceoptions_validation.py index ef08bc78e..897750362 100644 --- a/tests/integration/test_xtraceoptions_validation.py +++ b/tests/integration/test_xtraceoptions_validation.py @@ -76,7 +76,6 @@ def get_new_span_id_and_trace_flags(self, resp_json): new_span_id = traceparent_re_result.group(3) assert new_span_id is not None new_trace_flags = traceparent_re_result.group(4) - assert new_trace_flags == "01" self.assert_trace_flags_sampled(new_trace_flags) return new_span_id, new_trace_flags