Skip to content

NH-135284 Upgrade APM to OTel Python 1.42.1/0.63b1#778

Merged
tammy-baylis-swi merged 18 commits into
mainfrom
NH-135284-otel-python-1_42_1
Jun 4, 2026
Merged

NH-135284 Upgrade APM to OTel Python 1.42.1/0.63b1#778
tammy-baylis-swi merged 18 commits into
mainfrom
NH-135284-otel-python-1_42_1

Conversation

@tammy-baylis-swi

@tammy-baylis-swi tammy-baylis-swi commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Upgrades APM to OTel Python 1.42.1/0.63b1. This:

  • Drops Python 3.9 support
  • Changes otel.sdk.* metrics into an opt-in feature with OTEL_PYTHON_SDK_METRIC_ENABLED (was always-on before)
  • Can set traceflags as 00, 01, 02, 03 (latter is "sampled + random")

Note we're skipping the minor version 1.42.0/0.63b0 bump.

What else is going on here:

The Amazon 2023 "Python 3.10" verify-install test was actually using py3.9 before. To maintain some coverage it's now an Amazon 2 py3.10 test with a dedicated workflow job "install-tests-amazon2" in order to get over glibc compatibility issues with Amazon 2.

Also drop CentOS 8 support entirely since EOL Dec 31 2021 -- it was an artifact for py3.9 coverage.

dependabot Bot and others added 2 commits June 3, 2026 10:09
Bumps the otel-dependencies group with 1 update in the /lambda/tests directory: [opentelemetry-instrumentation-aws-lambda](https://github.com/open-telemetry/opentelemetry-python-contrib).


Updates `opentelemetry-instrumentation-aws-lambda` from 0.62b1 to 0.63b1
- [Release notes](https://github.com/open-telemetry/opentelemetry-python-contrib/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-python-contrib/commits)

---
updated-dependencies:
- dependency-name: opentelemetry-instrumentation-aws-lambda
  dependency-version: 0.63b1
  dependency-type: direct:production
  dependency-group: otel-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@tammy-baylis-swi tammy-baylis-swi force-pushed the NH-135284-otel-python-1_42_1 branch from 1f9ae94 to a984ce6 Compare June 3, 2026 17:17
@tammy-baylis-swi tammy-baylis-swi force-pushed the NH-135284-otel-python-1_42_1 branch from 9402b46 to c332c0e Compare June 3, 2026 18:40
@tammy-baylis-swi tammy-baylis-swi force-pushed the NH-135284-otel-python-1_42_1 branch from 1b69c3e to 4275c38 Compare June 3, 2026 19:38
if isinstance(
tracer_provider.sampler,
(ParentBasedSwSampler, HttpSampler, JsonSampler),
ParentBasedSwSampler | HttpSampler | JsonSampler,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newer python version ruff wanted this modernized.

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"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assert_trace_flags_(un)sampled asserts below these should be sufficient.

@tammy-baylis-swi tammy-baylis-swi marked this pull request as ready for review June 3, 2026 23:42
@tammy-baylis-swi tammy-baylis-swi requested a review from a team as a code owner June 3, 2026 23:42
Copilot AI review requested due to automatic review settings June 3, 2026 23:42
@tammy-baylis-swi tammy-baylis-swi requested a review from a team as a code owner June 3, 2026 23:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades the solarwinds-apm distribution to OpenTelemetry Python 1.42.1 / contrib 0.63b1, aligning the project’s runtime/tooling and install-test coverage with the updated OpenTelemetry stack and the stated drop of Python 3.9.

Changes:

  • Bumped OpenTelemetry API/SDK/exporter/instrumentation dependency pins across packaging and images; updated minimum supported Python to >=3.10.
  • Adjusted CI/install-test matrix and Docker-based install-test setup to remove Python 3.9 coverage and add Amazon Linux 2 Python 3.10 coverage.
  • Updated integration tests to validate traceflags via sampled/not-sampled semantics (allowing the newer supported flag values), rather than hard-coding 00/01.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/integration/test_xtraceoptions_validation.py Relaxes strict traceflags assertion; relies on sampled/not-sampled validation.
tests/integration/test_unsigned_tt.py Removes fixed 00/01 assertions to allow expanded traceflags behavior.
tests/integration/test_signed_tt.py Same as above for signed trigger-trace scenarios.
tests/integration/test_scenario_8.py Allows traceflags beyond 00/01 by using helper assertions.
tests/integration/test_scenario_1.py Same adjustment for scenario 1.
tests/docker/install/README.md Updates local install-test instructions to match new OS/Python coverage.
tests/docker/install/docker-compose.yml Removes py3.9 services; adds Amazon Linux 2 py3.10 services; keeps matrix for 3.10–3.13.
tests/docker/install/_helper_run_install_tests.sh Updates OS/Python detection and Amazon Linux dependency installation logic.
solarwinds_apm/api/init.py Uses Python 3.10+ union syntax for sampler type checking.
pyproject.toml Drops Python 3.9 support and bumps OTel dependency pins.
Makefile Updates build/test commands and manylinux wheel pathing to Python 3.10.
lambda/tests/requirements.txt Bumps OTel lambda instrumentation pin.
lambda/requirements.txt Bumps OTel SDK/exporter/instrumentation pins used for Lambda layer packaging.
lambda/requirements-nodeps.txt Bumps OTel “nodeps” pins for Lambda packaging.
image/requirements.txt Bumps OTel dependency pins used for the auto-instrumentation image.
image/Dockerfile-beta Switches build stages from Python 3.9 to 3.10 for beta image build.
image/Dockerfile Switches build stages from Python 3.9 to 3.10 for main image build.
docker-compose.yml Updates manylinux dev container bootstrap to use Python 3.10.
dev-requirements.txt Bumps OTel test/instrumentation pins; updates Flask environment markers.
.github/workflows/verify_install.yaml Updates Linux install-test matrix (drop py3.9; add dedicated Amazon2 py3.10 coverage).
.github/workflows/verify_install_windows.yaml Drops Windows install testing on Python 3.9.
.github/workflows/verify_install_macos.yaml Drops macOS install testing on Python 3.9.
.github/workflows/run_tox_tests.yaml Drops Python 3.9 from tox test matrix.
.github/workflows/run_tox_ruff_format.yaml Drops Python 3.9 from ruff/format workflow matrix.
.github/workflows/run_tox_lint_format.yaml Drops Python 3.9 from lint/format workflow matrix.
.github/workflows/build_publish_lambda_layer.yaml Drops Python 3.9 from Lambda layer build/publish matrix and runtime list.

Comment thread tests/docker/install/_helper_run_install_tests.sh Outdated
Comment thread tests/docker/install/README.md Outdated
Comment thread dev-requirements.txt Outdated
tammy-baylis-swi and others added 2 commits June 3, 2026 17:31
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…`sh` (#779)

* Initial plan

* Fix install helper to use POSIX shell conditionals

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
cheempz
cheempz previously approved these changes Jun 4, 2026

@cheempz cheempz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a couple nits ;)

Comment thread .github/workflows/verify_install.yaml Outdated
Comment thread .github/workflows/verify_install.yaml Outdated
@tammy-baylis-swi

Copy link
Copy Markdown
Contributor Author

LGTM with a couple nits ;)

Thanks @cheempz ! Addressed, please have another look

@cheempz cheempz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the revisit!

@tammy-baylis-swi tammy-baylis-swi merged commit 6e415e1 into main Jun 4, 2026
49 checks passed
@tammy-baylis-swi tammy-baylis-swi deleted the NH-135284-otel-python-1_42_1 branch June 4, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants