Skip to content

Commit

Permalink
chore: merge current main
Browse files Browse the repository at this point in the history
  • Loading branch information
a-recknagel committed Jul 19, 2024
2 parents 79ce99a + d4e13bd commit 8ecd6a7
Show file tree
Hide file tree
Showing 160 changed files with 1,795 additions and 853 deletions.
2 changes: 1 addition & 1 deletion .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
skip = ./.tox,./.mypy_cache,./docs/_build,./target,*/LICENSE,./venv,.git,./opentelemetry-semantic-conventions,*-requirements*.txt
ignore-words-list = ans,ue,ot,hist,ro
28 changes: 5 additions & 23 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,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
54 changes: 54 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Lint tests

on:
push:
branches-ignore:
- 'release/*'
pull_request:

jobs:
lint-3_12:
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
package:
- "opentelemetry-api"
- "opentelemetry-proto"
- "opentelemetry-sdk"
- "opentelemetry-semantic-conventions"
- "opentelemetry-getting-started"
- "opentelemetry-opentracing-shim"
- "opentelemetry-opencensus-shim"
- "opentelemetry-exporter-opencensus"
- "opentelemetry-exporter-otlp-proto-common"
- "opentelemetry-exporter-otlp-combined"
- "opentelemetry-exporter-otlp-proto-grpc"
- "opentelemetry-exporter-otlp-proto-http"
- "opentelemetry-exporter-otlp-proto-prometheus"
- "opentelemetry-exporter-otlp-proto-zipkin-combined"
- "opentelemetry-exporter-otlp-proto-zipkin-proto-http"
- "opentelemetry-exporter-otlp-proto-zipkin-json"
- "opentelemetry-propagator-b3"
- "opentelemetry-propagator-jaeger"
- "opentelemetry-test-utils"
os: [ubuntu-20.04]
runs-on: ubuntu-20.04
steps:
- name: Checkout Core Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- 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: v7-build-tox-cache-${{ matrix.package }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
- name: run tox
run: tox -e lint-${{ matrix.package }}
13 changes: 7 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
# Otherwise, set variable to the commit of your branch on
# opentelemetry-python-contrib which is compatible with these Core repo
# changes.
CONTRIB_REPO_SHA: 7d4573da89c7aef748614e6f1511be3eddf5b230
CONTRIB_REPO_SHA: main

# This is needed because we do not clone the core repo in contrib builds anymore.
# When running contrib builds as part of core builds, we use actions/checkout@v4 which
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
- "exporter-zipkin-combined"
- "exporter-zipkin-proto-http"
- "exporter-zipkin-json"
- "protobuf"
- "proto"
- "propagator-b3"
- "propagator-jaeger"
os: [ubuntu-20.04, windows-2019]
Expand All @@ -69,6 +69,8 @@ jobs:
package: "exporter-otlp-combined"
- python-version: pypy3
package: "exporter-otlp-proto-grpc"
- python-version: pypy3
package: "getting-started"

steps:
- name: Checkout Core Repo @ SHA - ${{ github.sha }}
Expand All @@ -93,12 +95,12 @@ jobs:
if: ${{ matrix.os == 'windows-2019'}}
run: git config --system core.longpaths true
- name: run tox
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-skip
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra
misc:
strategy:
fail-fast: false
matrix:
tox-environment: ["docker-tests-proto3", "docker-tests-proto4", "lint", "spellcheck",
tox-environment: ["docker-tests-proto3", "docker-tests-proto4", "spellcheck",
"docs", "mypy", "mypyinstalled", "tracecontext"]
name: ${{ matrix.tox-environment }}
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -172,7 +174,6 @@ jobs:
- "redis"
- "remoulade"
- "requests"
- "sklearn"
- "sqlalchemy"
- "sqlite3"
- "starlette"
Expand Down Expand Up @@ -213,4 +214,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
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Retain meaningful logrecord attributes and apply log-message formatting
([#3673](https://github.com/open-telemetry/opentelemetry-python/pull/3673))
- optional scope attribute for tracer creation
([#4028](https://github.com/open-telemetry/opentelemetry-python/pull/4028))
- OTLP exporter is encoding invalid span/trace IDs in the logs fix
([#4006](https://github.com/open-telemetry/opentelemetry-python/pull/4006))
- Update sdk process resource detector `process.command_args` attribute to also include the executable itself
([#4032](https://github.com/open-telemetry/opentelemetry-python/pull/4032))
- Fix `start_time_unix_nano` for delta collection for explicit bucket histogram aggregation
([#4009](https://github.com/open-telemetry/opentelemetry-python/pull/4009))
- Fix `start_time_unix_nano` for delta collection for sum aggregation
([#4011](https://github.com/open-telemetry/opentelemetry-python/pull/4011))
- Update opentracing and opencesus docs examples to not use JaegerExporter
([#4023](https://github.com/open-telemetry/opentelemetry-python/pull/4023))
- Do not execute Flask Tests in debug mode
([#3956](https://github.com/open-telemetry/opentelemetry-python/pull/3956))
- When encountering an error encoding metric attributes in the OTLP exporter, log the key that had an error.
([#3838](https://github.com/open-telemetry/opentelemetry-python/pull/3838))
- Fix `ExponentialHistogramAggregation`
([#3978](https://github.com/open-telemetry/opentelemetry-python/pull/3978))
- Log a warning when a `LogRecord` in `sdk/log` has dropped attributes
due to reaching limits
([#3946](https://github.com/open-telemetry/opentelemetry-python/pull/3946))
Expand All @@ -40,6 +50,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#3965](https://github.com/open-telemetry/opentelemetry-python/pull/3965))
- Validate links at span creation
([#3991](https://github.com/open-telemetry/opentelemetry-python/pull/3991))
- Add attributes field in `MeterProvider.get_meter` and `InstrumentationScope`
([#4015](https://github.com/open-telemetry/opentelemetry-python/pull/4015))

## Version 1.25.0/0.46b0 (2024-05-30)

Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ You can run `tox` with the following arguments:
- `tox -e py312-opentelemetry-api` to e.g. run the API unit tests under a specific
Python version
- `tox -e spellcheck` to run a spellcheck on all the code
- `tox -e lint` to run lint checks on all code
- `tox -e lint-some-package` to run lint checks on `some-package`

`black` and `isort` are executed when `tox -e lint` is run. The reported errors can be tedious to fix manually.
An easier way to do so is:
Expand Down 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Meeting notes are available as a public [Google doc](https://docs.google.com/doc
Approvers ([@open-telemetry/python-approvers](https://github.com/orgs/open-telemetry/teams/python-approvers)):

- [Aaron Abbott](https://github.com/aabmass), Google
- [Emídio Neto](https://github.com/emdneto), Zenvia
- [Jeremy Voss](https://github.com/jeremydvoss), Microsoft
- [Owais Lone](https://github.com/owais), Splunk
- [Pablo Collins](https://github.com/pmcollins), Splunk
Expand Down
1 change: 0 additions & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ ruamel.yaml==0.17.21
asgiref==3.7.2
psutil==5.9.6
GitPython==3.1.41
flaky==3.7.0
pre-commit==3.7.0; python_version >= '3.9'
pre-commit==3.5.0; python_version < '3.9'
4 changes: 4 additions & 0 deletions docs-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ sphinx-jekyll-builder==0.3.0
./opentelemetry-api
./opentelemetry-semantic-conventions
./opentelemetry-sdk
./opentelemetry-proto
./shim/opentelemetry-opencensus-shim
./shim/opentelemetry-opentracing-shim
./exporter/opentelemetry-exporter-otlp-proto-common
./exporter/opentelemetry-exporter-otlp-proto-http
./exporter/opentelemetry-exporter-otlp-proto-grpc

# Required by instrumentation and exporter packages
grpcio~=1.27
Expand Down
23 changes: 23 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,29 @@
"py:class",
"opentelemetry.trace._LinkBase",
),
(
"py:class",
"opentelemetry.exporter.otlp.proto.grpc.exporter.OTLPExporterMixin",
),
(
"py:class",
"opentelemetry.proto.collector.trace.v1.trace_service_pb2.ExportTraceServiceRequest",
),
(
"py:class",
"opentelemetry.exporter.otlp.proto.common._internal.metrics_encoder.OTLPMetricExporterMixin",
),
("py:class", "opentelemetry.proto.resource.v1.resource_pb2.Resource"),
(
"py:class",
"opentelemetry.proto.collector.metrics.v1.metrics_service_pb2.ExportMetricsServiceRequest",
),
("py:class", "opentelemetry.sdk._logs._internal.export.LogExporter"),
("py:class", "opentelemetry.sdk._logs._internal.export.LogExportResult"),
(
"py:class",
"opentelemetry.proto.collector.logs.v1.logs_service_pb2.ExportLogsServiceRequest",
),
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
15 changes: 10 additions & 5 deletions docs/examples/logs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,26 @@ Start the Collector locally to see data being exported. Write the following file
otlp:
protocols:
grpc:
processors:
batch:
endpoint: 0.0.0.0:4317
exporters:
logging:
verbosity: detailed
loglevel: debug
processors:
batch:
service:
pipelines:
logs:
receivers: [otlp]
processors: [batch]
exporters: [logging]
traces:
receivers: [otlp]
processors: [batch]
exporters: [logging]
Then start the Docker container:

.. code-block:: sh
Expand Down
1 change: 1 addition & 0 deletions docs/examples/logs/otel-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317

exporters:
logging:
Expand Down
1 change: 1 addition & 0 deletions docs/examples/metrics/instruments/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Start the Collector locally to see data being exported. Write the following file
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
exporters:
logging:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317

exporters:
logging:
Expand Down
3 changes: 3 additions & 0 deletions docs/examples/metrics/instruments/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
opentelemetry-api~=1.25
opentelemetry-sdk~=1.25
opentelemetry-exporter-otlp~=1.25
8 changes: 4 additions & 4 deletions docs/examples/opencensus-shim/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Start Jaeger
.. code-block:: sh
docker run --rm \
-p 6831:6831/udp \
-p 6832:6832/udp \
-p 4317:4317 \
-p 4318:4318 \
-p 16686:16686 \
jaegertracing/all-in-one:1.13 \
jaegertracing/all-in-one:latest \
--log-level=debug
Python Dependencies
Expand All @@ -43,7 +43,7 @@ Alternatively, you can install the Python dependencies separately:
pip install \
opentelemetry-api \
opentelemetry-sdk \
opentelemetry-exporter-jaeger \
opentelemetry-exporter-otlp \
opentelemetry-opencensus-shim \
opentelemetry-instrumentation-sqlite3 \
opencensus \
Expand Down
Loading

0 comments on commit 8ecd6a7

Please sign in to comment.