Skip to content

Commit 8ecd6a7

Browse files
committed
chore: merge current main
2 parents 79ce99a + d4e13bd commit 8ecd6a7

File tree

160 files changed

+1795
-853
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+1795
-853
lines changed

.codespellrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[codespell]
22
# skipping auto generated folders
3-
skip = ./.tox,./.mypy_cache,./docs/_build,./target,*/LICENSE,./venv,.git,./opentelemetry-semantic-conventions
3+
skip = ./.tox,./.mypy_cache,./docs/_build,./target,*/LICENSE,./venv,.git,./opentelemetry-semantic-conventions,*-requirements*.txt
44
ignore-words-list = ans,ue,ot,hist,ro

.github/workflows/benchmarks.yml

+5-23
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,25 @@ on:
66

77
jobs:
88
sdk-benchmarks:
9-
env:
10-
py312: "3.12"
11-
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-sdk-${{ matrix.os }}
129
runs-on: self-hosted
13-
strategy:
14-
# Ensures the entire test matrix is run, even if one permutation fails
15-
fail-fast: false
16-
matrix:
17-
python-version: [py312]
18-
os: [ubuntu-20.04, windows-2019]
1910
steps:
2011
- name: Checkout Core Repo @ SHA - ${{ github.sha }}
2112
uses: actions/checkout@v4
22-
- name: Set up Python ${{ env[matrix.python-version] }}
13+
- name: Set up Python
2314
uses: actions/setup-python@v5
2415
with:
25-
python-version: ${{ env[matrix.python-version] }}
16+
python-version: "3.12"
2617
architecture: 'x64'
2718
- name: Install tox
2819
run: pip install tox
29-
- name: Cache tox environment
30-
# Preserves .tox directory between runs for faster installs
31-
uses: actions/cache@v4
32-
with:
33-
path: |
34-
.tox
35-
~/.cache/pip
36-
key: v3-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini',
37-
'dev-requirements.txt') }}-core
3820
- name: Run tox
39-
run: tox -f ${{ matrix.python-version }}-sdk -- -k opentelemetry-sdk/tests/performance/benchmarks --benchmark-json=opentelemetry-sdk/tests/output.json
21+
run: tox -e benchmark-opentelemetry-sdk -- -k opentelemetry-sdk/benchmarks --benchmark-json=opentelemetry-sdk/output.json
4022
- name: Report on SDK benchmark results
4123
uses: benchmark-action/github-action-benchmark@v1
4224
with:
43-
name: OpenTelemetry Python SDK Benchmarks - Python ${{ env[matrix.python-version ]}} - SDK
25+
name: OpenTelemetry Python SDK Benchmarks
4426
tool: pytest
45-
output-file-path: opentelemetry-sdk/tests/output.json
27+
output-file-path: opentelemetry-sdk/output.json
4628
gh-pages-branch: gh-pages
4729
github-token: ${{ secrets.GITHUB_TOKEN }}
4830
# Make a commit on `gh-pages` with benchmarks from previous step

.github/workflows/lint.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Lint tests
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'release/*'
7+
pull_request:
8+
9+
jobs:
10+
lint-3_12:
11+
strategy:
12+
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
13+
matrix:
14+
package:
15+
- "opentelemetry-api"
16+
- "opentelemetry-proto"
17+
- "opentelemetry-sdk"
18+
- "opentelemetry-semantic-conventions"
19+
- "opentelemetry-getting-started"
20+
- "opentelemetry-opentracing-shim"
21+
- "opentelemetry-opencensus-shim"
22+
- "opentelemetry-exporter-opencensus"
23+
- "opentelemetry-exporter-otlp-proto-common"
24+
- "opentelemetry-exporter-otlp-combined"
25+
- "opentelemetry-exporter-otlp-proto-grpc"
26+
- "opentelemetry-exporter-otlp-proto-http"
27+
- "opentelemetry-exporter-otlp-proto-prometheus"
28+
- "opentelemetry-exporter-otlp-proto-zipkin-combined"
29+
- "opentelemetry-exporter-otlp-proto-zipkin-proto-http"
30+
- "opentelemetry-exporter-otlp-proto-zipkin-json"
31+
- "opentelemetry-propagator-b3"
32+
- "opentelemetry-propagator-jaeger"
33+
- "opentelemetry-test-utils"
34+
os: [ubuntu-20.04]
35+
runs-on: ubuntu-20.04
36+
steps:
37+
- name: Checkout Core Repo @ SHA - ${{ github.sha }}
38+
uses: actions/checkout@v4
39+
- name: Set up Python 3.12
40+
uses: actions/setup-python@v5
41+
with:
42+
python-version: 3.12
43+
- name: Install tox
44+
run: pip install tox
45+
- name: Cache tox environment
46+
# Preserves .tox directory between runs for faster installs
47+
uses: actions/cache@v4
48+
with:
49+
path: |
50+
.tox
51+
~/.cache/pip
52+
key: v7-build-tox-cache-${{ matrix.package }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
53+
- name: run tox
54+
run: tox -e lint-${{ matrix.package }}

.github/workflows/test.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
# Otherwise, set variable to the commit of your branch on
1111
# opentelemetry-python-contrib which is compatible with these Core repo
1212
# changes.
13-
CONTRIB_REPO_SHA: 7d4573da89c7aef748614e6f1511be3eddf5b230
13+
CONTRIB_REPO_SHA: main
1414

1515
# This is needed because we do not clone the core repo in contrib builds anymore.
1616
# When running contrib builds as part of core builds, we use actions/checkout@v4 which
@@ -56,7 +56,7 @@ jobs:
5656
- "exporter-zipkin-combined"
5757
- "exporter-zipkin-proto-http"
5858
- "exporter-zipkin-json"
59-
- "protobuf"
59+
- "proto"
6060
- "propagator-b3"
6161
- "propagator-jaeger"
6262
os: [ubuntu-20.04, windows-2019]
@@ -69,6 +69,8 @@ jobs:
6969
package: "exporter-otlp-combined"
7070
- python-version: pypy3
7171
package: "exporter-otlp-proto-grpc"
72+
- python-version: pypy3
73+
package: "getting-started"
7274

7375
steps:
7476
- name: Checkout Core Repo @ SHA - ${{ github.sha }}
@@ -93,12 +95,12 @@ jobs:
9395
if: ${{ matrix.os == 'windows-2019'}}
9496
run: git config --system core.longpaths true
9597
- name: run tox
96-
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-skip
98+
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra
9799
misc:
98100
strategy:
99101
fail-fast: false
100102
matrix:
101-
tox-environment: ["docker-tests-proto3", "docker-tests-proto4", "lint", "spellcheck",
103+
tox-environment: ["docker-tests-proto3", "docker-tests-proto4", "spellcheck",
102104
"docs", "mypy", "mypyinstalled", "tracecontext"]
103105
name: ${{ matrix.tox-environment }}
104106
runs-on: ubuntu-20.04
@@ -172,7 +174,6 @@ jobs:
172174
- "redis"
173175
- "remoulade"
174176
- "requests"
175-
- "sklearn"
176177
- "sqlalchemy"
177178
- "sqlite3"
178179
- "starlette"
@@ -213,4 +214,4 @@ jobs:
213214
key: v3-tox-cache-${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os
214215
}}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-contrib
215216
- name: run tox
216-
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-skip
217+
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,6 @@ docs/examples/django/db.sqlite3
6666

6767
# Semantic conventions
6868
scripts/semconv/semantic-conventions
69+
70+
# Benchmark result files
71+
*-benchmark.json

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

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

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

CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ You can run `tox` with the following arguments:
5757
- `tox -e py312-opentelemetry-api` to e.g. run the API unit tests under a specific
5858
Python version
5959
- `tox -e spellcheck` to run a spellcheck on all the code
60-
- `tox -e lint` to run lint checks on all code
60+
- `tox -e lint-some-package` to run lint checks on `some-package`
6161

6262
`black` and `isort` are executed when `tox -e lint` is run. The reported errors can be tedious to fix manually.
6363
An easier way to do so is:
@@ -126,7 +126,7 @@ The continuation integration overrides that environment variable with as per the
126126

127127
### Benchmarks
128128

129-
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.
129+
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.
130130

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

@@ -142,10 +142,10 @@ def test_simple_start_span(benchmark):
142142
benchmark(benchmark_start_as_current_span, "benchmarkedSpan", 42)
143143
```
144144

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

150150
## Pull Requests
151151

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ Meeting notes are available as a public [Google doc](https://docs.google.com/doc
9999
Approvers ([@open-telemetry/python-approvers](https://github.com/orgs/open-telemetry/teams/python-approvers)):
100100

101101
- [Aaron Abbott](https://github.com/aabmass), Google
102+
- [Emídio Neto](https://github.com/emdneto), Zenvia
102103
- [Jeremy Voss](https://github.com/jeremydvoss), Microsoft
103104
- [Owais Lone](https://github.com/owais), Splunk
104105
- [Pablo Collins](https://github.com/pmcollins), Splunk

dev-requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,5 @@ ruamel.yaml==0.17.21
1818
asgiref==3.7.2
1919
psutil==5.9.6
2020
GitPython==3.1.41
21-
flaky==3.7.0
2221
pre-commit==3.7.0; python_version >= '3.9'
2322
pre-commit==3.5.0; python_version < '3.9'

docs-requirements.txt

+4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ sphinx-jekyll-builder==0.3.0
99
./opentelemetry-api
1010
./opentelemetry-semantic-conventions
1111
./opentelemetry-sdk
12+
./opentelemetry-proto
1213
./shim/opentelemetry-opencensus-shim
1314
./shim/opentelemetry-opentracing-shim
15+
./exporter/opentelemetry-exporter-otlp-proto-common
16+
./exporter/opentelemetry-exporter-otlp-proto-http
17+
./exporter/opentelemetry-exporter-otlp-proto-grpc
1418

1519
# Required by instrumentation and exporter packages
1620
grpcio~=1.27

docs/conf.py

+23
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,29 @@
115115
"py:class",
116116
"opentelemetry.trace._LinkBase",
117117
),
118+
(
119+
"py:class",
120+
"opentelemetry.exporter.otlp.proto.grpc.exporter.OTLPExporterMixin",
121+
),
122+
(
123+
"py:class",
124+
"opentelemetry.proto.collector.trace.v1.trace_service_pb2.ExportTraceServiceRequest",
125+
),
126+
(
127+
"py:class",
128+
"opentelemetry.exporter.otlp.proto.common._internal.metrics_encoder.OTLPMetricExporterMixin",
129+
),
130+
("py:class", "opentelemetry.proto.resource.v1.resource_pb2.Resource"),
131+
(
132+
"py:class",
133+
"opentelemetry.proto.collector.metrics.v1.metrics_service_pb2.ExportMetricsServiceRequest",
134+
),
135+
("py:class", "opentelemetry.sdk._logs._internal.export.LogExporter"),
136+
("py:class", "opentelemetry.sdk._logs._internal.export.LogExportResult"),
137+
(
138+
"py:class",
139+
"opentelemetry.proto.collector.logs.v1.logs_service_pb2.ExportLogsServiceRequest",
140+
),
118141
]
119142

120143
# Add any paths that contain templates here, relative to this directory.

docs/examples/logs/README.rst

+10-5
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,26 @@ Start the Collector locally to see data being exported. Write the following file
1515
otlp:
1616
protocols:
1717
grpc:
18-
19-
processors:
20-
batch:
18+
endpoint: 0.0.0.0:4317
2119
2220
exporters:
2321
logging:
24-
verbosity: detailed
22+
loglevel: debug
23+
24+
processors:
25+
batch:
2526
2627
service:
2728
pipelines:
2829
logs:
2930
receivers: [otlp]
3031
processors: [batch]
3132
exporters: [logging]
32-
33+
traces:
34+
receivers: [otlp]
35+
processors: [batch]
36+
exporters: [logging]
37+
3338
Then start the Docker container:
3439

3540
.. code-block:: sh

docs/examples/logs/otel-collector-config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ receivers:
22
otlp:
33
protocols:
44
grpc:
5+
endpoint: 0.0.0.0:4317
56

67
exporters:
78
logging:

docs/examples/metrics/instruments/README.rst

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Start the Collector locally to see data being exported. Write the following file
1010
otlp:
1111
protocols:
1212
grpc:
13+
endpoint: 0.0.0.0:4317
1314
1415
exporters:
1516
logging:

docs/examples/metrics/instruments/otel-collector-config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ receivers:
22
otlp:
33
protocols:
44
grpc:
5+
endpoint: 0.0.0.0:4317
56

67
exporters:
78
logging:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
opentelemetry-api~=1.25
2+
opentelemetry-sdk~=1.25
3+
opentelemetry-exporter-otlp~=1.25

docs/examples/opencensus-shim/README.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Start Jaeger
2020
.. code-block:: sh
2121
2222
docker run --rm \
23-
-p 6831:6831/udp \
24-
-p 6832:6832/udp \
23+
-p 4317:4317 \
24+
-p 4318:4318 \
2525
-p 16686:16686 \
26-
jaegertracing/all-in-one:1.13 \
26+
jaegertracing/all-in-one:latest \
2727
--log-level=debug
2828
2929
Python Dependencies
@@ -43,7 +43,7 @@ Alternatively, you can install the Python dependencies separately:
4343
pip install \
4444
opentelemetry-api \
4545
opentelemetry-sdk \
46-
opentelemetry-exporter-jaeger \
46+
opentelemetry-exporter-otlp \
4747
opentelemetry-opencensus-shim \
4848
opentelemetry-instrumentation-sqlite3 \
4949
opencensus \

0 commit comments

Comments
 (0)