Skip to content
Draft
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
70 changes: 70 additions & 0 deletions .github/workflows/core_contrib_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3632,6 +3632,76 @@ jobs:
- name: Run tests
run: uv run --no-sync tox -e py310-test-util-http -- -ra

py310-test-agent-oldest:
name: agent-oldest
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout contrib repo @ SHA - ${{ env.CONTRIB_REPO_SHA }}
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
repository: open-telemetry/opentelemetry-python-contrib
ref: ${{ env.CONTRIB_REPO_SHA }}
persist-credentials: false

- name: Checkout core repo @ SHA - ${{ env.CORE_REPO_SHA }}
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
repository: open-telemetry/opentelemetry-python
ref: ${{ env.CORE_REPO_SHA }}
path: opentelemetry-python
persist-credentials: false

- name: Set up Python 3.10
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.10"
architecture: "x64"

- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3

- name: Install tox
run: uv sync --locked --only-group tox

- name: Run tests
run: uv run --no-sync tox -e py310-test-agent-oldest -- -ra

py310-test-agent-latest:
name: agent-latest
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout contrib repo @ SHA - ${{ env.CONTRIB_REPO_SHA }}
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
repository: open-telemetry/opentelemetry-python-contrib
ref: ${{ env.CONTRIB_REPO_SHA }}
persist-credentials: false

- name: Checkout core repo @ SHA - ${{ env.CORE_REPO_SHA }}
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
repository: open-telemetry/opentelemetry-python
ref: ${{ env.CORE_REPO_SHA }}
path: opentelemetry-python
persist-credentials: false

- name: Set up Python 3.10
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.10"
architecture: "x64"

- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3

- name: Install tox
run: uv sync --locked --only-group tox

- name: Run tests
run: uv run --no-sync tox -e py310-test-agent-latest -- -ra

py310-test-exporter-credential-provider-gcp:
name: exporter-credential-provider-gcp
runs-on: ubuntu-latest
Expand Down
246 changes: 246 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13921,6 +13921,252 @@ jobs:
- name: Run tests
run: uv run --no-sync tox -e pypy3-test-util-http -- -ra

py310-test-agent-oldest_ubuntu-latest:
name: agent-oldest 3.10 Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false

- name: Set up Python 3.10
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.10"

- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3

- name: Install tox
run: uv sync --locked --only-group tox

- name: Run tests
run: uv run --no-sync tox -e py310-test-agent-oldest -- -ra

py310-test-agent-latest_ubuntu-latest:
name: agent-latest 3.10 Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false

- name: Set up Python 3.10
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.10"

- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3

- name: Install tox
run: uv sync --locked --only-group tox

- name: Run tests
run: uv run --no-sync tox -e py310-test-agent-latest -- -ra

py311-test-agent-oldest_ubuntu-latest:
name: agent-oldest 3.11 Ubuntu
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false

- name: Set up Python 3.11
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.11"

- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3

- name: Install tox
run: uv sync --locked --only-group tox

- name: Run tests
run: uv run --no-sync tox -e py311-test-agent-oldest -- -ra

py311-test-agent-latest_ubuntu-latest:
name: agent-latest 3.11 Ubuntu
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false

- name: Set up Python 3.11
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.11"

- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3

- name: Install tox
run: uv sync --locked --only-group tox

- name: Run tests
run: uv run --no-sync tox -e py311-test-agent-latest -- -ra

py312-test-agent-oldest_ubuntu-latest:
name: agent-oldest 3.12 Ubuntu
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false

- name: Set up Python 3.12
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.12"

- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3

- name: Install tox
run: uv sync --locked --only-group tox

- name: Run tests
run: uv run --no-sync tox -e py312-test-agent-oldest -- -ra

py312-test-agent-latest_ubuntu-latest:
name: agent-latest 3.12 Ubuntu
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false

- name: Set up Python 3.12
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.12"

- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3

- name: Install tox
run: uv sync --locked --only-group tox

- name: Run tests
run: uv run --no-sync tox -e py312-test-agent-latest -- -ra

py313-test-agent-oldest_ubuntu-latest:
name: agent-oldest 3.13 Ubuntu
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false

- name: Set up Python 3.13
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.13"

- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3

- name: Install tox
run: uv sync --locked --only-group tox

- name: Run tests
run: uv run --no-sync tox -e py313-test-agent-oldest -- -ra

py313-test-agent-latest_ubuntu-latest:
name: agent-latest 3.13 Ubuntu
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false

- name: Set up Python 3.13
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.13"

- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3

- name: Install tox
run: uv sync --locked --only-group tox

- name: Run tests
run: uv run --no-sync tox -e py313-test-agent-latest -- -ra

py314-test-agent-oldest_ubuntu-latest:
name: agent-oldest 3.14 Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false

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

- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3

- name: Install tox
run: uv sync --locked --only-group tox

- name: Run tests
run: uv run --no-sync tox -e py314-test-agent-oldest -- -ra

py314-test-agent-latest_ubuntu-latest:
name: agent-latest 3.14 Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false

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

- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3

- name: Install tox
run: uv sync --locked --only-group tox

- name: Run tests
run: uv run --no-sync tox -e py314-test-agent-latest -- -ra

py310-test-exporter-credential-provider-gcp_ubuntu-latest:
name: exporter-credential-provider-gcp 3.10 Ubuntu
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# C extensions
*.so
*.pyd

# Packages
*.egg
Expand Down
34 changes: 34 additions & 0 deletions agent/opentelemetry-agent/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
OpenTelemetry Python Agent
==========================

A self-contained OpenTelemetry distribution: the API, SDK, exporters, the auto-instrumentation framework
and instrumentations, with all their dependencies vendored under ``opentelemetry.agent._vendor``. It can be
installed into any Python 3.10+ environment without affecting (or being affected by) the application's own
packages.

Usage
-----

::

pip install opentelemetry-agent
opentelemetry-instrument python app.py

``opentelemetry-instrument`` takes the same options and ``OTEL_*`` environment variables as the one from
``opentelemetry-instrumentation``. The ``otlp`` exporter uses ``http/protobuf``: the gRPC exporters aren't
included.

Isolation
---------

* Only the vendored plugins (exporters, propagators, samplers, resource detectors) and instrumentations are
discovered; OpenTelemetry packages installed in the application's environment aren't used.
* The application's own ``opentelemetry-api`` (if any) is a separate copy, bridged to the agent: spans it
records are exported by the agent's SDK, and they parent (and are parented by) the agent's
instrumentation spans. ``opentelemetry-instrument`` selects the bridge by setting ``OTEL_PYTHON_CONTEXT``
and ``OTEL_PYTHON_TRACER_PROVIDER`` to ``opentelemetry_agent``, unless they're already set; a tracer
provider set by the application before its first ``get_tracer_provider()`` call is kept. Metrics and
logs recorded with the application's API don't reach the agent's providers yet. Tested with
``opentelemetry-api`` 1.16 and later.
* ``opentelemetry-instrumentation`` installs an ``opentelemetry-instrument`` script as well; when both are
installed, the package installed last owns it.
Loading
Loading