Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 5 additions & 40 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
type: string
docker:
- image: public.ecr.aws/docker/library/python:<<parameters.py-version>>
- 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
Expand All @@ -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
Expand Down Expand Up @@ -324,21 +292,18 @@ 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
- py313kafka
- 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
Expand Down
2 changes: 1 addition & 1 deletion .tekton/.currency/currency-tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 7 additions & 10 deletions .tekton/github-pr-pipeline.yaml.part
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,24 @@ 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
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.0rc3
default: public.ecr.aws/docker/library/python:3.14-trixie
workspaces:
- name: python-tracer-ci-pipeline-pvc
tasks:
Expand All @@ -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
Expand Down
8 changes: 6 additions & 2 deletions .tekton/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -34,6 +37,7 @@ spec:
- name: imageDigest
value:
- $(params.py-313-imageDigest)
- $(params.py-314-imageDigest)
taskRef:
name: python-tracer-unittest-default-task
workspaces:
Expand Down
17 changes: 7 additions & 10 deletions .tekton/python-tracer-prepuller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +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-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
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.0rc3
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
Expand Down
4 changes: 2 additions & 2 deletions .tekton/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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 && \
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]):

Expand All @@ -27,15 +31,15 @@ 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:

export AUTOWRAPT_BOOTSTRAP=instana

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:

Expand All @@ -57,11 +61,11 @@ Want to instrument other languages? See our [Node.js], [Go], [Ruby] instrumenta

<!-- Reference links -->
[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"
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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"

Expand All @@ -80,6 +80,8 @@ path = "src/instana/version.py"
include = [
"/src",
"/tests",
"/tests_autowrapt",
"/tests_aws",
]

[tool.hatch.build.targets.wheel]
Expand Down
7 changes: 4 additions & 3 deletions src/instana/autoprofile/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

if TYPE_CHECKING:
from types import FrameType

from instana.agent.host import HostAgent


Expand Down Expand Up @@ -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.")
Expand Down
2 changes: 1 addition & 1 deletion src/instana/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

# Module version file. Used by setup.py and snapshot reporting.

VERSION = "3.8.3"
VERSION = "3.9.0"
Loading