Skip to content

Commit

Permalink
Merge branch 'main' into align-proc-args-to-spec-definition
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirdavid authored Jul 11, 2024
2 parents 4ccdae3 + 732ea8a commit 1e4507a
Show file tree
Hide file tree
Showing 85 changed files with 50 additions and 162 deletions.
27 changes: 5 additions & 22 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,25 @@ on:
jobs:
sdk-benchmarks:
env:
py312: "3.12"
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-sdk-${{ matrix.os }}
runs-on: self-hosted
strategy:
# Ensures the entire test matrix is run, even if one permutation fails
fail-fast: false
matrix:
python-version: [py312]
os: [ubuntu-20.04, windows-2019]
steps:
- name: Checkout Core Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4
- name: Set up Python ${{ env[matrix.python-version] }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env[matrix.python-version] }}
python-version: "3.12"
architecture: 'x64'
- name: Install tox
run: pip install tox
- name: Cache tox environment
# Preserves .tox directory between runs for faster installs
uses: actions/cache@v4
with:
path: |
.tox
~/.cache/pip
key: v3-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini',
'dev-requirements.txt') }}-core
- name: Run tox
run: tox -f ${{ matrix.python-version }}-sdk -- -k opentelemetry-sdk/tests/performance/benchmarks --benchmark-json=opentelemetry-sdk/tests/output.json
run: tox -e benchmark-opentelemetry-sdk -- -k opentelemetry-sdk/benchmarks --benchmark-json=opentelemetry-sdk/output.json
- name: Report on SDK benchmark results
uses: benchmark-action/github-action-benchmark@v1
with:
name: OpenTelemetry Python SDK Benchmarks - Python ${{ env[matrix.python-version ]}} - SDK
name: OpenTelemetry Python SDK Benchmarks
tool: pytest
output-file-path: opentelemetry-sdk/tests/output.json
output-file-path: opentelemetry-sdk/output.json
gh-pages-branch: gh-pages
github-token: ${{ secrets.GITHUB_TOKEN }}
# Make a commit on `gh-pages` with benchmarks from previous step
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,7 @@ jobs:
- name: Windows does not let git check out files with long names
if: ${{ matrix.os == 'windows-2019'}}
run: git config --system core.longpaths true
- name: run pytest with --benchmark-skip
if: ${{ matrix.package == 'sdk' || matrix.package == 'exporter-otlp-proto-grpc' }}
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-skip
- name: run pytest without --benchmark-skip
if: ${{ !(matrix.package == 'sdk' || matrix.package == 'exporter-otlp-proto-grpc') }}
- name: run tox
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra
misc:
strategy:
Expand Down Expand Up @@ -217,4 +213,4 @@ jobs:
key: v3-tox-cache-${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os
}}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-contrib
- name: run tox
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-skip
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ docs/examples/django/db.sqlite3

# Semantic conventions
scripts/semconv/semantic-conventions

# Benchmark result files
*-benchmark.json
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ The continuation integration overrides that environment variable with as per the

### Benchmarks

Running the `tox` tests also runs the performance tests if any are available. Benchmarking tests are done with `pytest-benchmark` and they output a table with results to the console.
Some packages have benchmark tests. To run them, run `tox -f benchmark`. Benchmark tests use `pytest-benchmark` and they output a table with results to the console.

To write benchmarks, simply use the [pytest benchmark fixture](https://pytest-benchmark.readthedocs.io/en/latest/usage.html#usage) like the following:

Expand All @@ -142,10 +142,10 @@ def test_simple_start_span(benchmark):
benchmark(benchmark_start_as_current_span, "benchmarkedSpan", 42)
```

Make sure the test file is under the `tests/performance/benchmarks/` folder of
Make sure the test file is under the `benchmarks/` folder of
the package it is benchmarking and further has a path that corresponds to the
file in the package it is testing. Make sure that the file name begins with
`test_benchmark_`. (e.g. `opentelemetry-sdk/tests/performance/benchmarks/trace/propagation/test_benchmark_b3_format.py`)
`test_benchmark_`. (e.g. `opentelemetry-sdk/benchmarks/trace/propagation/test_benchmark_b3_format.py`)

## Pull Requests

Expand Down
4 changes: 2 additions & 2 deletions docs/getting_started/tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
asgiref==3.7.2
attrs==23.1.0
certifi==2023.7.22
certifi==2024.7.4
charset-normalizer==2.0.12
click==8.1.7
Deprecated==1.2.14
Expand All @@ -21,7 +21,7 @@ typing_extensions==4.8.0
urllib3==1.26.19
Werkzeug==3.0.3
wrapt==1.15.0
zipp==3.17.0
zipp==3.19.2
-e opentelemetry-semantic-conventions
-e opentelemetry-api
-e opentelemetry-sdk
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pytest==7.4.4
tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
zipp==3.19.2
-e opentelemetry-api
-e opentelemetry-sdk
-e tests/opentelemetry-test-utils
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pytest==7.4.4
tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
zipp==3.19.2
-e opentelemetry-api
-e opentelemetry-sdk
-e opentelemetry-semantic-conventions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pytest==7.4.4
tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
zipp==3.19.2
-e opentelemetry-api
-e opentelemetry-sdk
-e opentelemetry-semantic-conventions
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pytest-benchmark==4.0.0
tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
zipp==3.19.2
-e opentelemetry-api
-e tests/opentelemetry-test-utils
-e exporter/opentelemetry-exporter-otlp-proto-common
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pytest-benchmark==4.0.0
tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
zipp==3.19.2
-e opentelemetry-api
-e tests/opentelemetry-test-utils
-e exporter/opentelemetry-exporter-otlp-proto-common
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
asgiref==3.7.2
certifi==2024.2.2
certifi==2024.7.4
charset-normalizer==3.3.2
Deprecated==1.2.14
googleapis-common-protos==1.62.0
Expand All @@ -18,7 +18,7 @@ tomli==2.0.1
typing_extensions==4.10.0
urllib3==2.2.2
wrapt==1.16.0
zipp==3.17.0
zipp==3.19.2
-e opentelemetry-api
-e tests/opentelemetry-test-utils
-e exporter/opentelemetry-exporter-otlp-proto-common
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
asgiref==3.7.2
certifi==2024.2.2
certifi==2024.7.4
charset-normalizer==3.3.2
Deprecated==1.2.14
googleapis-common-protos==1.62.0
Expand All @@ -18,7 +18,7 @@ tomli==2.0.1
typing_extensions==4.10.0
urllib3==2.2.2
wrapt==1.16.0
zipp==3.17.0
zipp==3.19.2
-e opentelemetry-api
-e tests/opentelemetry-test-utils
-e exporter/opentelemetry-exporter-otlp-proto-common
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion exporter/opentelemetry-exporter-otlp/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pytest==7.4.4
tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
zipp==3.19.2
-e opentelemetry-api
-e tests/opentelemetry-test-utils
-e exporter/opentelemetry-exporter-otlp-proto-common
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pytest==7.4.4
tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
zipp==3.19.2
-e opentelemetry-api
-e opentelemetry-sdk
-e tests/opentelemetry-test-utils
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
asgiref==3.7.2
certifi==2024.2.2
certifi==2024.7.4
charset-normalizer==3.3.2
Deprecated==1.2.14
idna==3.7
Expand All @@ -14,7 +14,7 @@ tomli==2.0.1
typing_extensions==4.10.0
urllib3==2.2.2
wrapt==1.16.0
zipp==3.17.0
zipp==3.19.2
-e opentelemetry-api
-e opentelemetry-sdk
-e opentelemetry-semantic-conventions
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
asgiref==3.7.2
certifi==2024.2.2
certifi==2024.7.4
charset-normalizer==3.3.2
Deprecated==1.2.14
idna==3.7
Expand All @@ -15,7 +15,7 @@ tomli==2.0.1
typing_extensions==4.10.0
urllib3==2.2.2
wrapt==1.16.0
zipp==3.17.0
zipp==3.19.2
-e opentelemetry-api
-e exporter/opentelemetry-exporter-zipkin-json
-e opentelemetry-sdk
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pytest==7.4.4
tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
zipp==3.19.2
-e opentelemetry-api
-e exporter/opentelemetry-exporter-zipkin-json
-e exporter/opentelemetry-exporter-zipkin-proto-http
Expand Down
Empty file added opentelemetry-api/py.typed
Empty file.
2 changes: 1 addition & 1 deletion opentelemetry-api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ default_tracer_provider = "opentelemetry.trace:NoOpTracerProvider"
Homepage = "https://github.com/open-telemetry/opentelemetry-python/tree/main/opentelemetry-api"

[tool.hatch.version]
path = "src/opentelemetry/version.py"
path = "src/opentelemetry/version/__init__.py"

[tool.hatch.build.targets.sdist]
include = [
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion opentelemetry-api/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pytest==7.4.4
tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
zipp==3.19.2
-e opentelemetry-sdk
-e opentelemetry-semantic-conventions
-e tests/opentelemetry-test-utils
Expand Down
Empty file added opentelemetry-proto/py.typed
Empty file.
2 changes: 1 addition & 1 deletion opentelemetry-proto/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies = [
Homepage = "https://github.com/open-telemetry/opentelemetry-python/tree/main/opentelemetry-proto"

[tool.hatch.version]
path = "src/opentelemetry/proto/version.py"
path = "src/opentelemetry/proto/version/__init__.py"

[tool.hatch.build.targets.sdist]
include = [
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-proto/test-requirements-0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ pytest==7.4.4
tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
zipp==3.19.2
-e opentelemetry-proto
2 changes: 1 addition & 1 deletion opentelemetry-proto/test-requirements-1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ pytest==7.4.4
tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
zipp==3.19.2
-e opentelemetry-proto
1 change: 1 addition & 0 deletions opentelemetry-sdk/benchmark-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest-benchmark==4.0.0
Empty file added opentelemetry-sdk/py.typed
Empty file.
2 changes: 1 addition & 1 deletion opentelemetry-sdk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ process = "opentelemetry.sdk.resources:ProcessResourceDetector"
Homepage = "https://github.com/open-telemetry/opentelemetry-python/tree/main/opentelemetry-sdk"

[tool.hatch.version]
path = "src/opentelemetry/sdk/version.py"
path = "src/opentelemetry/sdk/version/__init__.py"

[tool.hatch.build.targets.sdist]
include = [
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion opentelemetry-sdk/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pytest-benchmark==4.0.0
tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
zipp==3.19.2
-e tests/opentelemetry-test-utils
-e opentelemetry-api
-e opentelemetry-semantic-conventions
Expand Down

This file was deleted.

Loading

0 comments on commit 1e4507a

Please sign in to comment.