Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
fe6122f
add package scaffolding
herin049 Jun 19, 2026
05a0a20
add conversion logic
herin049 Jun 19, 2026
37f40ac
rework package structure
herin049 Jun 19, 2026
b409947
publish/unpublish/update logic
herin049 Jun 19, 2026
ed84540
add encoding logic
herin049 Jun 19, 2026
c384f9f
update generate-workflows.py
herin049 Jun 22, 2026
4d332e0
Merge branch 'main' into feat/profiles-context
herin049 Jun 22, 2026
6c3abc7
fix formatting
herin049 Jun 22, 2026
3556439
fix codespell issues
herin049 Jun 22, 2026
9e50fed
fix test assertions and remove pypy3
herin049 Jun 22, 2026
f2031c3
rerun generate-workflows
herin049 Jun 22, 2026
5d169fb
remove process context tests from typecheck
herin049 Jun 22, 2026
74a1c40
update release workflow
herin049 Jun 22, 2026
23f4267
fix workflow bugs
herin049 Jun 22, 2026
bd309c2
update maturin action commit pin
herin049 Jun 22, 2026
8b4e7b9
small tweak
herin049 Jun 22, 2026
1f4e452
small tweak to tests
herin049 Jun 22, 2026
47fc876
Merge branch 'main' into feat/profiles-context
herin049 Jun 23, 2026
c774c6b
change update logic
herin049 Jun 24, 2026
a39dded
update comments
herin049 Jun 24, 2026
5e6c845
Update opentelemetry-process-context/pyproject.toml
herin049 Jun 24, 2026
66d6e50
combine publish/update into single function
herin049 Jun 24, 2026
13deb9e
switch to using protoc bash script for code generation
herin049 Jun 24, 2026
5eabeba
Merge branch 'main' into feat/profiles-context
herin049 Jun 24, 2026
052906d
Potential fix for pull request finding
herin049 Jun 24, 2026
e7902d9
Update import statement for publish_context
herin049 Jun 24, 2026
ea143c9
address Copilot comments
herin049 Jun 25, 2026
1103446
refactor tests and make implementation fork safe
herin049 Jun 25, 2026
c03eb5e
fix pre-commit error
herin049 Jun 25, 2026
c9d95f9
Merge branch 'main' into feat/profiles-context
herin049 Jun 25, 2026
b21fc4c
update eachdist.ini
herin049 Jun 25, 2026
ee9275e
Merge branch 'main' into feat/profiles-context
herin049 Jun 25, 2026
9397c1c
small refactor
herin049 Jun 26, 2026
9882a89
update workflows
herin049 Jun 26, 2026
dd13bba
Merge branch 'main' into feat/profiles-context
herin049 Jun 26, 2026
e06d969
fix mmap leak scenario
herin049 Jun 26, 2026
48dd8ca
add explicit manifest-path to pyproject.toml
herin049 Jun 26, 2026
9edc8e7
Merge branch 'main' into feat/profiles-context
herin049 Jun 26, 2026
ae9de41
remove pre/post fork handlers
herin049 Jun 27, 2026
891c801
update package README.rst
herin049 Jun 28, 2026
8373640
add support for publishing extra attributes
herin049 Jun 28, 2026
6209666
update type annotations
herin049 Jun 29, 2026
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
1 change: 1 addition & 0 deletions .changelog/5337.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`opentelemetry-process-context`: implement process context publishing (OTEP-4719)
4 changes: 2 additions & 2 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[codespell]
# skipping auto generated folders
skip = ./.tox,./.mypy_cache,./docs/_build,./target,*/LICENSE,./venv,.git,./opentelemetry-semantic-conventions,*-requirements*.txt
ignore-words-list = ans,ue,ot,hist,ro,astroid
skip = ./.tox,./.mypy_cache,./docs/_build,./target,*/LICENSE,./venv,.git,./opentelemetry-semantic-conventions,*-requirements*.txt,./opentelemetry-process-context/rust/target
ignore-words-list = ans,ue,ot,hist,ro,astroid,crate
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
uses: ./.github/workflows/misc.yml
lint:
uses: ./.github/workflows/lint.yml
rust:
uses: ./.github/workflows/rust.yml
tests:
uses: ./.github/workflows/test.yml
contrib:
Expand All @@ -39,6 +41,7 @@ jobs:
needs:
- misc
- lint
- rust
- tests
- contrib
runs-on: ubuntu-latest
Expand Down
49 changes: 45 additions & 4 deletions .github/workflows/generate_workflows.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from collections import defaultdict
from pathlib import Path
from re import compile as re_compile
from re import fullmatch

from jinja2 import Environment, FileSystemLoader
from tox.config.cli.parse import get_options
from tox.config.main import Config
from tox.config.sets import CoreConfigSet
from tox.config.source.tox_ini import ToxIni
from tox.session.state import State
Expand All @@ -18,7 +20,7 @@
)


def get_tox_envs(tox_ini_path: Path) -> list:
def get_core_config_set(tox_ini_path: Path) -> tuple[Config, CoreConfigSet]:
tox_ini = ToxIni(tox_ini_path)

conf = State(get_options(), []).conf
Expand All @@ -40,11 +42,39 @@ def get_tox_envs(tox_ini_path: Path) -> list:
)
)

return core_config_set.load("env_list")
return conf, core_config_set


def get_tox_envs(tox_ini_path: Path) -> list:
return get_core_config_set(tox_ini_path)[1].load("env_list")


def get_env_platforms(tox_ini_path: Path) -> dict[str, str]:
conf, core_config_set = get_core_config_set(tox_ini_path)

platforms = {}

for env_name in core_config_set.load("env_list"):
env_config_set = conf.get_env(env_name)
env_config_set.add_config(
keys=["platform"],
of_type=str,
default="",
desc="platform constraint regex",
)
platforms[env_name] = env_config_set.load("platform")

return platforms

def get_test_job_datas(tox_envs: list, operating_systems: list) -> list:

def get_test_job_datas(
tox_envs: list, operating_systems: list, env_platforms: dict[str, str]
) -> list:
os_alias = {"ubuntu-latest": "Ubuntu", "windows-latest": "Windows"}
os_sys_platform = {
"ubuntu-latest": "linux",
"windows-latest": "win32",
}

python_version_alias = {
"pypy3": "pypy-3.10",
Expand All @@ -59,12 +89,19 @@ def get_test_job_datas(tox_envs: list, operating_systems: list) -> list:
test_job_datas = []

for operating_system in operating_systems:
sys_platform = os_sys_platform[operating_system]

for tox_env in tox_envs:
tox_test_env_match = _tox_test_env_regex.match(tox_env)

if tox_test_env_match is None:
continue

if (platform := env_platforms.get(tox_env, "")) and not fullmatch(
platform, sys_platform
):
continue

groups = tox_test_env_match.groupdict()

aliased_python_version = python_version_alias[
Expand Down Expand Up @@ -156,7 +193,11 @@ def generate_test_workflow(
tox_ini_path: Path, workflow_directory_path: Path, operating_systems
) -> None:
_generate_workflow(
get_test_job_datas(get_tox_envs(tox_ini_path), operating_systems),
get_test_job_datas(
get_tox_envs(tox_ini_path),
operating_systems,
get_env_platforms(tox_ini_path),
),
"test",
workflow_directory_path,
)
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,25 @@ jobs:
- name: Run tests
run: tox -e lint-opentelemetry-exporter-zipkin-json

lint-opentelemetry-process-context:
name: opentelemetry-process-context
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4

- name: Set up Python 3.14
uses: actions/setup-python@v5
with:
python-version: "3.14"

- name: Install tox
run: pip install tox-uv

- name: Run tests
run: tox -e lint-opentelemetry-process-context

lint-opentelemetry-propagator-b3:
name: opentelemetry-propagator-b3
runs-on: ubuntu-latest
Expand Down
83 changes: 79 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,72 @@ permissions:
contents: read

jobs:
build-process-context-wheels:
name: process-context wheels (${{ matrix.platform.target }} ${{ matrix.platform.manylinux }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:

@xrmx xrmx Jun 29, 2026

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.

Does the epbf profiler works on these many platforms? I think it runs on arm64 and amd64 only.

# manylinux
- { target: x86_64, manylinux: auto }
- { target: x86, manylinux: auto }
- { target: aarch64, manylinux: auto }
- { target: armv7, manylinux: auto }
- { target: ppc64le, manylinux: auto }
- { target: s390x, manylinux: auto }
# musllinux
- { target: x86_64, manylinux: musllinux_1_2 }
- { target: x86, manylinux: musllinux_1_2 }
- { target: aarch64, manylinux: musllinux_1_2 }
- { target: armv7, manylinux: musllinux_1_2 }
steps:
- run: |
if [[ $GITHUB_REF_NAME != release/* ]]; then
echo this workflow should only be run against release branches
exit 1
fi

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Build wheels
uses: PyO3/maturin-action@3e2bdf6ba6453a61e649744019b8a2d906c7eb38 # v1.51.0
with:
target: ${{ matrix.platform.target }}
manylinux: ${{ matrix.platform.manylinux }}
args: --release --out dist --manifest-path opentelemetry-process-context/rust/Cargo.toml
sccache: 'true'

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: process-context-wheels-${{ matrix.platform.target }}-${{ matrix.platform.manylinux }}
path: dist

build-process-context-sdist:
name: process-context sdist
runs-on: ubuntu-latest
steps:
- run: |
if [[ $GITHUB_REF_NAME != release/* ]]; then
echo this workflow should only be run against release branches
exit 1
fi

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Build sdist
uses: PyO3/maturin-action@3e2bdf6ba6453a61e649744019b8a2d906c7eb38 # v1.51.0
with:
command: sdist
args: --out dist --manifest-path opentelemetry-process-context/rust/Cargo.toml

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: process-context-sdist
path: dist

release:
needs: [build-process-context-wheels, build-process-context-sdist]
permissions:
contents: write # required for creating GitHub releases
runs-on: ubuntu-latest
Expand All @@ -17,7 +82,7 @@ jobs:
exit 1
fi

- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Install toml
run: pip install toml
Expand Down Expand Up @@ -64,21 +129,31 @@ jobs:

# check out main branch to verify there won't be problems with merging the change log
# at the end of this workflow
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: main

# back to the release branch
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# next few steps publish to pypi
- uses: actions/setup-python@v5
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.10'

- name: Build wheels
run: ./scripts/build.sh

# Native wheels + sdist for opentelemetry-process-context, built by the
# build-process-context-* jobs above are merged into dist/ so the twine
# uploads below publish them alongside the pure Python packages.
- name: Download process-context wheels and sdist
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
pattern: process-context-*
merge-multiple: true
path: dist

- name: Install twine
run: |
pip install twine
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This file is not auto-generated. See .github/workflows/templates/ for generated CI files.

name: Rust

on:
workflow_call:

permissions:
contents: read

jobs:
fmt-process-context:
name: cargo fmt (opentelemetry-process-context)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Update Rust toolchain
run: rustup update stable && rustup default stable
- name: cargo fmt
run: cargo fmt --check --manifest-path opentelemetry-process-context/rust/Cargo.toml

clippy-process-context:
name: cargo clippy (opentelemetry-process-context)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Update Rust toolchain
run: rustup update stable && rustup default stable
- name: cargo clippy
run: cargo clippy --manifest-path opentelemetry-process-context/rust/Cargo.toml -- -D warnings

test-process-context:
name: cargo test (opentelemetry-process-context)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Update Rust toolchain
run: rustup update stable && rustup default stable
- name: cargo test
run: cargo test --manifest-path opentelemetry-process-context/rust/Cargo.toml
3 changes: 3 additions & 0 deletions .github/workflows/templates/ci.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
uses: ./.github/workflows/misc.yml
lint:
uses: ./.github/workflows/lint.yml
rust:
uses: ./.github/workflows/rust.yml
tests:
uses: ./.github/workflows/test.yml
contrib:
Expand All @@ -39,6 +41,7 @@ jobs:
needs:
- misc
- lint
- rust
- tests
- contrib
runs-on: ubuntu-latest
Expand Down
Loading
Loading