From 770d775dcb94f51c93a45128ff2428acf5e8c3df Mon Sep 17 00:00:00 2001 From: Paulo Vital Date: Tue, 7 Oct 2025 17:23:12 +0200 Subject: [PATCH 1/4] chore: Update README.md file. Signed-off-by: Paulo Vital --- README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 514530c7..20e08ff5 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,13 @@ Any feedback is welcome. Happy Python visibility. ## Installation -Instana remotely instruments your Python web servers automatically via [Instana AutoTrace™️]. To configure which Python processes this applies to, see the [configuration page]. +You can use automatic installation or manual installation as described in the following sections: -## Manual Installation +### Automatic installation + +Instana remotely instruments your Python applications automatically by [Instana AutoTrace webhook] in Kubernetes and Red Hat OpenShift clusters. However, if you prefer to install the package manually, see [Manual Installation](#manual-installation) as follows. + +### Manual Installation If you wish to instrument your applications manually, you can install the package with the following into the `virtualenv`, `pipenv`, or container (hosted on [PyPI]): @@ -27,7 +31,7 @@ or to alternatively update an existing installation: pip install -U instana -### Activating Without Code Changes +#### Activating Without Code Changes The Instana package can then be activated _without any code changes required_ by setting the following environment variable for your Python application: @@ -35,7 +39,7 @@ The Instana package can then be activated _without any code changes required_ by This will cause the Instana Python package to instrument your Python application automatically. Once it finds the Instana host agent, it will report Python metrics and distributed traces. -### Activating via Import +#### Activating With Code Changes Alternatively, if you prefer the manual method, import the `instana` package inside of your Python application: @@ -57,11 +61,11 @@ Want to instrument other languages? See our [Node.js], [Go], [Ruby] instrumenta [Instana]: https://www.instana.com/ "IBM Instana Observability" -[Instana AutoTrace™️]: https://www.ibm.com/docs/en/instana-observability/current?topic=kubernetes-instana-autotrace-webhook "Instana AutoTrace" +[Instana AutoTrace webhook]: https://www.ibm.com/docs/en/instana-observability/current?topic=kubernetes-instana-autotrace-webhook "Instana AutoTrace webhook" [configuration page]: https://www.ibm.com/docs/en/instana-observability/current?topic=package-python-configuration-configuring-instana#general "Instana Python package configuration" [PyPI]: https://pypi.python.org/pypi/instana "Instana package at PyPI" [installation document]: https://www.ibm.com/docs/en/instana-observability/current?topic=technologies-monitoring-python-instana-python-package#installation-methods "Instana Python package installation methods" -[documentation portal]: https://www.ibm.com/docs/en/instana-observability/current?topic=technologies-monitoring-python-instana-python-package "Instana Python package documentation" +[documentation portal]: https://ibm.biz/monitoring-python "Monitoring Python - IBM documentation" [Node.js]: https://github.com/instana/nodejs "Instana Node.JS Tracer" [Go]: https://github.com/instana/golang-sensor "Instana Go Tracer" [Ruby]: https://github.com/instana/ruby-sensor "Instana Ruby Tracer" From b42438a401490d56f85a071a6117820360b0461d Mon Sep 17 00:00:00 2001 From: Paulo Vital Date: Tue, 7 Oct 2025 17:25:13 +0200 Subject: [PATCH 2/4] feat: Add support to Python 3.14.0 ... and drop support to Python 3.8. Signed-off-by: Paulo Vital --- .circleci/config.yml | 43 +++------------------------- .tekton/github-pr-pipeline.yaml.part | 7 ++--- .tekton/pipeline.yaml | 1 + .tekton/python-tracer-prepuller.yaml | 5 +--- Dockerfile | 2 +- pyproject.toml | 8 ++++-- src/instana/autoprofile/profiler.py | 7 +++-- 7 files changed, 18 insertions(+), 55 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a06d8287..83007df7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,8 +19,8 @@ commands: CHANGED_FILES=$(git diff --name-only origin/main...HEAD) # Check if any relevant files changed - echo "$CHANGED_FILES" | grep -q -E "^(src/|tests/|tests_aws/|.circleci/)" || { - echo "No changes in src/, tests/, tests_aws/, or .circleci directories. Skipping tests." + echo "$CHANGED_FILES" | grep -q -E "^(src/|tests/|tests_autowrapt/|tests_aws/|.circleci/|pyproject.toml)" || { + echo "No changes in src/, tests/, tests_autowrapt/, tests_aws/, .circleci directories or pyproject.toml file. Skipping tests." circleci step halt } @@ -161,38 +161,6 @@ jobs: - store-pytest-results - store-coverage-report - python314: - docker: - - image: ghcr.io/pvital/pvital-py3.14.0:latest - - image: public.ecr.aws/docker/library/postgres:16.2-bookworm - environment: - POSTGRES_USER: root - POSTGRES_PASSWORD: passw0rd - POSTGRES_DB: instana_test_db - - image: public.ecr.aws/docker/library/mariadb:11.3.2 - environment: - MYSQL_ROOT_PASSWORD: passw0rd - MYSQL_DATABASE: instana_test_db - - image: public.ecr.aws/docker/library/redis:7.2.4-bookworm - - image: public.ecr.aws/docker/library/rabbitmq:3.13.0 - - image: public.ecr.aws/docker/library/mongo:7.0.6 - - image: quay.io/thekevjames/gcloud-pubsub-emulator:latest - environment: - PUBSUB_EMULATOR_HOST: 0.0.0.0:8681 - PUBSUB_PROJECT1: test-project,test-topic - working_directory: ~/repo - steps: - - checkout - - check-if-tests-needed - - run: | - cp -a /root/base/venv ./venv - . venv/bin/activate - pip install 'wheel==0.45.1' - pip install -r requirements.txt - - run-tests-with-coverage-report - - store-pytest-results - - store-coverage-report - py39cassandra: docker: - image: public.ecr.aws/docker/library/python:3.9 @@ -324,8 +292,7 @@ workflows: - python3x: matrix: parameters: - py-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] - - python314 + py-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] - py39cassandra - py39gevent - py312aws @@ -333,12 +300,10 @@ workflows: - autowrapt: matrix: parameters: - py-version: ["3.11", "3.12", "3.13"] + py-version: ["3.11", "3.12", "3.13", "3.14"] - final_job: requires: - python3x - # Uncomment the following when giving real support to 3.14 - # - python314 - py39cassandra - py39gevent - py312aws diff --git a/.tekton/github-pr-pipeline.yaml.part b/.tekton/github-pr-pipeline.yaml.part index 2e0aac50..5a4782c1 100644 --- a/.tekton/github-pr-pipeline.yaml.part +++ b/.tekton/github-pr-pipeline.yaml.part @@ -8,9 +8,6 @@ spec: type: string - name: git-commit-sha type: string - - name: py-38-imageDigest - type: string - default: public.ecr.aws/docker/library/python:3.8-bookworm - name: py-39-imageDigest type: string default: public.ecr.aws/docker/library/python:3.9-bookworm @@ -28,7 +25,7 @@ spec: default: public.ecr.aws/docker/library/python:3.13-bookworm - name: py-314-imageDigest type: string - default: public.ecr.aws/docker/library/python:3.14.0rc3 + default: public.ecr.aws/docker/library/python:3.14-bookworm workspaces: - name: python-tracer-ci-pipeline-pvc tasks: @@ -51,7 +48,7 @@ spec: - unittest-gevent-starlette - unittest-aws - unittest-kafka - - unittest-python-next +# - unittest-python-next taskRef: kind: Task name: github-set-status diff --git a/.tekton/pipeline.yaml b/.tekton/pipeline.yaml index efbd6fe5..ba2fbef0 100644 --- a/.tekton/pipeline.yaml +++ b/.tekton/pipeline.yaml @@ -34,6 +34,7 @@ spec: - name: imageDigest value: - $(params.py-313-imageDigest) + - $(params.py-314-imageDigest) taskRef: name: python-tracer-unittest-default-task workspaces: diff --git a/.tekton/python-tracer-prepuller.yaml b/.tekton/python-tracer-prepuller.yaml index b6a6f8a0..0ef3ec41 100644 --- a/.tekton/python-tracer-prepuller.yaml +++ b/.tekton/python-tracer-prepuller.yaml @@ -40,9 +40,6 @@ spec: - name: prepuller-kafka image: public.ecr.aws/bitnami/kafka:3.9.0 command: ["sh", "-c", "'true'"] - - name: prepuller-38 - image: public.ecr.aws/docker/library/python:3.8-bookworm - command: ["sh", "-c", "'true'"] - name: prepuller-39 image: public.ecr.aws/docker/library/python:3.9-bookworm command: ["sh", "-c", "'true'"] @@ -59,7 +56,7 @@ spec: image: public.ecr.aws/docker/library/python:3.13-bookworm command: ["sh", "-c", "'true'"] - name: prepuller-314 - image: public.ecr.aws/docker/library/python:3.14.0rc3 + image: public.ecr.aws/docker/library/python:3.14-bookworm command: ["sh", "-c", "'true'"] # Use the pause container to ensure the Pod goes into a `Running` phase diff --git a/Dockerfile b/Dockerfile index a193d6d1..ba04c9c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Development Container -FROM public.ecr.aws/docker/library/python:3.12-slim-bookworm +FROM public.ecr.aws/docker/library/python:3.14-slim RUN apt-get -y -qq update && \ apt-get -y -qq upgrade && \ diff --git a/pyproject.toml b/pyproject.toml index bcd86863..5edc3a6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ dynamic = [ ] description = "Python Distributed Tracing & Metrics Sensor for Instana." readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.9" license = "MIT" keywords = [ "performance", @@ -31,12 +31,12 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware", "Topic :: System :: Monitoring", @@ -69,7 +69,7 @@ dev = [ ] [project.urls] -Documentation = "https://www.ibm.com/docs/en/instana-observability/current?topic=technologies-monitoring-python-instana-python-package" +Documentation = "https://ibm.biz/monitoring-python" Issues = "https://github.com/instana/python-sensor/issues" Source = "https://github.com/instana/python-sensor" @@ -80,6 +80,8 @@ path = "src/instana/version.py" include = [ "/src", "/tests", + "/tests_autowrapt", + "/tests_aws", ] [tool.hatch.build.targets.wheel] diff --git a/src/instana/autoprofile/profiler.py b/src/instana/autoprofile/profiler.py index 2e685a0e..dc417c46 100644 --- a/src/instana/autoprofile/profiler.py +++ b/src/instana/autoprofile/profiler.py @@ -17,6 +17,7 @@ if TYPE_CHECKING: from types import FrameType + from instana.agent.host import HostAgent @@ -52,11 +53,11 @@ def start(self, **kwargs: Dict[str, Any]) -> None: return try: - if not min_version(3, 8): - raise Exception("Supported Python versions 3.8 or higher.") + if not min_version(3, 9): + raise EnvironmentError("Supported Python versions: 3.9 or higher.") if platform.python_implementation() != "CPython": - raise Exception("Supported Python interpreter is CPython.") + raise EnvironmentError("Supported Python interpreter: CPython.") if self.profiler_destroyed: logger.warning("Destroyed profiler cannot be started.") From f4a9a0f7914c4fd2f91b561e18c87fdf4af0f5ca Mon Sep 17 00:00:00 2001 From: Paulo Vital Date: Tue, 7 Oct 2025 17:32:59 +0200 Subject: [PATCH 3/4] chore(ci): Update to trixie container images... when possible, as redis doesn't have it. Signed-off-by: Paulo Vital --- .circleci/config.yml | 2 +- .tekton/.currency/currency-tasks.yaml | 2 +- .tekton/github-pr-pipeline.yaml.part | 12 ++++++------ .tekton/pipeline.yaml | 7 +++++-- .tekton/python-tracer-prepuller.yaml | 14 +++++++------- .tekton/task.yaml | 4 ++-- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 83007df7..b55277ca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -135,7 +135,7 @@ jobs: type: string docker: - image: public.ecr.aws/docker/library/python:<> - - image: public.ecr.aws/docker/library/postgres:16.2-bookworm + - image: public.ecr.aws/docker/library/postgres:16.10-trixie environment: POSTGRES_USER: root POSTGRES_PASSWORD: passw0rd diff --git a/.tekton/.currency/currency-tasks.yaml b/.tekton/.currency/currency-tasks.yaml index c35a97d2..7f5ead15 100644 --- a/.tekton/.currency/currency-tasks.yaml +++ b/.tekton/.currency/currency-tasks.yaml @@ -32,7 +32,7 @@ spec: mountPath: /workspace steps: - name: generate-currency-report - image: public.ecr.aws/docker/library/python:3.12-bookworm + image: public.ecr.aws/docker/library/python:3.12-trixie script: | #!/usr/bin/env bash cd /workspace/python-sensor/.tekton/.currency diff --git a/.tekton/github-pr-pipeline.yaml.part b/.tekton/github-pr-pipeline.yaml.part index 5a4782c1..db2319ab 100644 --- a/.tekton/github-pr-pipeline.yaml.part +++ b/.tekton/github-pr-pipeline.yaml.part @@ -10,22 +10,22 @@ spec: type: string - name: py-39-imageDigest type: string - default: public.ecr.aws/docker/library/python:3.9-bookworm + default: public.ecr.aws/docker/library/python:3.9-trixie - name: py-310-imageDigest type: string - default: public.ecr.aws/docker/library/python:3.10-bookworm + default: public.ecr.aws/docker/library/python:3.10-trixie - name: py-311-imageDigest type: string - default: public.ecr.aws/docker/library/python:3.11-bookworm + default: public.ecr.aws/docker/library/python:3.11-trixie - name: py-312-imageDigest type: string - default: public.ecr.aws/docker/library/python:3.12-bookworm + default: public.ecr.aws/docker/library/python:3.12-trixie - name: py-313-imageDigest type: string - default: public.ecr.aws/docker/library/python:3.13-bookworm + default: public.ecr.aws/docker/library/python:3.13-trixie - name: py-314-imageDigest type: string - default: public.ecr.aws/docker/library/python:3.14-bookworm + default: public.ecr.aws/docker/library/python:3.14-trixie workspaces: - name: python-tracer-ci-pipeline-pvc tasks: diff --git a/.tekton/pipeline.yaml b/.tekton/pipeline.yaml index ba2fbef0..a74ef6be 100644 --- a/.tekton/pipeline.yaml +++ b/.tekton/pipeline.yaml @@ -8,10 +8,13 @@ spec: type: string - name: py-312-imageDigest type: string - default: public.ecr.aws/docker/library/python:3.12-bookworm + default: public.ecr.aws/docker/library/python:3.12-trixie - name: py-313-imageDigest type: string - default: public.ecr.aws/docker/library/python:3.13-bookworm + default: public.ecr.aws/docker/library/python:3.13-trixie + - name: py-314-imageDigest + type: string + default: public.ecr.aws/docker/library/python:3.14-trixie workspaces: - name: python-tracer-ci-pipeline-pvc tasks: diff --git a/.tekton/python-tracer-prepuller.yaml b/.tekton/python-tracer-prepuller.yaml index 0ef3ec41..3d711dab 100644 --- a/.tekton/python-tracer-prepuller.yaml +++ b/.tekton/python-tracer-prepuller.yaml @@ -35,28 +35,28 @@ spec: image: public.ecr.aws/docker/library/mariadb:11.3.2 command: ["sh", "-c", "'true'"] - name: prepuller-postgres - image: public.ecr.aws/docker/library/postgres:16.2-bookworm + image: public.ecr.aws/docker/library/postgres:16.10-trixie command: ["sh", "-c", "'true'"] - name: prepuller-kafka image: public.ecr.aws/bitnami/kafka:3.9.0 command: ["sh", "-c", "'true'"] - name: prepuller-39 - image: public.ecr.aws/docker/library/python:3.9-bookworm + image: public.ecr.aws/docker/library/python:3.9-trixie command: ["sh", "-c", "'true'"] - name: prepuller-310 - image: public.ecr.aws/docker/library/python:3.10-bookworm + image: public.ecr.aws/docker/library/python:3.10-trixie command: ["sh", "-c", "'true'"] - name: prepuller-311 - image: public.ecr.aws/docker/library/python:3.11-bookworm + image: public.ecr.aws/docker/library/python:3.11-trixie command: ["sh", "-c", "'true'"] - name: prepuller-312 - image: public.ecr.aws/docker/library/python:3.12-bookworm + image: public.ecr.aws/docker/library/python:3.12-trixie command: ["sh", "-c", "'true'"] - name: prepuller-313 - image: public.ecr.aws/docker/library/python:3.13-bookworm + image: public.ecr.aws/docker/library/python:3.13-trixie command: ["sh", "-c", "'true'"] - name: prepuller-314 - image: public.ecr.aws/docker/library/python:3.14-bookworm + image: public.ecr.aws/docker/library/python:3.14-trixie command: ["sh", "-c", "'true'"] # Use the pause container to ensure the Pod goes into a `Running` phase diff --git a/.tekton/task.yaml b/.tekton/task.yaml index 0a9a6d05..f6b21a05 100644 --- a/.tekton/task.yaml +++ b/.tekton/task.yaml @@ -104,7 +104,7 @@ spec: - name: mongo image: public.ecr.aws/docker/library/mongo:7.0.6 - name: postgres - image: public.ecr.aws/docker/library/postgres:16.2-bookworm + image: public.ecr.aws/docker/library/postgres:16.10-trixie env: - name: POSTGRES_USER value: root @@ -248,7 +248,7 @@ spec: - name: mongo image: public.ecr.aws/docker/library/mongo:7.0.6 - name: postgres - image: public.ecr.aws/docker/library/postgres:16.2-bookworm + image: public.ecr.aws/docker/library/postgres:16.10-trixie env: - name: POSTGRES_USER value: root From 9800c61d90f644a0ab16e7531400293c146ace77 Mon Sep 17 00:00:00 2001 From: Paulo Vital Date: Tue, 7 Oct 2025 17:34:23 +0200 Subject: [PATCH 4/4] chore(version): Bump version to 3.9.0 Signed-off-by: Paulo Vital --- src/instana/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/instana/version.py b/src/instana/version.py index 034f31c6..4884162b 100644 --- a/src/instana/version.py +++ b/src/instana/version.py @@ -3,4 +3,4 @@ # Module version file. Used by setup.py and snapshot reporting. -VERSION = "3.8.3" +VERSION = "3.9.0"