diff --git a/.github/workflows/push-actions.yml b/.github/workflows/push-actions.yml index 663e3f50..634518f4 100644 --- a/.github/workflows/push-actions.yml +++ b/.github/workflows/push-actions.yml @@ -34,7 +34,7 @@ jobs: strategy: fail-fast: false # Prevent a single failure in the matrix from stopping all other jobs matrix: - python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ] + python-version: [ '3.8', '3.9', '3.10', '3.11' ] integration-test-family: ${{ fromJson(needs.list-instrumentations.outputs.integration-tests) }} name: ${{ matrix.python-version }} ${{ matrix.integration-test-family }} steps: @@ -52,7 +52,7 @@ jobs: strategy: fail-fast: false # Prevent a single failure in the matrix from stopping all other jobs matrix: - python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ] + python-version: [ '3.8', '3.9', '3.10', '3.11' ] name: Component Test for Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/version-testing.yml b/.github/workflows/version-testing.yml index 4b9ecd93..43c5b369 100644 --- a/.github/workflows/version-testing.yml +++ b/.github/workflows/version-testing.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: # If this key gets renamed, noxfile.py needs to be updated accordingly - python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ] + python-version: [ '3.8', '3.9', '3.10', '3.11' ] name: test-untested-versions steps: - uses: actions/checkout@v3 @@ -26,7 +26,7 @@ jobs: - run: git --no-pager diff - run: mkdir versions_artifact - run: for path in `git diff --name-only`; do cp "$path" versions_artifact; done - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: ${{ matrix.python-version }} path: versions_artifact @@ -42,11 +42,6 @@ jobs: with: python-version: 3.7 - run: mkdir versions_artifacts - - uses: actions/download-artifact@v2 - continue-on-error: true # when there aren't changes the artifact won't be uploaded and this step will fail - with: - name: 3.7 - path: versions_artifacts/3.7 - uses: actions/download-artifact@v2 continue-on-error: true with: diff --git a/README.md b/README.md index 205cd4ce..a0756298 100644 --- a/README.md +++ b/README.md @@ -212,9 +212,16 @@ from opentelemetry.trace import get_current_span get_current_span().add_event('', {'lumigo.type': ''}) ``` +## Python 3.7 Support + +**Deprecation Notice:** As of version 1.0.156, support for Python 3.7 has been deprecated. The last version of the Lumigo OpenTelemetry Distro to support Python 3.7 is version 1.0.155. + +For users on Python 3.7, we recommend upgrading to a newer version of Python to ensure continued compatibility and access to the latest features and improvements. + + ## Supported runtimes -* cpython: 3.7.x, 3.8.x, 3.9.x, 3.10.x, 3.11.x +* cpython: 3.8.x, 3.9.x, 3.10.x, 3.11.x ## Supported packages diff --git a/noxfile.py b/noxfile.py index af283a3c..0af8a6e0 100755 --- a/noxfile.py +++ b/noxfile.py @@ -481,10 +481,7 @@ def integration_tests_flask(session, flask_version): # override the default Werkzeug version for flask v2 compatibility if flask_version.startswith("2."): - if python == "3.7": - session.install("werkzeug==2.2.3") - else: - session.install("werkzeug==2.3.7") + session.install("werkzeug==2.3.7") try: session.run( diff --git a/scripts/init_tested_versions.sh b/scripts/init_tested_versions.sh index 925e9364..6731accf 100755 --- a/scripts/init_tested_versions.sh +++ b/scripts/init_tested_versions.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash PACKAGE_NAME="$1" -SUPPORTED_VERSIONS=(3.7 3.8 3.9 3.10 3.11) +SUPPORTED_VERSIONS=(3.8 3.9 3.10 3.11) if [ -z "$PACKAGE_NAME" ]; then echo "Usage: $0 " diff --git a/setup.cfg b/setup.cfg index b4627164..c20635ea 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,7 +18,7 @@ classifiers = package_dir = = src packages = find: -python_requires = >=3.7 +python_requires = >=3.8 [options.packages.find] where = src \ No newline at end of file diff --git a/setup.py b/setup.py index 87c76f21..1c91a141 100644 --- a/setup.py +++ b/setup.py @@ -17,26 +17,26 @@ "autowrapt>=1.0", "wrapt>=1.11.0", "lumigo_core==0.0.10", - "opentelemetry-api==1.22.0", - "opentelemetry-sdk==1.22.0", - "opentelemetry-sdk-extension-aws==2.0.1", - "opentelemetry-exporter-otlp-proto-http==1.22.0", - "opentelemetry-semantic-conventions==0.43b0", - "opentelemetry-instrumentation==0.43b0", - "opentelemetry-instrumentation-asgi==0.43b0", - "opentelemetry-instrumentation-boto==0.43b0", - "opentelemetry-instrumentation-fastapi==0.43b0", - "opentelemetry-instrumentation-flask==0.43b0", - "opentelemetry-instrumentation-grpc==0.43b0", - "opentelemetry-instrumentation-kafka-python==0.43b0", - "opentelemetry-instrumentation-pika==0.43b0", - "opentelemetry-instrumentation-psycopg2==0.43b0", - "opentelemetry-instrumentation-pymongo==0.43b0", - "opentelemetry-instrumentation-pymysql==0.43b0", - "opentelemetry-instrumentation-requests==0.43b0", - "opentelemetry-instrumentation-redis==0.43b0", - "opentelemetry-instrumentation-django==0.43b0", - "opentelemetry-instrumentation-logging==0.43b0", + "opentelemetry-api==1.26.0", + "opentelemetry-sdk==1.26.0", + "opentelemetry-sdk-extension-aws==2.0.2", + "opentelemetry-exporter-otlp-proto-http==1.26.0", + "opentelemetry-semantic-conventions==0.47b0", + "opentelemetry-instrumentation==0.47b0", + "opentelemetry-instrumentation-asgi==0.47b0", + "opentelemetry-instrumentation-boto==0.47b0", + "opentelemetry-instrumentation-fastapi==0.47b0", + "opentelemetry-instrumentation-flask==0.47b0", + "opentelemetry-instrumentation-grpc==0.47b0", + "opentelemetry-instrumentation-kafka-python==0.47b0", + "opentelemetry-instrumentation-pika==0.47b0", + "opentelemetry-instrumentation-psycopg2==0.47b0", + "opentelemetry-instrumentation-pymongo==0.47b0", + "opentelemetry-instrumentation-pymysql==0.47b0", + "opentelemetry-instrumentation-requests==0.47b0", + "opentelemetry-instrumentation-redis==0.47b0", + "opentelemetry-instrumentation-django==0.47b0", + "opentelemetry-instrumentation-logging==0.47b0", # v4.7.1 is the last version that supports python 3.7 "typing_extensions==4.7.1; python_version<'3.8'", # v6.7.0 is the last version that supports python 3.7 diff --git a/src/lumigo_opentelemetry/__init__.py b/src/lumigo_opentelemetry/__init__.py index d7fa421f..986f19a0 100644 --- a/src/lumigo_opentelemetry/__init__.py +++ b/src/lumigo_opentelemetry/__init__.py @@ -77,6 +77,23 @@ def auto_load(_: Any) -> None: def init() -> Dict[str, Any]: + """Initialize the Lumigo OpenTelemetry distribution.""" + + try: + python_version = sys.version_info + # Check if the major version is 3 and the minor version is between 8 and 11 + if python_version.major != 3 or not (8 <= python_version.minor <= 11): + logger.warning( + f"Unsupported Python version {python_version.major}.{python_version.minor}; " + "only Python 3.8 to 3.11 are supported." + ) + return {} + + except Exception as e: # Catch any issues with accessing sys.version_info + # Log a warning if there is a failure in verifying the Python version + logger.warning("Failed to verify the Python version due to: %s", str(e)) + return {} + if str(os.environ.get("LUMIGO_SWITCH_OFF", False)).lower() == "true": logger.info( "Lumigo OpenTelemetry distribution disabled via the 'LUMIGO_SWITCH_OFF' environment variable" diff --git a/src/lumigo_opentelemetry/instrumentations/botocore/tested_versions/3.7/boto3 b/src/lumigo_opentelemetry/instrumentations/botocore/tested_versions/3.7/boto3 deleted file mode 100644 index 82949726..00000000 --- a/src/lumigo_opentelemetry/instrumentations/botocore/tested_versions/3.7/boto3 +++ /dev/null @@ -1,494 +0,0 @@ -1.17.22 -1.21.46 -1.22.0 -1.22.2 -1.22.3 -1.22.4 -1.22.5 -1.22.6 -1.22.7 -1.22.8 -1.22.9 -1.22.10 -1.22.11 -1.22.12 -1.22.13 -1.23.0 -1.23.2 -1.23.3 -1.23.4 -1.23.5 -1.23.6 -1.23.7 -1.23.8 -1.23.9 -1.23.10 -1.24.0 -1.24.1 -1.24.2 -1.24.3 -1.24.4 -1.24.5 -1.24.6 -1.24.7 -1.24.8 -1.24.9 -1.24.10 -1.24.11 -1.24.12 -1.24.13 -1.24.14 -1.24.15 -1.24.16 -1.24.17 -1.24.18 -1.24.19 -1.24.20 -1.24.21 -1.24.22 -1.24.23 -1.24.24 -1.24.25 -1.24.26 -1.24.27 -1.24.28 -1.24.29 -1.24.30 -1.24.31 -1.24.32 -1.24.33 -1.24.34 -1.24.35 -1.24.91 -1.24.92 -1.24.93 -1.24.94 -1.24.95 -1.24.96 -1.25.0 -1.25.1 -1.25.2 -1.25.3 -1.25.4 -1.25.5 -1.26.0 -1.26.1 -1.26.2 -1.26.3 -1.26.4 -1.26.5 -1.26.6 -1.26.7 -1.26.8 -1.26.9 -1.26.10 -1.26.11 -1.26.12 -1.26.13 -1.26.14 -1.26.15 -1.26.16 -1.26.17 -1.26.18 -1.26.19 -1.26.20 -1.26.21 -1.26.22 -1.26.23 -1.26.24 -1.26.25 -1.26.26 -1.26.27 -1.26.28 -1.26.29 -1.26.30 -1.26.31 -1.26.32 -1.26.33 -1.26.34 -1.26.35 -1.26.36 -1.26.37 -1.26.38 -1.26.39 -1.26.40 -1.26.41 -1.26.42 -1.26.43 -1.26.44 -1.26.45 -1.26.46 -1.26.47 -1.26.48 -1.26.49 -1.26.50 -1.26.51 -1.26.52 -1.26.53 -1.26.54 -1.26.55 -1.26.56 -1.26.57 -1.26.58 -1.26.59 -1.26.60 -1.26.61 -1.26.62 -1.26.63 -1.26.64 -1.26.65 -1.26.66 -1.26.67 -1.26.68 -1.26.69 -1.26.70 -1.26.71 -1.26.72 -1.26.73 -1.26.74 -1.26.75 -1.26.76 -1.26.77 -1.26.78 -1.26.79 -1.26.80 -1.26.81 -1.26.82 -1.26.83 -1.26.84 -1.26.85 -1.26.86 -1.26.87 -1.26.88 -1.26.89 -1.26.90 -1.26.91 -1.26.92 -1.26.93 -1.26.94 -1.26.95 -1.26.96 -1.26.97 -1.26.98 -1.26.99 -1.26.100 -1.26.101 -1.26.102 -1.26.103 -1.26.104 -1.26.105 -1.26.106 -1.26.107 -1.26.108 -1.26.109 -1.26.110 -1.26.111 -1.26.112 -1.26.113 -1.26.114 -1.26.115 -1.26.116 -1.26.117 -1.26.118 -1.26.119 -1.26.120 -1.26.121 -1.26.122 -1.26.123 -1.26.124 -1.26.125 -1.26.126 -1.26.127 -1.26.128 -1.26.129 -1.26.130 -1.26.131 -1.26.132 -1.26.133 -1.26.134 -1.26.135 -1.26.136 -1.26.137 -1.26.138 -1.26.139 -1.26.140 -1.26.141 -1.26.142 -1.26.143 -1.26.144 -1.26.145 -1.26.146 -1.26.147 -1.26.148 -1.26.149 -1.26.150 -1.26.151 -1.26.152 -1.26.153 -1.26.154 -1.26.155 -1.26.156 -1.26.157 -1.26.158 -1.26.159 -1.26.160 -1.26.161 -1.26.162 -1.26.163 -1.26.164 -1.26.165 -1.27.0 -1.27.1 -1.28.0 -1.28.1 -1.28.2 -1.28.3 -1.28.4 -1.28.5 -1.28.6 -1.28.7 -1.28.8 -1.28.9 -1.28.10 -1.28.11 -1.28.12 -1.28.13 -1.28.14 -1.28.15 -1.28.16 -1.28.17 -1.28.18 -1.28.19 -1.28.20 -1.28.21 -1.28.22 -1.28.23 -1.28.24 -1.28.25 -1.28.26 -1.28.27 -1.28.28 -1.28.29 -1.28.30 -1.28.31 -1.28.32 -1.28.33 -1.28.34 -1.28.35 -1.28.36 -1.28.37 -1.28.38 -1.28.39 -1.28.40 -1.28.41 -1.28.42 -1.28.43 -1.28.44 -1.28.45 -1.28.46 -1.28.47 -1.28.48 -1.28.49 -1.28.50 -1.28.51 -1.28.52 -1.28.53 -1.28.54 -1.28.55 -1.28.56 -1.28.57 -1.28.58 -1.28.59 -1.28.60 -1.28.61 -1.28.62 -1.28.63 -1.28.64 -1.28.65 -1.28.66 -1.28.67 -1.28.68 -1.28.69 -1.28.70 -1.28.71 -1.28.72 -1.28.73 -1.28.74 -1.28.75 -1.28.76 -1.28.77 -1.28.78 -1.28.79 -1.28.80 -1.28.81 -1.28.82 -1.28.83 -1.28.84 -1.28.85 -1.29.0 -1.29.1 -1.29.2 -1.29.3 -1.29.4 -1.29.5 -1.29.6 -1.29.7 -1.33.0 -1.33.1 -1.33.2 -1.33.3 -1.33.4 -1.33.5 -1.33.6 -1.33.7 -1.33.8 -1.33.9 -1.33.10 -1.33.11 -1.33.12 -1.33.13 -!1.34.0 -!1.34.1 -!1.34.2 -!1.34.3 -!1.34.4 -!1.34.5 -!1.34.6 -!1.34.7 -!1.34.8 -!1.34.9 -!1.34.10 -!1.34.11 -!1.34.12 -!1.34.13 -!1.34.14 -!1.34.15 -!1.34.16 -!1.34.17 -!1.34.18 -!1.34.19 -!1.34.20 -!1.34.21 -!1.34.22 -!1.34.23 -!1.34.24 -!1.34.25 -!1.34.26 -!1.34.27 -!1.34.28 -!1.34.29 -!1.34.30 -!1.34.31 -!1.34.32 -!1.34.33 -!1.34.34 -!1.34.35 -!1.34.36 -!1.34.37 -!1.34.38 -!1.34.39 -!1.34.40 -!1.34.41 -!1.34.42 -!1.34.43 -!1.34.44 -!1.34.45 -!1.34.46 -!1.34.47 -!1.34.48 -!1.34.49 -!1.34.50 -!1.34.51 -!1.34.52 -!1.34.53 -!1.34.54 -!1.34.55 -!1.34.56 -!1.34.57 -!1.34.58 -!1.34.59 -!1.34.60 -!1.34.61 -!1.34.62 -!1.34.63 -!1.34.64 -!1.34.65 -!1.34.66 -!1.34.67 -!1.34.68 -!1.34.69 -!1.34.70 -!1.34.71 -!1.34.72 -!1.34.73 -!1.34.74 -!1.34.75 -!1.34.76 -!1.34.77 -!1.34.78 -!1.34.79 -!1.34.80 -!1.34.81 -!1.34.82 -!1.34.83 -!1.34.84 -!1.34.85 -!1.34.86 -!1.34.87 -!1.34.88 -!1.34.89 -!1.34.90 -!1.34.91 -!1.34.92 -!1.34.93 -!1.34.94 -!1.34.95 -!1.34.96 -!1.34.97 -!1.34.98 -!1.34.99 -!1.34.100 -!1.34.101 -!1.34.102 -!1.34.103 -!1.34.104 -!1.34.105 -!1.34.106 -!1.34.107 -!1.34.108 -!1.34.109 -!1.34.110 -!1.34.111 -!1.34.112 -!1.34.113 -!1.34.114 -!1.34.115 -!1.34.116 -!1.34.117 -!1.34.118 -!1.34.119 -!1.34.120 -!1.34.121 -!1.34.122 -!1.34.123 -!1.34.124 -!1.34.125 -!1.34.126 -!1.34.127 -!1.34.128 -!1.34.129 -!1.34.130 -!1.34.131 -!1.34.132 -!1.34.133 -!1.34.134 -!1.34.135 -!1.34.136 -!1.34.137 -!1.34.138 -!1.34.139 -!1.34.140 -!1.34.141 -!1.34.142 -!1.34.143 -!1.34.144 diff --git a/src/lumigo_opentelemetry/instrumentations/django/tested_versions/3.7/django b/src/lumigo_opentelemetry/instrumentations/django/tested_versions/3.7/django deleted file mode 100644 index 1cb276cc..00000000 --- a/src/lumigo_opentelemetry/instrumentations/django/tested_versions/3.7/django +++ /dev/null @@ -1,78 +0,0 @@ -3.2.1 -3.2.2 -3.2.3 -3.2.4 -3.2.5 -3.2.6 -3.2.7 -3.2.8 -3.2.9 -3.2.10 -3.2.11 -3.2.12 -3.2.13 -3.2.14 -3.2.15 -3.2.16 -3.2.17 -3.2.18 -3.2.19 -3.2.20 -3.2.21 -3.2.22 -3.2.23 -3.2.24 -3.2.25 -!4.0.6 -!4.0.7 -!4.0.8 -!4.0.9 -!4.0.10 -!4.1.1 -!4.1b1 -!4.1.2 -!4.1.3 -!4.1.4 -!4.1.5 -!4.1.6 -!4.1.7 -!4.1.8 -!4.1.9 -!4.1.10 -!4.1.11 -!4.1.12 -!4.1.13 -!4.2.1 -!4.2a1 -!4.2b1 -!4.2.2 -!4.2.3 -!4.2.4 -!4.2.5 -!4.2.6 -!4.2.7 -!4.2.8 -!4.2.9 -!4.2.10 -!4.2.11 -!4.2.12 -!4.2.13 -!4.2.14 -!5.0a1 -!5.0b1 -!5.0.1 -!5.0.2 -!5.0.3 -!5.0.4 -!5.0.5 -!5.0.6 -!5.0.7 -!5.1a1 -!5.1b1 -3.2 -!4.1 -!4.1rc1 -!4.2 -!4.2rc1 -!5.0 -!5.0rc1 diff --git a/src/lumigo_opentelemetry/instrumentations/fastapi/parsers/__init__.py b/src/lumigo_opentelemetry/instrumentations/fastapi/parsers/__init__.py index a3876ef4..c8a52b15 100644 --- a/src/lumigo_opentelemetry/instrumentations/fastapi/parsers/__init__.py +++ b/src/lumigo_opentelemetry/instrumentations/fastapi/parsers/__init__.py @@ -51,7 +51,9 @@ async def new_otel_receive(): # type: ignore return new_otel_receive @staticmethod - def client_response_hook(span: Span, message: Dict[str, Any]) -> None: + def client_response_hook( + span: Span, scope: Dict[str, Any], message: Dict[str, Any] + ) -> None: with lumigo_safe_execute("FastAPIParser: client_response_hook"): body = safe_convert_bytes_to_string(message.get("body")) if body: diff --git a/src/lumigo_opentelemetry/instrumentations/fastapi/tested_versions/3.7/fastapi b/src/lumigo_opentelemetry/instrumentations/fastapi/tested_versions/3.7/fastapi deleted file mode 100644 index eb92f9e5..00000000 --- a/src/lumigo_opentelemetry/instrumentations/fastapi/tested_versions/3.7/fastapi +++ /dev/null @@ -1,98 +0,0 @@ -0.56.1 -0.57.0 -0.58.0 -0.58.1 -0.59.0 -0.60.0 -0.60.1 -0.60.2 -0.61.0 -0.61.1 -0.61.2 -0.62.0 -0.63.0 -0.64.0 -0.65.0 -0.65.1 -0.65.2 -0.65.3 -0.66.0 -0.66.1 -0.67.0 -0.68.0 -0.68.1 -0.68.2 -0.69.0 -0.70.0 -0.70.1 -0.71.0 -0.72.0 -0.73.0 -0.74.0 -0.74.1 -0.75.0 -0.75.1 -0.75.2 -0.76.0 -0.77.0 -0.77.1 -0.78.0 -0.79.0 -0.79.1 -0.80.0 -0.81.0 -0.82.0 -0.83.0 -0.84.0 -0.85.0 -0.85.1 -0.85.2 -0.86.0 -0.87.0 -0.88.0 -0.89.0 -0.89.1 -0.90.0 -0.90.1 -0.91.0 -0.92.0 -0.93.0 -0.94.0 -0.94.1 -0.95.0 -0.95.1 -0.95.2 -0.96.0 -0.96.1 -0.97.0 -0.98.0 -0.99.0 -0.99.1 -0.100.0 -!0.100.0b1 -0.100.0b2 -0.100.0b3 -0.100.1 -0.101.0 -0.101.1 -0.102.0 -0.103.0 -0.103.1 -0.103.2 -!0.104.0 -!0.104.1 -!0.105.0 -!0.106.0 -!0.107.0 -!0.108.0 -!0.109.0 -!0.109.1 -!0.109.2 -!0.110.0 -!0.110.1 -!0.110.2 -!0.110.3 -!0.110.3.dev1 -!0.110.3.dev2 -!0.111.0 -!0.111.0.dev1 diff --git a/src/lumigo_opentelemetry/instrumentations/fastapi/tested_versions/3.7/uvicorn b/src/lumigo_opentelemetry/instrumentations/fastapi/tested_versions/3.7/uvicorn deleted file mode 100644 index f776a5f5..00000000 --- a/src/lumigo_opentelemetry/instrumentations/fastapi/tested_versions/3.7/uvicorn +++ /dev/null @@ -1,61 +0,0 @@ -!0.10.2 -!0.10.3 -!0.10.4 -!0.10.5 -!0.10.6 -!0.10.7 -!0.10.8 -!0.10.9 -!0.11.0 -!0.11.1 -!0.11.2 -0.11.3 -0.11.4 -0.11.5 -0.11.6 -0.11.7 -0.11.8 -0.12.0 -0.12.1 -0.12.2 -0.12.3 -0.13.0 -0.13.1 -0.13.2 -0.13.3 -0.13.4 -0.14.0 -0.15.0 -0.16.0 -0.17.0 -0.17.0.post1 -0.17.1 -0.17.2 -0.17.3 -0.17.4 -0.17.5 -0.17.6 -0.18.0 -0.18.1 -0.18.2 -0.18.3 -0.19.0 -0.20.0 -0.21.0 -0.21.1 -0.22.0 -!0.23.0 -!0.23.1 -!0.23.2 -!0.24.0 -!0.24.0.post1 -!0.25.0 -!0.26.0 -!0.27.0 -!0.27.0.post1 -!0.27.1 -!0.28.0 -!0.28.1 -!0.29.0 -!0.30.0 -!0.30.1 diff --git a/src/lumigo_opentelemetry/instrumentations/flask/tested_versions/3.7/flask b/src/lumigo_opentelemetry/instrumentations/flask/tested_versions/3.7/flask deleted file mode 100644 index 32509509..00000000 --- a/src/lumigo_opentelemetry/instrumentations/flask/tested_versions/3.7/flask +++ /dev/null @@ -1,54 +0,0 @@ -!0.5.1 -!0.5.2 -!0.6.1 -!0.7.1 -!0.7.2 -!0.8.1 -!0.10.1 -!0.11.1 -!0.12.1 -!0.12.2 -!0.12.3 -!0.12.4 -!0.12.5 -!1.0.1 -!1.0.2 -!1.0.3 -!1.0.4 -!1.1.0 -!1.1.1 -!1.1.2 -!1.1.3 -!1.1.4 -2.0.0 -2.0.0rc1 -2.0.0rc2 -2.0.1 -2.0.2 -2.0.3 -2.1.0 -2.1.1 -2.1.2 -2.1.3 -2.2.0 -2.2.1 -2.2.2 -2.2.3 -2.2.4 -2.2.5 -!2.3.0 -!2.3.1 -!2.3.2 -!2.3.3 -!3.0.0 -!3.0.1 -!3.0.2 -!3.0.3 -!0.10 -!0.11 -!0.12 -!0.6 -!0.7 -!0.8 -!0.9 -!1.0 diff --git a/src/lumigo_opentelemetry/instrumentations/grpcio/tested_versions/3.7/grpcio b/src/lumigo_opentelemetry/instrumentations/grpcio/tested_versions/3.7/grpcio deleted file mode 100644 index 129bd8b7..00000000 --- a/src/lumigo_opentelemetry/instrumentations/grpcio/tested_versions/3.7/grpcio +++ /dev/null @@ -1,67 +0,0 @@ -1.45.0 -1.45.0rc1 -1.46.0 -1.46.0rc1 -1.46.0rc2 -1.46.1 -1.46.3 -1.46.5 -1.47.0 -1.47.0rc1 -1.47.2 -1.47.5 -1.48.0 -1.48.0rc1 -1.48.1 -1.48.1 -1.48.2 -1.49.0 -1.49.0rc1 -1.49.0rc3 -1.49.1 -1.50.0 -1.50.0rc1 -1.51.0 -1.51.0rc1 -1.51.1 -1.51.3 -1.52.0 -1.52.0rc1 -1.53.0 -1.53.0rc2 -1.53.1 -1.53.2 -1.54.0 -1.54.0rc1 -1.54.2 -1.54.3 -1.55.0 -1.55.0rc1 -1.55.3 -1.56.0 -1.56.0rc2 -1.56.2 -1.57.0 -1.57.0rc1 -1.58.0 -1.58.0rc1 -1.59.0 -1.59.0rc1 -1.59.2 -1.59.3 -1.60.0 -1.60.0rc1 -1.60.1 -1.62.0 -1.62.0rc1 -1.62.1 -1.62.2 -!1.63.0 -!1.63.0rc1 -!1.63.0rc2 -!1.64.0 -!1.64.0rc1 -!1.64.1 -!1.65.0 -!1.65.0rc1 -!1.65.0rc2 diff --git a/src/lumigo_opentelemetry/instrumentations/kafka_python/tested_versions/3.7/kafka_python b/src/lumigo_opentelemetry/instrumentations/kafka_python/tested_versions/3.7/kafka_python deleted file mode 100644 index f564235a..00000000 --- a/src/lumigo_opentelemetry/instrumentations/kafka_python/tested_versions/3.7/kafka_python +++ /dev/null @@ -1,34 +0,0 @@ -!0.9.0 -!0.9.1 -!0.9.2 -!0.9.3 -!0.9.4 -!0.9.5 -!1.0.0 -!1.0.1 -!1.0.2 -!1.1.0 -!1.1.1 -!1.2.0 -!1.2.1 -!1.2.2 -!1.2.3 -!1.2.4 -!1.2.5 -!1.3.0 -!1.3.1 -!1.3.2 -!1.3.3 -!1.3.4 -!1.3.5 -!1.4.0 -!1.4.1 -!1.4.2 -!1.4.3 -!1.4.4 -!1.4.5 -!1.4.6 -!1.4.7 -2.0.0 -2.0.1 -2.0.2 diff --git a/src/lumigo_opentelemetry/instrumentations/pika/tested_versions/3.7/pika b/src/lumigo_opentelemetry/instrumentations/pika/tested_versions/3.7/pika deleted file mode 100644 index 47339078..00000000 --- a/src/lumigo_opentelemetry/instrumentations/pika/tested_versions/3.7/pika +++ /dev/null @@ -1,40 +0,0 @@ -!0.9.5 -!0.9.6 -!0.9.7 -!0.9.8 -!0.9.9 -!0.9.10 -!0.9.11 -!0.9.12 -!0.9.13 -!0.9.14 -!0.10.0 -!0.10.0b1 -!0.10.0b2 -!0.11.0 -!0.11.0b1 -!0.11.1 -!0.11.2 -!0.12.0 -!0.12.0b2 -!0.12.0b3 -!0.12.0b4 -!0.13.0 -!0.13.0b1 -!0.13.1 -!0.13.1b1 -1.0.0 -!1.0.0b1 -!1.0.0b2 -1.0.1 -1.1.0 -1.2.0 -1.2.1 -1.3.0 -!1.3.0rc1 -!1.3.0rc2 -!1.3.0rc3 -!1.3.0rc4 -1.3.0rc5 -1.3.1 -1.3.2 diff --git a/src/lumigo_opentelemetry/instrumentations/psycopg/tested_versions/3.7/psycopg b/src/lumigo_opentelemetry/instrumentations/psycopg/tested_versions/3.7/psycopg deleted file mode 100644 index 35c2cd67..00000000 --- a/src/lumigo_opentelemetry/instrumentations/psycopg/tested_versions/3.7/psycopg +++ /dev/null @@ -1,44 +0,0 @@ -!1.1.21 -!3.0b1 -!3.0.1 -!3.0.2 -!3.0.3 -!3.0.4 -!3.0.5 -!3.0.6 -!3.0.7 -!3.0.8 -!3.0.9 -!3.0.10 -!3.0.11 -!3.0.12 -!3.0.13 -!3.0.14 -!3.0.15 -!3.0.16 -!3.0.17 -!3.0.18 -3.1.1 -3.1.2 -3.1.3 -3.1.4 -3.1.5 -3.1.6 -3.1.7 -3.1.8 -3.1.9 -3.1.10 -3.1.11 -3.1.12 -3.1.13 -3.1.14 -3.1.15 -3.1.16 -3.1.17 -3.1.18 -3.1.19 -3.1.20 -!3.2.0 -!3.2.1 -!3.0 -3.1 diff --git a/src/lumigo_opentelemetry/instrumentations/psycopg/tested_versions/3.7/psycopg-binary b/src/lumigo_opentelemetry/instrumentations/psycopg/tested_versions/3.7/psycopg-binary deleted file mode 100644 index 17e36fc1..00000000 --- a/src/lumigo_opentelemetry/instrumentations/psycopg/tested_versions/3.7/psycopg-binary +++ /dev/null @@ -1,42 +0,0 @@ -!3.0b1 -!3.0.1 -!3.0.2 -!3.0.3 -!3.0.4 -!3.0.5 -!3.0.6 -!3.0.7 -!3.0.8 -!3.0.9 -!3.0.10 -!3.0.11 -!3.0.12 -!3.0.13 -!3.0.14 -!3.0.15 -!3.0.16 -!3.0.17 -!3.0.18 -3.1.1 -3.1.2 -3.1.3 -3.1.4 -3.1.5 -3.1.6 -3.1.8 -3.1.9 -3.1.10 -3.1.11 -3.1.12 -3.1.13 -3.1.14 -3.1.15 -3.1.16 -3.1.17 -3.1.18 -3.1.19 -3.1.20 -!3.2.0 -!3.2.1 -!3.0 -3.1 diff --git a/src/lumigo_opentelemetry/instrumentations/psycopg2/tested_versions/3.7/psycopg2 b/src/lumigo_opentelemetry/instrumentations/psycopg2/tested_versions/3.7/psycopg2 deleted file mode 100644 index 07114e34..00000000 --- a/src/lumigo_opentelemetry/instrumentations/psycopg2/tested_versions/3.7/psycopg2 +++ /dev/null @@ -1,40 +0,0 @@ -!2.4.4 -!2.4.5 -!2.4.6 -!2.5.1 -!2.5.2 -!2.5.3 -!2.5.4 -!2.5.5 -!2.6.1 -!2.6.2 -!2.7.1 -!2.7.2 -!2.7.3 -!2.7.3.1 -!2.7.3.2 -!2.7.4 -2.7.5 -2.7.6 -2.7.6.1 -2.7.7 -2.8.1 -2.8.2 -2.8.3 -2.8.4 -2.8.5 -2.8.6 -2.9.1 -2.9.2 -2.9.3 -2.9.4 -2.9.5 -2.9.6 -2.9.7 -2.9.8 -2.9.9 -!2.5 -!2.6 -!2.7 -2.8 -2.9 diff --git a/src/lumigo_opentelemetry/instrumentations/psycopg2/tested_versions/3.7/psycopg2-binary b/src/lumigo_opentelemetry/instrumentations/psycopg2/tested_versions/3.7/psycopg2-binary deleted file mode 100644 index 20236c9e..00000000 --- a/src/lumigo_opentelemetry/instrumentations/psycopg2/tested_versions/3.7/psycopg2-binary +++ /dev/null @@ -1,23 +0,0 @@ -!2.7.3.2 -!2.7.4 -2.7.5 -2.7.6 -2.7.6.1 -2.7.7 -2.8.1 -2.8.2 -2.8.3 -2.8.4 -2.8.5 -2.8.6 -2.9.1 -2.9.2 -2.9.3 -2.9.4 -2.9.5 -2.9.6 -2.9.7 -2.9.8 -2.9.9 -2.8 -2.9 diff --git a/src/lumigo_opentelemetry/instrumentations/pymongo/tested_versions/3.7/pymongo b/src/lumigo_opentelemetry/instrumentations/pymongo/tested_versions/3.7/pymongo deleted file mode 100644 index f62803a1..00000000 --- a/src/lumigo_opentelemetry/instrumentations/pymongo/tested_versions/3.7/pymongo +++ /dev/null @@ -1,58 +0,0 @@ -!2.9.1 -!2.9.2 -!2.9.3 -!2.9.4 -!2.9.5 -!3.0.3 -3.1.1 -3.2.1 -3.2.2 -3.3.0 -3.3.1 -!3.4.0 -3.5.0 -3.5.1 -3.6.0 -3.6.1 -3.7.0 -3.7.1 -3.7.2 -3.8.0 -3.9.0 -3.10.0 -3.10.1 -3.11.0 -3.11.1 -3.11.2 -3.11.3 -3.11.4 -3.12.0 -3.12.1 -3.12.2 -3.12.3 -3.13.0 -4.0.1 -4.0.2 -4.1.0 -4.1.1 -4.2.0 -4.3.2 -4.3.3 -4.4.0 -4.4.0b0 -4.4.1 -4.5.0 -4.6.0 -4.6.1 -4.6.2 -4.6.3 -4.7.0 -4.7.1 -4.7.2 -4.7.3 -!4.8.0 -!4.8.0b0 -!2.9 -3.1 -3.2 -4.0 diff --git a/src/lumigo_opentelemetry/instrumentations/pymysql/tested_versions/3.7/pymysql b/src/lumigo_opentelemetry/instrumentations/pymysql/tested_versions/3.7/pymysql deleted file mode 100644 index 544b20cf..00000000 --- a/src/lumigo_opentelemetry/instrumentations/pymysql/tested_versions/3.7/pymysql +++ /dev/null @@ -1,43 +0,0 @@ -!0.6.1 -!0.6.2 -!0.6.2-rc1 -!0.6.3 -!0.6.4 -!0.6.4.dev1 -!0.6.5 -!0.6.6 -!0.6.7 -!0.7.0 -!0.7.1 -!0.7.2 -!0.7.3 -!0.7.4 -!0.7.5 -!0.7.6 -!0.7.7 -!0.7.8 -!0.7.9 -!0.7.10 -!0.7.11 -!0.8.0 -!0.8.1 -0.9.0 -0.9.1 -0.9.2 -0.9.3 -0.10.0 -0.10.1 -1.0.0 -1.0.1 -1.0.2 -1.0.3 -!1.0.3rc1 -1.1.0 -1.1.0rc1 -1.1.0rc2 -1.1.1 -!0.2 -!0.3 -!0.4 -!0.5 -!0.6 diff --git a/src/lumigo_opentelemetry/instrumentations/redis/tested_versions/3.7/redis b/src/lumigo_opentelemetry/instrumentations/redis/tested_versions/3.7/redis deleted file mode 100644 index 814f2dce..00000000 --- a/src/lumigo_opentelemetry/instrumentations/redis/tested_versions/3.7/redis +++ /dev/null @@ -1,55 +0,0 @@ -4.1.1 -4.1.2 -4.1.3 -4.1.4 -4.2.0 -!4.2.0rc1 -!4.2.0rc2 -!4.2.0rc3 -4.2.1 -4.2.2 -4.3.0 -4.3.1 -4.3.2 -4.3.3 -4.3.4 -4.3.5 -4.3.6 -4.4.0 -4.4.0rc1 -4.4.0rc2 -4.4.0rc3 -4.4.0rc4 -4.4.1 -4.4.2 -4.4.3 -4.4.4 -4.5.0 -4.5.1 -4.5.2 -4.5.3 -4.5.4 -4.5.5 -4.6.0 -5.0.0 -5.0.0b1 -5.0.0b2 -5.0.0b3 -5.0.0b4 -5.0.0rc1 -5.0.0rc2 -5.0.1 -5.0.2 -5.0.3 -5.0.4 -5.0.5 -5.0.6 -5.0.7 -5.1.0a1 -!5.1.0b1 -!5.1.0b2 -!5.1.0b3 -!5.1.0b4 -!5.1.0b5 -!5.1.0b6 -!5.1.0b7 diff --git a/src/test/integration/logging/tests/test_logging.py b/src/test/integration/logging/tests/test_logging.py index 8d39c922..ecb2b7bc 100644 --- a/src/test/integration/logging/tests/test_logging.py +++ b/src/test/integration/logging/tests/test_logging.py @@ -60,10 +60,9 @@ def test_logging_enabled(self): ) for log in logs: - # "resource" is currently not a proper dictionary, but a string from a repr(...) call over the resource attributes. - # Pending a fix in https://github.com/open-telemetry/opentelemetry-python/pull/3346 - self.assertIn("'service.name': 'logging-app'", log["resource"]) - # self.assertEqual(log["resource"]["service.name"], "logging-app") + self.assertEqual( + log["resource"]["attributes"]["service.name"], "logging-app" + ) self.assertIn("attributes", logs[0]) diff --git a/src/test/integration/motor/tested_versions/3.7/motor b/src/test/integration/motor/tested_versions/3.7/motor deleted file mode 100644 index a4f52a5d..00000000 --- a/src/test/integration/motor/tested_versions/3.7/motor +++ /dev/null @@ -1 +0,0 @@ -3.2.0 \ No newline at end of file diff --git a/src/test/unit/test_tracer.py b/src/test/unit/test_tracer.py index e28f6849..dc2f3948 100644 --- a/src/test/unit/test_tracer.py +++ b/src/test/unit/test_tracer.py @@ -1,8 +1,9 @@ +import sys import unittest import httpretty from unittest import TestCase -from unittest.mock import patch +from unittest.mock import patch, Mock from httpretty import HTTPretty from json import loads @@ -103,3 +104,46 @@ def _test_dependency_report_called(self): assert resource_attributes and resource_attributes["lumigo.distro.version"] assert "process.environ" not in resource_attributes.keys() assert dependencies + + +class TestPythonVersionCheck(TestCase): + @patch("sys.version_info", Mock()) + def test_python_version_too_old(self): + # Mock version_info for Python 3.7 + sys.version_info.major = 3 + sys.version_info.minor = 7 + + with self.assertLogs("lumigo-opentelemetry", level="WARNING") as cm: + result = init() + + self.assertEqual(result, {}) + self.assertIn( + "Unsupported Python version 3.7; only Python 3.8 to 3.11 are supported.", + cm.output[0], + ) + + @patch("sys.version_info", Mock()) + def test_python_version_supported(self): + # Mock version_info for Python 3.8 + sys.version_info.major = 3 + sys.version_info.minor = 8 + + with self.assertLogs("lumigo-opentelemetry", level="WARNING"): + result = init() + + self.assertIsInstance(result, dict) + + @patch("sys.version_info", Mock()) + def test_python_version_too_new(self): + # Mock version_info for Python 3.12 + sys.version_info.major = 3 + sys.version_info.minor = 12 + + with self.assertLogs("lumigo-opentelemetry", level="WARNING") as cm: + result = init() + + self.assertEqual(result, {}) + self.assertIn( + "Unsupported Python version 3.12; only Python 3.8 to 3.11 are supported.", + cm.output[0], + )