diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml new file mode 100644 index 00000000000..68d12b805fe --- /dev/null +++ b/.github/workflows/shellcheck.yml @@ -0,0 +1,19 @@ +name: Shellcheck + +on: + push: + branches-ignore: + - 'release/*' + pull_request: + +jobs: + shellcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install shellcheck + run: sudo apt update && sudo apt install --assume-yes shellcheck + + - name: Run shellcheck + run: find . -name \*.sh | xargs shellcheck --severity=warning diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2dacdd6b059..651b13ab559 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: 9a7c2f7ba16669d00be273aa9e988af0df7aba4c + CONTRIB_REPO_SHA: 3c2788469834aa4f5976e1644d757f43d60bc219 # 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@v2 which # does not set an environment variable (simply just runs tox), which is different when @@ -176,7 +176,7 @@ jobs: - "tornado" - "tortoiseorm" - "urllib" - - "urllib3v" + - "urllib3" - "wsgi" - "prometheus-remote-write" - "richconsole" diff --git a/.readthedocs.yml b/.readthedocs.yml index 3dcf0e5cf62..2a3c920b45d 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -6,9 +6,10 @@ sphinx: configuration: docs/conf.py build: - image: latest + os: "ubuntu-22.04" + tools: + python: "3.8" python: - version: 3.8 install: - requirements: docs-requirements.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bb28c375f7..51fb31ca295 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +- Update proto version to v1.2.0 + ([#3844](https://github.com/open-telemetry/opentelemetry-python/pull/3844)) +- Add to_json method to ExponentialHistogram + ([#3780](https://github.com/open-telemetry/opentelemetry-python/pull/3780)) +- Bump mypy to 1.9.0 + ([#3795](https://github.com/open-telemetry/opentelemetry-python/pull/3795)) +- Fix exponential histograms + ([#3798](https://github.com/open-telemetry/opentelemetry-python/pull/3798)) +- Fix otlp exporter to export log_record.observed_timestamp + ([#3785](https://github.com/open-telemetry/opentelemetry-python/pull/3785)) +- Add capture the fully qualified type name for raised exceptions in spans + ([#3837](https://github.com/open-telemetry/opentelemetry-python/pull/3837)) + +## Version 1.24.0/0.45b0 (2024-03-28) + +- Make create_gauge non-abstract method + ([#3817](https://github.com/open-telemetry/opentelemetry-python/pull/3817)) - Make `tracer.start_as_current_span()` decorator work with async functions ([#3633](https://github.com/open-telemetry/opentelemetry-python/pull/3633)) - Fix python 3.12 deprecation warning @@ -19,6 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#3648](https://github.com/open-telemetry/opentelemetry-python/pull/3648)) - Fix ValueError message for PeriodicExportingMetricsReader ([#3769](https://github.com/open-telemetry/opentelemetry-python/pull/3769)) +- Use `BaseException` instead of `Exception` in `record_exception` + ([#3354](https://github.com/open-telemetry/opentelemetry-python/pull/3354)) - Make span.record_exception more robust ([#3778](https://github.com/open-telemetry/opentelemetry-python/pull/3778)) - Fix license field in pyproject.toml files @@ -1498,3 +1517,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Remove dependency on 'backoff' library ([#3679](https://github.com/open-telemetry/opentelemetry-python/pull/3679)) + +- Make create_gauge non-abstract method + ([#3817](https://github.com/open-telemetry/opentelemetry-python/pull/3817)) +- Make `tracer.start_as_current_span()` decorator work with async functions + ([#3633](https://github.com/open-telemetry/opentelemetry-python/pull/3633)) +- Fix python 3.12 deprecation warning + ([#3751](https://github.com/open-telemetry/opentelemetry-python/pull/3751)) +- bump mypy to 0.982 + ([#3776](https://github.com/open-telemetry/opentelemetry-python/pull/3776)) +- Add support for OTEL_SDK_DISABLED environment variable + ([#3648](https://github.com/open-telemetry/opentelemetry-python/pull/3648)) +- Fix ValueError message for PeriodicExportingMetricsReader + ([#3769](https://github.com/open-telemetry/opentelemetry-python/pull/3769)) +- Use `BaseException` instead of `Exception` in `record_exception` + ([#3354](https://github.com/open-telemetry/opentelemetry-python/pull/3354)) +- Make span.record_exception more robust + ([#3778](https://github.com/open-telemetry/opentelemetry-python/pull/3778)) +- Fix license field in pyproject.toml files + ([#3803](https://github.com/open-telemetry/opentelemetry-python/pull/3803)) + diff --git a/README.md b/README.md index c36a64062c9..588b7ccb399 100644 --- a/README.md +++ b/README.md @@ -100,8 +100,12 @@ Approvers ([@open-telemetry/python-approvers](https://github.com/orgs/open-telem - [Aaron Abbott](https://github.com/aabmass), Google - [Jeremy Voss](https://github.com/jeremydvoss), Microsoft -- [Sanket Mehta](https://github.com/sanketmehta28), Cisco +- [Owais Lone](https://github.com/owais), Splunk +- [Pablo Collins](https://github.com/pmcollins), Splunk +- [Riccardo Magliocchetti](https://github.com/xrmx), Elastic - [Shalev Roda](https://github.com/shalevr), Cisco +- [Srikanth Chekuri](https://github.com/srikanthccv), signoz.io +- [Tammy Baylis](https://github.com/tammy-baylis-swi), SolarWinds Emeritus Approvers @@ -111,6 +115,8 @@ Emeritus Approvers - [Héctor Hernández](https://github.com/hectorhdzg), Microsoft - [Mauricio Vásquez](https://github.com/mauriciovasquezbernal), Kinvolk - [Nathaniel Ruiz Nowell](https://github.com/NathanielRN), AWS +- [Nikolay Sokolik](https://github.com/oxeye-nikolay), Oxeye +- [Sanket Mehta](https://github.com/sanketmehta28), Cisco - [Tahir H. Butt](https://github.com/majorgreys), DataDog *For more information about the approver role, see the [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver).* diff --git a/dev-requirements.txt b/dev-requirements.txt index 15462dea502..01f46ae87e9 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -3,7 +3,7 @@ flake8==6.1.0 isort==5.12.0 black==22.3.0 httpretty==1.1.4 -mypy==0.982 +mypy==1.9.0 sphinx==7.1.2 sphinx-rtd-theme==2.0.0rc4 sphinx-autodoc-typehints==1.25.2 diff --git a/docs/examples/fork-process-model/flask-gunicorn/requirements.txt b/docs/examples/fork-process-model/flask-gunicorn/requirements.txt index ad166e35901..e1e8b00aa21 100644 --- a/docs/examples/fork-process-model/flask-gunicorn/requirements.txt +++ b/docs/examples/fork-process-model/flask-gunicorn/requirements.txt @@ -12,7 +12,7 @@ opentelemetry-instrumentation==0.41b0 opentelemetry-instrumentation-flask==0.41b0 opentelemetry-instrumentation-wsgi==0.41b0 opentelemetry-sdk==1.20.0 -protobuf==3.19.5 +protobuf==3.20.3 six==1.15.0 thrift==0.13.0 uWSGI==2.0.22 diff --git a/docs/examples/fork-process-model/flask-uwsgi/requirements.txt b/docs/examples/fork-process-model/flask-uwsgi/requirements.txt index ad166e35901..e1e8b00aa21 100644 --- a/docs/examples/fork-process-model/flask-uwsgi/requirements.txt +++ b/docs/examples/fork-process-model/flask-uwsgi/requirements.txt @@ -12,7 +12,7 @@ opentelemetry-instrumentation==0.41b0 opentelemetry-instrumentation-flask==0.41b0 opentelemetry-instrumentation-wsgi==0.41b0 opentelemetry-sdk==1.20.0 -protobuf==3.19.5 +protobuf==3.20.3 six==1.15.0 thrift==0.13.0 uWSGI==2.0.22 diff --git a/eachdist.ini b/eachdist.ini index 7749b33a842..b7d73f192aa 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -11,7 +11,7 @@ sortfirst= exporter/* [stable] -version=1.24.0.dev +version=1.25.0.dev packages= opentelemetry-sdk @@ -27,7 +27,7 @@ packages= opentelemetry-api [prerelease] -version=0.45b0.dev +version=0.46b0.dev packages= opentelemetry-opentracing-shim diff --git a/exporter/opentelemetry-exporter-opencensus/pyproject.toml b/exporter/opentelemetry-exporter-opencensus/pyproject.toml index fc2a8f2c2cf..44ba08ebcb0 100644 --- a/exporter/opentelemetry-exporter-opencensus/pyproject.toml +++ b/exporter/opentelemetry-exporter-opencensus/pyproject.toml @@ -27,7 +27,7 @@ classifiers = [ dependencies = [ "grpcio >= 1.0.0, < 2.0.0", "opencensus-proto >= 0.1.0, < 1.0.0", - "opentelemetry-api >= 1.24.0.dev", + "opentelemetry-api >= 1.25.0.dev", "opentelemetry-sdk >= 1.15", "protobuf ~= 3.13", "setuptools >= 16.0", diff --git a/exporter/opentelemetry-exporter-opencensus/src/opentelemetry/exporter/opencensus/util.py b/exporter/opentelemetry-exporter-opencensus/src/opentelemetry/exporter/opencensus/util.py index 694e8dc6a10..77eed6ffd17 100644 --- a/exporter/opentelemetry-exporter-opencensus/src/opentelemetry/exporter/opencensus/util.py +++ b/exporter/opentelemetry-exporter-opencensus/src/opentelemetry/exporter/opencensus/util.py @@ -17,7 +17,9 @@ from time import time # pylint: disable=wrong-import-position -from google.protobuf.timestamp_pb2 import Timestamp +from google.protobuf.timestamp_pb2 import ( # pylint: disable=no-name-in-module + Timestamp, +) from opencensus.proto.agent.common.v1 import common_pb2 from opencensus.proto.trace.v1 import trace_pb2 diff --git a/exporter/opentelemetry-exporter-opencensus/src/opentelemetry/exporter/opencensus/version.py b/exporter/opentelemetry-exporter-opencensus/src/opentelemetry/exporter/opencensus/version.py index 2b23bc49941..ff4933b20b8 100644 --- a/exporter/opentelemetry-exporter-opencensus/src/opentelemetry/exporter/opencensus/version.py +++ b/exporter/opentelemetry-exporter-opencensus/src/opentelemetry/exporter/opencensus/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/exporter/opentelemetry-exporter-opencensus/tests/test_otcollector_trace_exporter.py b/exporter/opentelemetry-exporter-opencensus/tests/test_otcollector_trace_exporter.py index fa546cde7a2..75340da192c 100644 --- a/exporter/opentelemetry-exporter-opencensus/tests/test_otcollector_trace_exporter.py +++ b/exporter/opentelemetry-exporter-opencensus/tests/test_otcollector_trace_exporter.py @@ -16,7 +16,9 @@ from unittest import mock import grpc -from google.protobuf.timestamp_pb2 import Timestamp +from google.protobuf.timestamp_pb2 import ( # pylint: disable=no-name-in-module + Timestamp, +) from opencensus.proto.trace.v1 import trace_pb2 import opentelemetry.exporter.opencensus.util as utils diff --git a/exporter/opentelemetry-exporter-otlp-proto-common/pyproject.toml b/exporter/opentelemetry-exporter-otlp-proto-common/pyproject.toml index 3963d60c949..64e1b02c7a5 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-common/pyproject.toml +++ b/exporter/opentelemetry-exporter-otlp-proto-common/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "opentelemetry-proto == 1.24.0.dev", + "opentelemetry-proto == 1.25.0.dev", ] [project.urls] diff --git a/exporter/opentelemetry-exporter-otlp-proto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/_log_encoder/__init__.py b/exporter/opentelemetry-exporter-otlp-proto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/_log_encoder/__init__.py index c664e3ba883..4252ab7f139 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/_log_encoder/__init__.py +++ b/exporter/opentelemetry-exporter-otlp-proto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/_log_encoder/__init__.py @@ -41,6 +41,7 @@ def encode_logs(batch: Sequence[LogData]) -> ExportLogsServiceRequest: def _encode_log(log_data: LogData) -> PB2LogRecord: return PB2LogRecord( time_unix_nano=log_data.log_record.timestamp, + observed_time_unix_nano=log_data.log_record.observed_timestamp, span_id=_encode_span_id(log_data.log_record.span_id), trace_id=_encode_trace_id(log_data.log_record.trace_id), flags=int(log_data.log_record.trace_flags), diff --git a/exporter/opentelemetry-exporter-otlp-proto-common/src/opentelemetry/exporter/otlp/proto/common/version.py b/exporter/opentelemetry-exporter-otlp-proto-common/src/opentelemetry/exporter/otlp/proto/common/version.py index 8c35630f0e1..e8b404f0501 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-common/src/opentelemetry/exporter/otlp/proto/common/version.py +++ b/exporter/opentelemetry-exporter-otlp-proto-common/src/opentelemetry/exporter/otlp/proto/common/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "1.24.0.dev" +__version__ = "1.25.0.dev" diff --git a/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-0.txt b/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-0.txt new file mode 100644 index 00000000000..a692923fc42 --- /dev/null +++ b/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-0.txt @@ -0,0 +1,19 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +flaky==3.7.0 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +protobuf==3.20.3 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-proto +-e exporter/opentelemetry-exporter-otlp-proto-common diff --git a/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements.txt b/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-1.txt similarity index 100% rename from exporter/opentelemetry-exporter-otlp-proto-common/test-requirements.txt rename to exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-1.txt diff --git a/exporter/opentelemetry-exporter-otlp-proto-common/tests/test_log_encoder.py b/exporter/opentelemetry-exporter-otlp-proto-common/tests/test_log_encoder.py index 0731bc5125d..58620b963ea 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-common/tests/test_log_encoder.py +++ b/exporter/opentelemetry-exporter-otlp-proto-common/tests/test_log_encoder.py @@ -69,6 +69,7 @@ def _get_sdk_log_data() -> List[LogData]: log1 = LogData( log_record=SDKLogRecord( timestamp=1644650195189786880, + observed_timestamp=1644650195189786881, trace_id=89564621134313219400156819398935297684, span_id=1312458408527513268, trace_flags=TraceFlags(0x01), @@ -89,6 +90,7 @@ def _get_sdk_log_data() -> List[LogData]: log2 = LogData( log_record=SDKLogRecord( timestamp=1644650249738562048, + observed_timestamp=1644650249738562049, trace_id=0, span_id=0, trace_flags=TraceFlags.DEFAULT, @@ -106,6 +108,7 @@ def _get_sdk_log_data() -> List[LogData]: log3 = LogData( log_record=SDKLogRecord( timestamp=1644650427658989056, + observed_timestamp=1644650427658989057, trace_id=271615924622795969659406376515024083555, span_id=4242561578944770265, trace_flags=TraceFlags(0x01), @@ -121,6 +124,7 @@ def _get_sdk_log_data() -> List[LogData]: log4 = LogData( log_record=SDKLogRecord( timestamp=1644650584292683008, + observed_timestamp=1644650584292683009, trace_id=212592107417388365804938480559624925555, span_id=6077757853989569223, trace_flags=TraceFlags(0x01), @@ -164,6 +168,7 @@ def get_test_logs( log_records=[ PB2LogRecord( time_unix_nano=1644650195189786880, + observed_time_unix_nano=1644650195189786881, trace_id=_encode_trace_id( 89564621134313219400156819398935297684 ), @@ -190,6 +195,7 @@ def get_test_logs( log_records=[ PB2LogRecord( time_unix_nano=1644650584292683008, + observed_time_unix_nano=1644650584292683009, trace_id=_encode_trace_id( 212592107417388365804938480559624925555 ), @@ -232,6 +238,7 @@ def get_test_logs( log_records=[ PB2LogRecord( time_unix_nano=1644650249738562048, + observed_time_unix_nano=1644650249738562049, trace_id=_encode_trace_id(0), span_id=_encode_span_id(0), flags=int(TraceFlags.DEFAULT), @@ -249,6 +256,7 @@ def get_test_logs( log_records=[ PB2LogRecord( time_unix_nano=1644650427658989056, + observed_time_unix_nano=1644650427658989057, trace_id=_encode_trace_id( 271615924622795969659406376515024083555 ), diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/pyproject.toml b/exporter/opentelemetry-exporter-otlp-proto-grpc/pyproject.toml index a54c1e86e38..9b29e13a12b 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/pyproject.toml +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/pyproject.toml @@ -28,14 +28,9 @@ dependencies = [ "googleapis-common-protos ~= 1.52", "grpcio >= 1.0.0, < 2.0.0", "opentelemetry-api ~= 1.15", - "opentelemetry-proto == 1.24.0.dev", - "opentelemetry-sdk ~= 1.24.0.dev", - "opentelemetry-exporter-otlp-proto-common == 1.24.0.dev", -] - -[project.optional-dependencies] -test = [ - "pytest-grpc", + "opentelemetry-proto == 1.25.0.dev", + "opentelemetry-sdk ~= 1.25.0.dev", + "opentelemetry-exporter-otlp-proto-common == 1.25.0.dev", ] [project.entry-points.opentelemetry_logs_exporter] diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/version.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/version.py index 8c35630f0e1..e8b404f0501 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/version.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "1.24.0.dev" +__version__ = "1.25.0.dev" diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-0.txt b/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-0.txt new file mode 100644 index 00000000000..c1ef1b74296 --- /dev/null +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-0.txt @@ -0,0 +1,25 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +flaky==3.7.0 +googleapis-common-protos==1.62.0 +grpcio==1.62.0 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +protobuf==3.20.3 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-api +-e exporter/opentelemetry-exporter-otlp-proto-common +-e opentelemetry-proto +-e opentelemetry-sdk +-e opentelemetry-semantic-conventions +-e exporter/opentelemetry-exporter-otlp-proto-grpc diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-1.txt b/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-1.txt new file mode 100644 index 00000000000..5fd39ca5761 --- /dev/null +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-1.txt @@ -0,0 +1,25 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +flaky==3.7.0 +googleapis-common-protos==1.62.0 +grpcio==1.62.0 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +protobuf==4.25.3 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-api +-e exporter/opentelemetry-exporter-otlp-proto-common +-e opentelemetry-proto +-e opentelemetry-sdk +-e opentelemetry-semantic-conventions +-e exporter/opentelemetry-exporter-otlp-proto-grpc diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/logs/test_otlp_logs_exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/logs/test_otlp_logs_exporter.py index a6479a14741..da66f830c2f 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/logs/test_otlp_logs_exporter.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/logs/test_otlp_logs_exporter.py @@ -18,7 +18,9 @@ from unittest import TestCase from unittest.mock import patch -from google.protobuf.duration_pb2 import Duration +from google.protobuf.duration_pb2 import ( # pylint: disable=no-name-in-module + Duration, +) from google.rpc.error_details_pb2 import RetryInfo from grpc import ChannelCredentials, Compression, StatusCode, server @@ -361,6 +363,7 @@ def test_translate_log_data(self): PB2LogRecord( # pylint: disable=no-member time_unix_nano=self.log_data_1.log_record.timestamp, + observed_time_unix_nano=self.log_data_1.log_record.observed_timestamp, severity_number=self.log_data_1.log_record.severity_number.value, severity_text="WARNING", span_id=int.to_bytes( @@ -420,6 +423,7 @@ def test_translate_multiple_logs(self): PB2LogRecord( # pylint: disable=no-member time_unix_nano=self.log_data_1.log_record.timestamp, + observed_time_unix_nano=self.log_data_1.log_record.observed_timestamp, severity_number=self.log_data_1.log_record.severity_number.value, severity_text="WARNING", span_id=int.to_bytes( @@ -457,6 +461,7 @@ def test_translate_multiple_logs(self): PB2LogRecord( # pylint: disable=no-member time_unix_nano=self.log_data_2.log_record.timestamp, + observed_time_unix_nano=self.log_data_2.log_record.observed_timestamp, severity_number=self.log_data_2.log_record.severity_number.value, severity_text="INFO", span_id=int.to_bytes( @@ -502,6 +507,7 @@ def test_translate_multiple_logs(self): PB2LogRecord( # pylint: disable=no-member time_unix_nano=self.log_data_3.log_record.timestamp, + observed_time_unix_nano=self.log_data_3.log_record.observed_timestamp, severity_number=self.log_data_3.log_record.severity_number.value, severity_text="ERROR", span_id=int.to_bytes( diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py index 4dfed3e1541..c5e1ed76e70 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py @@ -20,7 +20,9 @@ from unittest import TestCase from unittest.mock import Mock, patch -from google.protobuf.duration_pb2 import Duration +from google.protobuf.duration_pb2 import ( # pylint: disable=no-name-in-module + Duration, +) from google.rpc.error_details_pb2 import RetryInfo from grpc import Compression diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_metrics_exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_metrics_exporter.py index 95733b917bf..c52e94a00ea 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_metrics_exporter.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_metrics_exporter.py @@ -24,7 +24,9 @@ from unittest import TestCase from unittest.mock import patch -from google.protobuf.duration_pb2 import Duration +from google.protobuf.duration_pb2 import ( # pylint: disable=no-name-in-module + Duration, +) from google.rpc.error_details_pb2 import RetryInfo from grpc import ChannelCredentials, Compression, StatusCode, server diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_trace_exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_trace_exporter.py index bb17e35b7b7..3424d2c0898 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_trace_exporter.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_trace_exporter.py @@ -20,7 +20,9 @@ from unittest import TestCase from unittest.mock import Mock, PropertyMock, patch -from google.protobuf.duration_pb2 import Duration +from google.protobuf.duration_pb2 import ( # pylint: disable=no-name-in-module + Duration, +) from google.rpc.error_details_pb2 import RetryInfo from grpc import ChannelCredentials, Compression, StatusCode, server diff --git a/exporter/opentelemetry-exporter-otlp-proto-http/pyproject.toml b/exporter/opentelemetry-exporter-otlp-proto-http/pyproject.toml index f1c88db5c91..1e170528518 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-http/pyproject.toml +++ b/exporter/opentelemetry-exporter-otlp-proto-http/pyproject.toml @@ -27,9 +27,9 @@ dependencies = [ "Deprecated >= 1.2.6", "googleapis-common-protos ~= 1.52", "opentelemetry-api ~= 1.15", - "opentelemetry-proto == 1.24.0.dev", - "opentelemetry-sdk ~= 1.24.0.dev", - "opentelemetry-exporter-otlp-proto-common == 1.24.0.dev", + "opentelemetry-proto == 1.25.0.dev", + "opentelemetry-sdk ~= 1.25.0.dev", + "opentelemetry-exporter-otlp-proto-common == 1.25.0.dev", "requests ~= 2.7", ] diff --git a/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py b/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py index c624dfe476b..ea21cc664bc 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py +++ b/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py @@ -126,19 +126,13 @@ def _retryable(resp: requests.Response) -> bool: return True return False - def export(self, spans) -> SpanExportResult: - # After the call to Shutdown subsequent calls to Export are - # not allowed and should return a Failure result. - if self._shutdown: - _logger.warning("Exporter already shutdown, ignoring batch") - return SpanExportResult.FAILURE - - serialized_data = encode_spans(spans).SerializeToString() + def _serialize_spans(self, spans): + return encode_spans(spans).SerializePartialToString() + def _export_serialized_spans(self, serialized_data): for delay in _create_exp_backoff_generator( max_value=self._MAX_RETRY_TIMEOUT ): - if delay == self._MAX_RETRY_TIMEOUT: return SpanExportResult.FAILURE @@ -163,6 +157,17 @@ def export(self, spans) -> SpanExportResult: return SpanExportResult.FAILURE return SpanExportResult.FAILURE + def export(self, spans) -> SpanExportResult: + # After the call to Shutdown subsequent calls to Export are + # not allowed and should return a Failure result. + if self._shutdown: + _logger.warning("Exporter already shutdown, ignoring batch") + return SpanExportResult.FAILURE + + serialized_data = self._serialize_spans(spans) + + return self._export_serialized_spans(serialized_data) + def shutdown(self): if self._shutdown: _logger.warning("Exporter already shutdown, ignoring call") diff --git a/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/version.py b/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/version.py index 8c35630f0e1..e8b404f0501 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/version.py +++ b/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "1.24.0.dev" +__version__ = "1.25.0.dev" diff --git a/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-0.txt b/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-0.txt index 0faf2626687..cad177da7b5 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-0.txt +++ b/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-0.txt @@ -10,7 +10,7 @@ importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==23.2 pluggy==1.4.0 -protobuf==3.19.6 +protobuf==3.20.3 py==1.11.0 py-cpuinfo==9.0.0 pytest==7.1.3 diff --git a/exporter/opentelemetry-exporter-otlp/pyproject.toml b/exporter/opentelemetry-exporter-otlp/pyproject.toml index 7750cfda590..d6aa3aa4cd8 100644 --- a/exporter/opentelemetry-exporter-otlp/pyproject.toml +++ b/exporter/opentelemetry-exporter-otlp/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ "Typing :: Typed", ] dependencies = [ - "opentelemetry-exporter-otlp-proto-grpc == 1.24.0.dev", - "opentelemetry-exporter-otlp-proto-http == 1.24.0.dev", + "opentelemetry-exporter-otlp-proto-grpc == 1.25.0.dev", + "opentelemetry-exporter-otlp-proto-http == 1.25.0.dev", ] [project.entry-points.opentelemetry_logs_exporter] diff --git a/exporter/opentelemetry-exporter-otlp/src/opentelemetry/exporter/otlp/version.py b/exporter/opentelemetry-exporter-otlp/src/opentelemetry/exporter/otlp/version.py index 8c35630f0e1..e8b404f0501 100644 --- a/exporter/opentelemetry-exporter-otlp/src/opentelemetry/exporter/otlp/version.py +++ b/exporter/opentelemetry-exporter-otlp/src/opentelemetry/exporter/otlp/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "1.24.0.dev" +__version__ = "1.25.0.dev" diff --git a/exporter/opentelemetry-exporter-prometheus/pyproject.toml b/exporter/opentelemetry-exporter-prometheus/pyproject.toml index 1c3c9e89dd9..6fdb327124f 100644 --- a/exporter/opentelemetry-exporter-prometheus/pyproject.toml +++ b/exporter/opentelemetry-exporter-prometheus/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ dependencies = [ "opentelemetry-api ~= 1.12", # DONOTMERGE: confirm that this will becomes ~= 1.21 in the next release - "opentelemetry-sdk ~= 1.24.0.dev", + "opentelemetry-sdk ~= 1.25.0.dev", "prometheus_client >= 0.5.0, < 1.0.0", ] diff --git a/exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/version.py b/exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/version.py index 2b23bc49941..ff4933b20b8 100644 --- a/exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/version.py +++ b/exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/exporter/opentelemetry-exporter-zipkin-json/src/opentelemetry/exporter/zipkin/json/version.py b/exporter/opentelemetry-exporter-zipkin-json/src/opentelemetry/exporter/zipkin/json/version.py index 8c35630f0e1..e8b404f0501 100644 --- a/exporter/opentelemetry-exporter-zipkin-json/src/opentelemetry/exporter/zipkin/json/version.py +++ b/exporter/opentelemetry-exporter-zipkin-json/src/opentelemetry/exporter/zipkin/json/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "1.24.0.dev" +__version__ = "1.25.0.dev" diff --git a/exporter/opentelemetry-exporter-zipkin-proto-http/pyproject.toml b/exporter/opentelemetry-exporter-zipkin-proto-http/pyproject.toml index 03a400dce75..a934fc7edd1 100644 --- a/exporter/opentelemetry-exporter-zipkin-proto-http/pyproject.toml +++ b/exporter/opentelemetry-exporter-zipkin-proto-http/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.3", - "opentelemetry-exporter-zipkin-json == 1.24.0.dev", + "opentelemetry-exporter-zipkin-json == 1.25.0.dev", "opentelemetry-sdk ~= 1.11", "protobuf ~= 3.12", "requests ~= 2.7", diff --git a/exporter/opentelemetry-exporter-zipkin-proto-http/src/opentelemetry/exporter/zipkin/proto/http/version.py b/exporter/opentelemetry-exporter-zipkin-proto-http/src/opentelemetry/exporter/zipkin/proto/http/version.py index 8c35630f0e1..e8b404f0501 100644 --- a/exporter/opentelemetry-exporter-zipkin-proto-http/src/opentelemetry/exporter/zipkin/proto/http/version.py +++ b/exporter/opentelemetry-exporter-zipkin-proto-http/src/opentelemetry/exporter/zipkin/proto/http/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "1.24.0.dev" +__version__ = "1.25.0.dev" diff --git a/exporter/opentelemetry-exporter-zipkin/pyproject.toml b/exporter/opentelemetry-exporter-zipkin/pyproject.toml index 7ec3ac135fa..905a52fae7d 100644 --- a/exporter/opentelemetry-exporter-zipkin/pyproject.toml +++ b/exporter/opentelemetry-exporter-zipkin/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ "Typing :: Typed", ] dependencies = [ - "opentelemetry-exporter-zipkin-json == 1.24.0.dev", - "opentelemetry-exporter-zipkin-proto-http == 1.24.0.dev", + "opentelemetry-exporter-zipkin-json == 1.25.0.dev", + "opentelemetry-exporter-zipkin-proto-http == 1.25.0.dev", ] [project.entry-points.opentelemetry_traces_exporter] diff --git a/exporter/opentelemetry-exporter-zipkin/src/opentelemetry/exporter/zipkin/version.py b/exporter/opentelemetry-exporter-zipkin/src/opentelemetry/exporter/zipkin/version.py index 8c35630f0e1..e8b404f0501 100644 --- a/exporter/opentelemetry-exporter-zipkin/src/opentelemetry/exporter/zipkin/version.py +++ b/exporter/opentelemetry-exporter-zipkin/src/opentelemetry/exporter/zipkin/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "1.24.0.dev" +__version__ = "1.25.0.dev" diff --git a/opentelemetry-api/pyproject.toml b/opentelemetry-api/pyproject.toml index 3f8f070992d..5348cf658b1 100644 --- a/opentelemetry-api/pyproject.toml +++ b/opentelemetry-api/pyproject.toml @@ -27,7 +27,7 @@ dependencies = [ "Deprecated >= 1.2.6", # FIXME This should be able to be removed after 3.12 is released if there is a reliable API # in importlib.metadata. - "importlib-metadata >= 6.0, <= 7.0", + "importlib-metadata >= 6.0, <= 7.1", ] dynamic = [ "version", diff --git a/opentelemetry-api/src/opentelemetry/_logs/_internal/__init__.py b/opentelemetry-api/src/opentelemetry/_logs/_internal/__init__.py index 156b2598e47..ccf9f4597aa 100644 --- a/opentelemetry-api/src/opentelemetry/_logs/_internal/__init__.py +++ b/opentelemetry-api/src/opentelemetry/_logs/_internal/__init__.py @@ -193,7 +193,6 @@ def get_logger( schema_url: Optional[str] = None, ) -> Logger: """Returns a NoOpLogger.""" - super().get_logger(name, version=version, schema_url=schema_url) return NoOpLogger(name, version=version, schema_url=schema_url) diff --git a/opentelemetry-api/src/opentelemetry/metrics/_internal/__init__.py b/opentelemetry-api/src/opentelemetry/metrics/_internal/__init__.py index 2e6914f8e3c..9cbf14d2edc 100644 --- a/opentelemetry-api/src/opentelemetry/metrics/_internal/__init__.py +++ b/opentelemetry-api/src/opentelemetry/metrics/_internal/__init__.py @@ -41,6 +41,7 @@ """ +import warnings from abc import ABC, abstractmethod from logging import getLogger from os import environ @@ -140,7 +141,6 @@ def get_meter( schema_url: Optional[str] = None, ) -> "Meter": """Returns a NoOpMeter.""" - super().get_meter(name, version=version, schema_url=schema_url) return NoOpMeter(name, version=version, schema_url=schema_url) @@ -385,8 +385,7 @@ def create_histogram( description: A description for this instrument and what it measures. """ - @abstractmethod - def create_gauge( + def create_gauge( # type: ignore # pylint: disable=no-self-use self, name: str, unit: str = "", @@ -400,6 +399,7 @@ def create_gauge( example, ``By`` for bytes. UCUM units are recommended. description: A description for this instrument and what it measures. """ + warnings.warn("create_gauge() is not implemented and will be a no-op") @abstractmethod def create_observable_gauge( @@ -598,7 +598,6 @@ def create_counter( description: str = "", ) -> Counter: """Returns a no-op Counter.""" - super().create_counter(name, unit=unit, description=description) if self._is_instrument_registered( name, NoOpCounter, unit, description )[0]: @@ -619,7 +618,6 @@ def create_gauge( description: str = "", ) -> Gauge: """Returns a no-op Gauge.""" - super().create_gauge(name, unit=unit, description=description) if self._is_instrument_registered(name, NoOpGauge, unit, description)[ 0 ]: @@ -640,9 +638,6 @@ def create_up_down_counter( description: str = "", ) -> UpDownCounter: """Returns a no-op UpDownCounter.""" - super().create_up_down_counter( - name, unit=unit, description=description - ) if self._is_instrument_registered( name, NoOpUpDownCounter, unit, description )[0]: @@ -664,9 +659,6 @@ def create_observable_counter( description: str = "", ) -> ObservableCounter: """Returns a no-op ObservableCounter.""" - super().create_observable_counter( - name, callbacks, unit=unit, description=description - ) if self._is_instrument_registered( name, NoOpObservableCounter, unit, description )[0]: @@ -692,7 +684,6 @@ def create_histogram( description: str = "", ) -> Histogram: """Returns a no-op Histogram.""" - super().create_histogram(name, unit=unit, description=description) if self._is_instrument_registered( name, NoOpHistogram, unit, description )[0]: @@ -714,9 +705,6 @@ def create_observable_gauge( description: str = "", ) -> ObservableGauge: """Returns a no-op ObservableGauge.""" - super().create_observable_gauge( - name, callbacks, unit=unit, description=description - ) if self._is_instrument_registered( name, NoOpObservableGauge, unit, description )[0]: @@ -743,9 +731,6 @@ def create_observable_up_down_counter( description: str = "", ) -> ObservableUpDownCounter: """Returns a no-op ObservableUpDownCounter.""" - super().create_observable_up_down_counter( - name, callbacks, unit=unit, description=description - ) if self._is_instrument_registered( name, NoOpObservableUpDownCounter, unit, description )[0]: diff --git a/opentelemetry-api/src/opentelemetry/trace/span.py b/opentelemetry-api/src/opentelemetry/trace/span.py index 8201fdb251e..5d46ffcb4a9 100644 --- a/opentelemetry-api/src/opentelemetry/trace/span.py +++ b/opentelemetry-api/src/opentelemetry/trace/span.py @@ -169,7 +169,7 @@ def set_status( @abc.abstractmethod def record_exception( self, - exception: Exception, + exception: BaseException, attributes: types.Attributes = None, timestamp: typing.Optional[int] = None, escaped: bool = False, @@ -563,7 +563,7 @@ def set_status( def record_exception( self, - exception: Exception, + exception: BaseException, attributes: types.Attributes = None, timestamp: typing.Optional[int] = None, escaped: bool = False, diff --git a/opentelemetry-api/src/opentelemetry/util/_decorator.py b/opentelemetry-api/src/opentelemetry/util/_decorator.py index 233f29ff79d..870c97bd989 100644 --- a/opentelemetry-api/src/opentelemetry/util/_decorator.py +++ b/opentelemetry-api/src/opentelemetry/util/_decorator.py @@ -78,4 +78,5 @@ def _agnosticcontextmanager( def helper(*args: Pargs, **kwargs: Pkwargs) -> _AgnosticContextManager[R]: return _AgnosticContextManager(func, args, kwargs) - return helper + # Ignoring the type to keep the original signature of the function + return helper # type: ignore[return-value] diff --git a/opentelemetry-api/src/opentelemetry/util/_providers.py b/opentelemetry-api/src/opentelemetry/util/_providers.py index d255ac999f0..307650bb1d2 100644 --- a/opentelemetry-api/src/opentelemetry/util/_providers.py +++ b/opentelemetry-api/src/opentelemetry/util/_providers.py @@ -29,7 +29,7 @@ def _load_provider( provider_environment_variable: str, provider: str -) -> Provider: +) -> Provider: # type: ignore[type-var] try: diff --git a/opentelemetry-api/src/opentelemetry/version.py b/opentelemetry-api/src/opentelemetry/version.py index 8c35630f0e1..e8b404f0501 100644 --- a/opentelemetry-api/src/opentelemetry/version.py +++ b/opentelemetry-api/src/opentelemetry/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "1.24.0.dev" +__version__ = "1.25.0.dev" diff --git a/opentelemetry-api/tests/logs/test_proxy.py b/opentelemetry-api/tests/logs/test_proxy.py index d8fa0a9743c..cda187cae3c 100644 --- a/opentelemetry-api/tests/logs/test_proxy.py +++ b/opentelemetry-api/tests/logs/test_proxy.py @@ -18,7 +18,6 @@ import opentelemetry._logs._internal as _logs_internal from opentelemetry import _logs -from opentelemetry.sdk._logs import LogRecord # type: ignore from opentelemetry.test.globals_test import LoggingGlobalsTest @@ -33,8 +32,8 @@ def get_logger( class TestLogger(_logs.NoOpLogger): - def emit(self, *args, **kwargs): - return LogRecord(timestamp=0) + def emit(self, record: _logs.LogRecord) -> None: + pass class TestProxy(LoggingGlobalsTest, unittest.TestCase): diff --git a/opentelemetry-api/tests/metrics/test_meter.py b/opentelemetry-api/tests/metrics/test_meter.py index 8b427a73721..2226965521e 100644 --- a/opentelemetry-api/tests/metrics/test_meter.py +++ b/opentelemetry-api/tests/metrics/test_meter.py @@ -134,7 +134,6 @@ def test_create_gauge(self): """ self.assertTrue(hasattr(Meter, "create_gauge")) - self.assertTrue(Meter.create_gauge.__isabstractmethod__) def test_create_observable_gauge(self): """ diff --git a/opentelemetry-api/tests/metrics/test_subclass_instantiation.py b/opentelemetry-api/tests/metrics/test_subclass_instantiation.py new file mode 100644 index 00000000000..a5b68d1c063 --- /dev/null +++ b/opentelemetry-api/tests/metrics/test_subclass_instantiation.py @@ -0,0 +1,209 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# type: ignore + +# NOTE: The tests in this file are intended to test the semver compatibility of the public API. +# Any tests that fail here indicate that the public API has changed in a way that is not backwards compatible. +# Either bump the major version of the API, or make the necessary changes to the API to remain semver compatible. + +from typing import Optional + +from opentelemetry.metrics import ( + Asynchronous, + Counter, + Histogram, + Instrument, + Meter, + MeterProvider, + ObservableCounter, + ObservableGauge, + ObservableUpDownCounter, + Synchronous, + UpDownCounter, + _Gauge, +) + + +class MeterProviderImplTest(MeterProvider): + def get_meter( + self, + name: str, + version: Optional[str] = None, + schema_url: Optional[str] = None, + ) -> Meter: + return super().get_meter(name, version, schema_url) + + +def test_meter_provider_subclass_instantiation(): + meter_provider = MeterProviderImplTest() + assert isinstance(meter_provider, MeterProvider) + + +class MeterImplTest(Meter): + def create_counter(self, name, description, **kwargs): + pass + + def create_up_down_counter(self, name, description, **kwargs): + pass + + def create_observable_counter(self, name, description, **kwargs): + pass + + def create_histogram(self, name, description, **kwargs): + pass + + def create_observable_gauge(self, name, description, **kwargs): + pass + + def create_observable_up_down_counter(self, name, description, **kwargs): + pass + + +def test_meter_subclass_instantiation(): + meter = MeterImplTest("subclass_test") + assert isinstance(meter, Meter) + + +class SynchronousImplTest(Synchronous): + def __init__( + self, name: str, unit: str = "", description: str = "" + ) -> None: + super().__init__(name, unit, description) + + +def test_synchronous_subclass_instantiation(): + synchronous = SynchronousImplTest("subclass_test") + assert isinstance(synchronous, Synchronous) + + +class AsynchronousImplTest(Asynchronous): + def __init__( + self, name: str, unit: str = "", description: str = "" + ) -> None: + super().__init__(name, unit, description) + + +def test_asynchronous_subclass_instantiation(): + asynchronous = AsynchronousImplTest("subclass_test") + assert isinstance(asynchronous, Asynchronous) + + +class CounterImplTest(Counter): + def __init__( + self, name: str, unit: str = "", description: str = "" + ) -> None: + super().__init__(name, unit, description) + + def add(self, amount: int, **kwargs): + pass + + +def test_counter_subclass_instantiation(): + counter = CounterImplTest("subclass_test") + assert isinstance(counter, Counter) + + +class UpDownCounterImplTest(UpDownCounter): + def __init__( + self, name: str, unit: str = "", description: str = "" + ) -> None: + super().__init__(name, unit, description) + + def add(self, amount: int, **kwargs): + pass + + +def test_up_down_counter_subclass_instantiation(): + up_down_counter = UpDownCounterImplTest("subclass_test") + assert isinstance(up_down_counter, UpDownCounter) + + +class ObservableCounterImplTest(ObservableCounter): + def __init__( + self, name: str, unit: str = "", description: str = "" + ) -> None: + super().__init__(name, unit, description) + + +def test_observable_counter_subclass_instantiation(): + observable_counter = ObservableCounterImplTest("subclass_test") + assert isinstance(observable_counter, ObservableCounter) + + +class HistogramImplTest(Histogram): + def __init__( + self, name: str, unit: str = "", description: str = "" + ) -> None: + super().__init__(name, unit, description) + + def record(self, amount: int, **kwargs): + pass + + +def test_histogram_subclass_instantiation(): + histogram = HistogramImplTest("subclass_test") + assert isinstance(histogram, Histogram) + + +class GaugeImplTest(_Gauge): + def __init__( + self, name: str, unit: str = "", description: str = "" + ) -> None: + super().__init__(name, unit, description) + + def set(self, amount: int, **kwargs): + pass + + +def test_gauge_subclass_instantiation(): + gauge = GaugeImplTest("subclass_test") + assert isinstance(gauge, _Gauge) + + +class InstrumentImplTest(Instrument): + def __init__( + self, name: str, unit: str = "", description: str = "" + ) -> None: + super().__init__(name, unit, description) + + +def test_instrument_subclass_instantiation(): + instrument = InstrumentImplTest("subclass_test") + assert isinstance(instrument, Instrument) + + +class ObservableGaugeImplTest(ObservableGauge): + def __init__( + self, name: str, unit: str = "", description: str = "" + ) -> None: + super().__init__(name, unit, description) + + +def test_observable_gauge_subclass_instantiation(): + observable_gauge = ObservableGaugeImplTest("subclass_test") + assert isinstance(observable_gauge, ObservableGauge) + + +class ObservableUpDownCounterImplTest(ObservableUpDownCounter): + def __init__( + self, name: str, unit: str = "", description: str = "" + ) -> None: + super().__init__(name, unit, description) + + +def test_observable_up_down_counter_subclass_instantiation(): + observable_up_down_counter = ObservableUpDownCounterImplTest( + "subclass_test" + ) + assert isinstance(observable_up_down_counter, ObservableUpDownCounter) diff --git a/opentelemetry-proto/README.rst b/opentelemetry-proto/README.rst index f3e07b0087d..7ee31de7d88 100644 --- a/opentelemetry-proto/README.rst +++ b/opentelemetry-proto/README.rst @@ -7,9 +7,9 @@ OpenTelemetry Python Proto :target: https://pypi.org/project/opentelemetry-proto/ This library contains the generated code for OpenTelemetry protobuf data model. The code in the current -package was generated using the v0.20.0 release_ of opentelemetry-proto. +package was generated using the v1.2.0 release_ of opentelemetry-proto. -.. _release: https://github.com/open-telemetry/opentelemetry-proto/releases/tag/v0.20.0 +.. _release: https://github.com/open-telemetry/opentelemetry-proto/releases/tag/v1.2.0 Installation ------------ diff --git a/opentelemetry-proto/src/opentelemetry/proto/logs/v1/logs_pb2.pyi b/opentelemetry-proto/src/opentelemetry/proto/logs/v1/logs_pb2.pyi index 98b89743900..5aee721a804 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/logs/v1/logs_pb2.pyi +++ b/opentelemetry-proto/src/opentelemetry/proto/logs/v1/logs_pb2.pyi @@ -80,9 +80,11 @@ global___SeverityNumber = SeverityNumber class LogRecordFlags(_LogRecordFlags, metaclass=_LogRecordFlagsEnumTypeWrapper): - """LogRecordFlags is defined as a protobuf 'uint32' type and is to be used as - bit-fields. Each non-zero value defined in this enum is a bit-mask. - To extract the bit-field, for example, use an expression like: + """LogRecordFlags represents constants used to interpret the + LogRecord.flags field, which is protobuf 'fixed32' type and is to + be used as bit-fields. Each non-zero value defined in this enum is + a bit-mask. To extract the bit-field, for example, use an + expression like: (logRecord.flags & LOG_RECORD_FLAGS_TRACE_FLAGS_MASK) """ @@ -158,7 +160,10 @@ class ResourceLogs(google.protobuf.message.Message): """A list of ScopeLogs that originate from a resource.""" pass schema_url: typing.Text = ... - """This schema_url applies to the data in the "resource" field. It does not apply + """The Schema URL, if known. This is the identifier of the Schema that the resource data + is recorded in. To learn more about Schema URL see + https://opentelemetry.io/docs/specs/otel/schemas/#schema-url + This schema_url applies to the data in the "resource" field. It does not apply to the data in the "scope_logs" field which have their own schema_url field. """ @@ -190,7 +195,11 @@ class ScopeLogs(google.protobuf.message.Message): """A list of log records.""" pass schema_url: typing.Text = ... - """This schema_url applies to all logs in the "logs" field.""" + """The Schema URL, if known. This is the identifier of the Schema that the log data + is recorded in. To learn more about Schema URL see + https://opentelemetry.io/docs/specs/otel/schemas/#schema-url + This schema_url applies to all logs in the "logs" field. + """ def __init__(self, *, diff --git a/opentelemetry-proto/src/opentelemetry/proto/metrics/v1/metrics_pb2.py b/opentelemetry-proto/src/opentelemetry/proto/metrics/v1/metrics_pb2.py index 4b938c21469..e0b8f3bbc52 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/metrics/v1/metrics_pb2.py +++ b/opentelemetry-proto/src/opentelemetry/proto/metrics/v1/metrics_pb2.py @@ -17,7 +17,7 @@ from opentelemetry.proto.resource.v1 import resource_pb2 as opentelemetry_dot_proto_dot_resource_dot_v1_dot_resource__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,opentelemetry/proto/metrics/v1/metrics.proto\x12\x1eopentelemetry.proto.metrics.v1\x1a*opentelemetry/proto/common/v1/common.proto\x1a.opentelemetry/proto/resource/v1/resource.proto\"X\n\x0bMetricsData\x12I\n\x10resource_metrics\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.ResourceMetrics\"\xaf\x01\n\x0fResourceMetrics\x12;\n\x08resource\x18\x01 \x01(\x0b\x32).opentelemetry.proto.resource.v1.Resource\x12\x43\n\rscope_metrics\x18\x02 \x03(\x0b\x32,.opentelemetry.proto.metrics.v1.ScopeMetrics\x12\x12\n\nschema_url\x18\x03 \x01(\tJ\x06\x08\xe8\x07\x10\xe9\x07\"\x9f\x01\n\x0cScopeMetrics\x12\x42\n\x05scope\x18\x01 \x01(\x0b\x32\x33.opentelemetry.proto.common.v1.InstrumentationScope\x12\x37\n\x07metrics\x18\x02 \x03(\x0b\x32&.opentelemetry.proto.metrics.v1.Metric\x12\x12\n\nschema_url\x18\x03 \x01(\t\"\x92\x03\n\x06Metric\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0c\n\x04unit\x18\x03 \x01(\t\x12\x36\n\x05gauge\x18\x05 \x01(\x0b\x32%.opentelemetry.proto.metrics.v1.GaugeH\x00\x12\x32\n\x03sum\x18\x07 \x01(\x0b\x32#.opentelemetry.proto.metrics.v1.SumH\x00\x12>\n\thistogram\x18\t \x01(\x0b\x32).opentelemetry.proto.metrics.v1.HistogramH\x00\x12U\n\x15\x65xponential_histogram\x18\n \x01(\x0b\x32\x34.opentelemetry.proto.metrics.v1.ExponentialHistogramH\x00\x12:\n\x07summary\x18\x0b \x01(\x0b\x32\'.opentelemetry.proto.metrics.v1.SummaryH\x00\x42\x06\n\x04\x64\x61taJ\x04\x08\x04\x10\x05J\x04\x08\x06\x10\x07J\x04\x08\x08\x10\t\"M\n\x05Gauge\x12\x44\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.NumberDataPoint\"\xba\x01\n\x03Sum\x12\x44\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.NumberDataPoint\x12W\n\x17\x61ggregation_temporality\x18\x02 \x01(\x0e\x32\x36.opentelemetry.proto.metrics.v1.AggregationTemporality\x12\x14\n\x0cis_monotonic\x18\x03 \x01(\x08\"\xad\x01\n\tHistogram\x12G\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32\x32.opentelemetry.proto.metrics.v1.HistogramDataPoint\x12W\n\x17\x61ggregation_temporality\x18\x02 \x01(\x0e\x32\x36.opentelemetry.proto.metrics.v1.AggregationTemporality\"\xc3\x01\n\x14\x45xponentialHistogram\x12R\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32=.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint\x12W\n\x17\x61ggregation_temporality\x18\x02 \x01(\x0e\x32\x36.opentelemetry.proto.metrics.v1.AggregationTemporality\"P\n\x07Summary\x12\x45\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32\x30.opentelemetry.proto.metrics.v1.SummaryDataPoint\"\x86\x02\n\x0fNumberDataPoint\x12;\n\nattributes\x18\x07 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\x13\n\tas_double\x18\x04 \x01(\x01H\x00\x12\x10\n\x06\x61s_int\x18\x06 \x01(\x10H\x00\x12;\n\texemplars\x18\x05 \x03(\x0b\x32(.opentelemetry.proto.metrics.v1.Exemplar\x12\r\n\x05\x66lags\x18\x08 \x01(\rB\x07\n\x05valueJ\x04\x08\x01\x10\x02\"\xe6\x02\n\x12HistogramDataPoint\x12;\n\nattributes\x18\t \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\r\n\x05\x63ount\x18\x04 \x01(\x06\x12\x10\n\x03sum\x18\x05 \x01(\x01H\x00\x88\x01\x01\x12\x15\n\rbucket_counts\x18\x06 \x03(\x06\x12\x17\n\x0f\x65xplicit_bounds\x18\x07 \x03(\x01\x12;\n\texemplars\x18\x08 \x03(\x0b\x32(.opentelemetry.proto.metrics.v1.Exemplar\x12\r\n\x05\x66lags\x18\n \x01(\r\x12\x10\n\x03min\x18\x0b \x01(\x01H\x01\x88\x01\x01\x12\x10\n\x03max\x18\x0c \x01(\x01H\x02\x88\x01\x01\x42\x06\n\x04_sumB\x06\n\x04_minB\x06\n\x04_maxJ\x04\x08\x01\x10\x02\"\xda\x04\n\x1d\x45xponentialHistogramDataPoint\x12;\n\nattributes\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\r\n\x05\x63ount\x18\x04 \x01(\x06\x12\x10\n\x03sum\x18\x05 \x01(\x01H\x00\x88\x01\x01\x12\r\n\x05scale\x18\x06 \x01(\x11\x12\x12\n\nzero_count\x18\x07 \x01(\x06\x12W\n\x08positive\x18\x08 \x01(\x0b\x32\x45.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets\x12W\n\x08negative\x18\t \x01(\x0b\x32\x45.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets\x12\r\n\x05\x66lags\x18\n \x01(\r\x12;\n\texemplars\x18\x0b \x03(\x0b\x32(.opentelemetry.proto.metrics.v1.Exemplar\x12\x10\n\x03min\x18\x0c \x01(\x01H\x01\x88\x01\x01\x12\x10\n\x03max\x18\r \x01(\x01H\x02\x88\x01\x01\x12\x16\n\x0ezero_threshold\x18\x0e \x01(\x01\x1a\x30\n\x07\x42uckets\x12\x0e\n\x06offset\x18\x01 \x01(\x11\x12\x15\n\rbucket_counts\x18\x02 \x03(\x04\x42\x06\n\x04_sumB\x06\n\x04_minB\x06\n\x04_max\"\xc5\x02\n\x10SummaryDataPoint\x12;\n\nattributes\x18\x07 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\r\n\x05\x63ount\x18\x04 \x01(\x06\x12\x0b\n\x03sum\x18\x05 \x01(\x01\x12Y\n\x0fquantile_values\x18\x06 \x03(\x0b\x32@.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile\x12\r\n\x05\x66lags\x18\x08 \x01(\r\x1a\x32\n\x0fValueAtQuantile\x12\x10\n\x08quantile\x18\x01 \x01(\x01\x12\r\n\x05value\x18\x02 \x01(\x01J\x04\x08\x01\x10\x02\"\xc1\x01\n\x08\x45xemplar\x12\x44\n\x13\x66iltered_attributes\x18\x07 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x16\n\x0etime_unix_nano\x18\x02 \x01(\x06\x12\x13\n\tas_double\x18\x03 \x01(\x01H\x00\x12\x10\n\x06\x61s_int\x18\x06 \x01(\x10H\x00\x12\x0f\n\x07span_id\x18\x04 \x01(\x0c\x12\x10\n\x08trace_id\x18\x05 \x01(\x0c\x42\x07\n\x05valueJ\x04\x08\x01\x10\x02*\x8c\x01\n\x16\x41ggregationTemporality\x12\'\n#AGGREGATION_TEMPORALITY_UNSPECIFIED\x10\x00\x12!\n\x1d\x41GGREGATION_TEMPORALITY_DELTA\x10\x01\x12&\n\"AGGREGATION_TEMPORALITY_CUMULATIVE\x10\x02*^\n\x0e\x44\x61taPointFlags\x12\x1f\n\x1b\x44\x41TA_POINT_FLAGS_DO_NOT_USE\x10\x00\x12+\n\'DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK\x10\x01\x42\x7f\n!io.opentelemetry.proto.metrics.v1B\x0cMetricsProtoP\x01Z)go.opentelemetry.io/proto/otlp/metrics/v1\xaa\x02\x1eOpenTelemetry.Proto.Metrics.V1b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,opentelemetry/proto/metrics/v1/metrics.proto\x12\x1eopentelemetry.proto.metrics.v1\x1a*opentelemetry/proto/common/v1/common.proto\x1a.opentelemetry/proto/resource/v1/resource.proto\"X\n\x0bMetricsData\x12I\n\x10resource_metrics\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.ResourceMetrics\"\xaf\x01\n\x0fResourceMetrics\x12;\n\x08resource\x18\x01 \x01(\x0b\x32).opentelemetry.proto.resource.v1.Resource\x12\x43\n\rscope_metrics\x18\x02 \x03(\x0b\x32,.opentelemetry.proto.metrics.v1.ScopeMetrics\x12\x12\n\nschema_url\x18\x03 \x01(\tJ\x06\x08\xe8\x07\x10\xe9\x07\"\x9f\x01\n\x0cScopeMetrics\x12\x42\n\x05scope\x18\x01 \x01(\x0b\x32\x33.opentelemetry.proto.common.v1.InstrumentationScope\x12\x37\n\x07metrics\x18\x02 \x03(\x0b\x32&.opentelemetry.proto.metrics.v1.Metric\x12\x12\n\nschema_url\x18\x03 \x01(\t\"\xcd\x03\n\x06Metric\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0c\n\x04unit\x18\x03 \x01(\t\x12\x36\n\x05gauge\x18\x05 \x01(\x0b\x32%.opentelemetry.proto.metrics.v1.GaugeH\x00\x12\x32\n\x03sum\x18\x07 \x01(\x0b\x32#.opentelemetry.proto.metrics.v1.SumH\x00\x12>\n\thistogram\x18\t \x01(\x0b\x32).opentelemetry.proto.metrics.v1.HistogramH\x00\x12U\n\x15\x65xponential_histogram\x18\n \x01(\x0b\x32\x34.opentelemetry.proto.metrics.v1.ExponentialHistogramH\x00\x12:\n\x07summary\x18\x0b \x01(\x0b\x32\'.opentelemetry.proto.metrics.v1.SummaryH\x00\x12\x39\n\x08metadata\x18\x0c \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValueB\x06\n\x04\x64\x61taJ\x04\x08\x04\x10\x05J\x04\x08\x06\x10\x07J\x04\x08\x08\x10\t\"M\n\x05Gauge\x12\x44\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.NumberDataPoint\"\xba\x01\n\x03Sum\x12\x44\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.NumberDataPoint\x12W\n\x17\x61ggregation_temporality\x18\x02 \x01(\x0e\x32\x36.opentelemetry.proto.metrics.v1.AggregationTemporality\x12\x14\n\x0cis_monotonic\x18\x03 \x01(\x08\"\xad\x01\n\tHistogram\x12G\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32\x32.opentelemetry.proto.metrics.v1.HistogramDataPoint\x12W\n\x17\x61ggregation_temporality\x18\x02 \x01(\x0e\x32\x36.opentelemetry.proto.metrics.v1.AggregationTemporality\"\xc3\x01\n\x14\x45xponentialHistogram\x12R\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32=.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint\x12W\n\x17\x61ggregation_temporality\x18\x02 \x01(\x0e\x32\x36.opentelemetry.proto.metrics.v1.AggregationTemporality\"P\n\x07Summary\x12\x45\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32\x30.opentelemetry.proto.metrics.v1.SummaryDataPoint\"\x86\x02\n\x0fNumberDataPoint\x12;\n\nattributes\x18\x07 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\x13\n\tas_double\x18\x04 \x01(\x01H\x00\x12\x10\n\x06\x61s_int\x18\x06 \x01(\x10H\x00\x12;\n\texemplars\x18\x05 \x03(\x0b\x32(.opentelemetry.proto.metrics.v1.Exemplar\x12\r\n\x05\x66lags\x18\x08 \x01(\rB\x07\n\x05valueJ\x04\x08\x01\x10\x02\"\xe6\x02\n\x12HistogramDataPoint\x12;\n\nattributes\x18\t \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\r\n\x05\x63ount\x18\x04 \x01(\x06\x12\x10\n\x03sum\x18\x05 \x01(\x01H\x00\x88\x01\x01\x12\x15\n\rbucket_counts\x18\x06 \x03(\x06\x12\x17\n\x0f\x65xplicit_bounds\x18\x07 \x03(\x01\x12;\n\texemplars\x18\x08 \x03(\x0b\x32(.opentelemetry.proto.metrics.v1.Exemplar\x12\r\n\x05\x66lags\x18\n \x01(\r\x12\x10\n\x03min\x18\x0b \x01(\x01H\x01\x88\x01\x01\x12\x10\n\x03max\x18\x0c \x01(\x01H\x02\x88\x01\x01\x42\x06\n\x04_sumB\x06\n\x04_minB\x06\n\x04_maxJ\x04\x08\x01\x10\x02\"\xda\x04\n\x1d\x45xponentialHistogramDataPoint\x12;\n\nattributes\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\r\n\x05\x63ount\x18\x04 \x01(\x06\x12\x10\n\x03sum\x18\x05 \x01(\x01H\x00\x88\x01\x01\x12\r\n\x05scale\x18\x06 \x01(\x11\x12\x12\n\nzero_count\x18\x07 \x01(\x06\x12W\n\x08positive\x18\x08 \x01(\x0b\x32\x45.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets\x12W\n\x08negative\x18\t \x01(\x0b\x32\x45.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets\x12\r\n\x05\x66lags\x18\n \x01(\r\x12;\n\texemplars\x18\x0b \x03(\x0b\x32(.opentelemetry.proto.metrics.v1.Exemplar\x12\x10\n\x03min\x18\x0c \x01(\x01H\x01\x88\x01\x01\x12\x10\n\x03max\x18\r \x01(\x01H\x02\x88\x01\x01\x12\x16\n\x0ezero_threshold\x18\x0e \x01(\x01\x1a\x30\n\x07\x42uckets\x12\x0e\n\x06offset\x18\x01 \x01(\x11\x12\x15\n\rbucket_counts\x18\x02 \x03(\x04\x42\x06\n\x04_sumB\x06\n\x04_minB\x06\n\x04_max\"\xc5\x02\n\x10SummaryDataPoint\x12;\n\nattributes\x18\x07 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\r\n\x05\x63ount\x18\x04 \x01(\x06\x12\x0b\n\x03sum\x18\x05 \x01(\x01\x12Y\n\x0fquantile_values\x18\x06 \x03(\x0b\x32@.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile\x12\r\n\x05\x66lags\x18\x08 \x01(\r\x1a\x32\n\x0fValueAtQuantile\x12\x10\n\x08quantile\x18\x01 \x01(\x01\x12\r\n\x05value\x18\x02 \x01(\x01J\x04\x08\x01\x10\x02\"\xc1\x01\n\x08\x45xemplar\x12\x44\n\x13\x66iltered_attributes\x18\x07 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x16\n\x0etime_unix_nano\x18\x02 \x01(\x06\x12\x13\n\tas_double\x18\x03 \x01(\x01H\x00\x12\x10\n\x06\x61s_int\x18\x06 \x01(\x10H\x00\x12\x0f\n\x07span_id\x18\x04 \x01(\x0c\x12\x10\n\x08trace_id\x18\x05 \x01(\x0c\x42\x07\n\x05valueJ\x04\x08\x01\x10\x02*\x8c\x01\n\x16\x41ggregationTemporality\x12\'\n#AGGREGATION_TEMPORALITY_UNSPECIFIED\x10\x00\x12!\n\x1d\x41GGREGATION_TEMPORALITY_DELTA\x10\x01\x12&\n\"AGGREGATION_TEMPORALITY_CUMULATIVE\x10\x02*^\n\x0e\x44\x61taPointFlags\x12\x1f\n\x1b\x44\x41TA_POINT_FLAGS_DO_NOT_USE\x10\x00\x12+\n\'DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK\x10\x01\x42\x7f\n!io.opentelemetry.proto.metrics.v1B\x0cMetricsProtoP\x01Z)go.opentelemetry.io/proto/otlp/metrics/v1\xaa\x02\x1eOpenTelemetry.Proto.Metrics.V1b\x06proto3') _AGGREGATIONTEMPORALITY = DESCRIPTOR.enum_types_by_name['AggregationTemporality'] AggregationTemporality = enum_type_wrapper.EnumTypeWrapper(_AGGREGATIONTEMPORALITY) @@ -164,10 +164,10 @@ DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n!io.opentelemetry.proto.metrics.v1B\014MetricsProtoP\001Z)go.opentelemetry.io/proto/otlp/metrics/v1\252\002\036OpenTelemetry.Proto.Metrics.V1' - _AGGREGATIONTEMPORALITY._serialized_start=3487 - _AGGREGATIONTEMPORALITY._serialized_end=3627 - _DATAPOINTFLAGS._serialized_start=3629 - _DATAPOINTFLAGS._serialized_end=3723 + _AGGREGATIONTEMPORALITY._serialized_start=3546 + _AGGREGATIONTEMPORALITY._serialized_end=3686 + _DATAPOINTFLAGS._serialized_start=3688 + _DATAPOINTFLAGS._serialized_end=3782 _METRICSDATA._serialized_start=172 _METRICSDATA._serialized_end=260 _RESOURCEMETRICS._serialized_start=263 @@ -175,29 +175,29 @@ _SCOPEMETRICS._serialized_start=441 _SCOPEMETRICS._serialized_end=600 _METRIC._serialized_start=603 - _METRIC._serialized_end=1005 - _GAUGE._serialized_start=1007 - _GAUGE._serialized_end=1084 - _SUM._serialized_start=1087 - _SUM._serialized_end=1273 - _HISTOGRAM._serialized_start=1276 - _HISTOGRAM._serialized_end=1449 - _EXPONENTIALHISTOGRAM._serialized_start=1452 - _EXPONENTIALHISTOGRAM._serialized_end=1647 - _SUMMARY._serialized_start=1649 - _SUMMARY._serialized_end=1729 - _NUMBERDATAPOINT._serialized_start=1732 - _NUMBERDATAPOINT._serialized_end=1994 - _HISTOGRAMDATAPOINT._serialized_start=1997 - _HISTOGRAMDATAPOINT._serialized_end=2355 - _EXPONENTIALHISTOGRAMDATAPOINT._serialized_start=2358 - _EXPONENTIALHISTOGRAMDATAPOINT._serialized_end=2960 - _EXPONENTIALHISTOGRAMDATAPOINT_BUCKETS._serialized_start=2888 - _EXPONENTIALHISTOGRAMDATAPOINT_BUCKETS._serialized_end=2936 - _SUMMARYDATAPOINT._serialized_start=2963 - _SUMMARYDATAPOINT._serialized_end=3288 - _SUMMARYDATAPOINT_VALUEATQUANTILE._serialized_start=3232 - _SUMMARYDATAPOINT_VALUEATQUANTILE._serialized_end=3282 - _EXEMPLAR._serialized_start=3291 - _EXEMPLAR._serialized_end=3484 + _METRIC._serialized_end=1064 + _GAUGE._serialized_start=1066 + _GAUGE._serialized_end=1143 + _SUM._serialized_start=1146 + _SUM._serialized_end=1332 + _HISTOGRAM._serialized_start=1335 + _HISTOGRAM._serialized_end=1508 + _EXPONENTIALHISTOGRAM._serialized_start=1511 + _EXPONENTIALHISTOGRAM._serialized_end=1706 + _SUMMARY._serialized_start=1708 + _SUMMARY._serialized_end=1788 + _NUMBERDATAPOINT._serialized_start=1791 + _NUMBERDATAPOINT._serialized_end=2053 + _HISTOGRAMDATAPOINT._serialized_start=2056 + _HISTOGRAMDATAPOINT._serialized_end=2414 + _EXPONENTIALHISTOGRAMDATAPOINT._serialized_start=2417 + _EXPONENTIALHISTOGRAMDATAPOINT._serialized_end=3019 + _EXPONENTIALHISTOGRAMDATAPOINT_BUCKETS._serialized_start=2947 + _EXPONENTIALHISTOGRAMDATAPOINT_BUCKETS._serialized_end=2995 + _SUMMARYDATAPOINT._serialized_start=3022 + _SUMMARYDATAPOINT._serialized_end=3347 + _SUMMARYDATAPOINT_VALUEATQUANTILE._serialized_start=3291 + _SUMMARYDATAPOINT_VALUEATQUANTILE._serialized_end=3341 + _EXEMPLAR._serialized_start=3350 + _EXEMPLAR._serialized_end=3543 # @@protoc_insertion_point(module_scope) diff --git a/opentelemetry-proto/src/opentelemetry/proto/metrics/v1/metrics_pb2.pyi b/opentelemetry-proto/src/opentelemetry/proto/metrics/v1/metrics_pb2.pyi index ccbbb35cfbb..8fd86329610 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/metrics/v1/metrics_pb2.pyi +++ b/opentelemetry-proto/src/opentelemetry/proto/metrics/v1/metrics_pb2.pyi @@ -250,7 +250,10 @@ class ResourceMetrics(google.protobuf.message.Message): """A list of metrics that originate from a resource.""" pass schema_url: typing.Text = ... - """This schema_url applies to the data in the "resource" field. It does not apply + """The Schema URL, if known. This is the identifier of the Schema that the resource data + is recorded in. To learn more about Schema URL see + https://opentelemetry.io/docs/specs/otel/schemas/#schema-url + This schema_url applies to the data in the "resource" field. It does not apply to the data in the "scope_metrics" field which have their own schema_url field. """ @@ -282,7 +285,11 @@ class ScopeMetrics(google.protobuf.message.Message): """A list of metrics that originate from an instrumentation library.""" pass schema_url: typing.Text = ... - """This schema_url applies to all metrics in the "metrics" field.""" + """The Schema URL, if known. This is the identifier of the Schema that the metric data + is recorded in. To learn more about Schema URL see + https://opentelemetry.io/docs/specs/otel/schemas/#schema-url + This schema_url applies to all metrics in the "metrics" field. + """ def __init__(self, *, @@ -390,8 +397,9 @@ class Metric(google.protobuf.message.Message): HISTOGRAM_FIELD_NUMBER: builtins.int EXPONENTIAL_HISTOGRAM_FIELD_NUMBER: builtins.int SUMMARY_FIELD_NUMBER: builtins.int + METADATA_FIELD_NUMBER: builtins.int name: typing.Text = ... - """name of the metric, including its DNS name prefix. It must be unique.""" + """name of the metric.""" description: typing.Text = ... """description of the metric, which can be used in documentation.""" @@ -411,6 +419,17 @@ class Metric(google.protobuf.message.Message): def exponential_histogram(self) -> global___ExponentialHistogram: ... @property def summary(self) -> global___Summary: ... + @property + def metadata(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[opentelemetry.proto.common.v1.common_pb2.KeyValue]: + """Additional metadata attributes that describe the metric. [Optional]. + Attributes are non-identifying. + Consumers SHOULD NOT need to be aware of these attributes. + These attributes MAY be used to encode information allowing + for lossless roundtrip translation to / from another data model. + Attribute keys MUST be unique (it is not allowed to have more than one + attribute with the same key). + """ + pass def __init__(self, *, name : typing.Text = ..., @@ -421,9 +440,10 @@ class Metric(google.protobuf.message.Message): histogram : typing.Optional[global___Histogram] = ..., exponential_histogram : typing.Optional[global___ExponentialHistogram] = ..., summary : typing.Optional[global___Summary] = ..., + metadata : typing.Optional[typing.Iterable[opentelemetry.proto.common.v1.common_pb2.KeyValue]] = ..., ) -> None: ... def HasField(self, field_name: typing_extensions.Literal["data",b"data","exponential_histogram",b"exponential_histogram","gauge",b"gauge","histogram",b"histogram","sum",b"sum","summary",b"summary"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["data",b"data","description",b"description","exponential_histogram",b"exponential_histogram","gauge",b"gauge","histogram",b"histogram","name",b"name","sum",b"sum","summary",b"summary","unit",b"unit"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["data",b"data","description",b"description","exponential_histogram",b"exponential_histogram","gauge",b"gauge","histogram",b"histogram","metadata",b"metadata","name",b"name","sum",b"sum","summary",b"summary","unit",b"unit"]) -> None: ... def WhichOneof(self, oneof_group: typing_extensions.Literal["data",b"data"]) -> typing.Optional[typing_extensions.Literal["gauge","sum","histogram","exponential_histogram","summary"]]: ... global___Metric = Metric diff --git a/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_pb2.py b/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_pb2.py index 6e80acce517..5a9fec5eaa3 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_pb2.py +++ b/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_pb2.py @@ -2,6 +2,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: opentelemetry/proto/trace/v1/trace.proto """Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message @@ -16,8 +17,14 @@ from opentelemetry.proto.resource.v1 import resource_pb2 as opentelemetry_dot_proto_dot_resource_dot_v1_dot_resource__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(opentelemetry/proto/trace/v1/trace.proto\x12\x1copentelemetry.proto.trace.v1\x1a*opentelemetry/proto/common/v1/common.proto\x1a.opentelemetry/proto/resource/v1/resource.proto\"Q\n\nTracesData\x12\x43\n\x0eresource_spans\x18\x01 \x03(\x0b\x32+.opentelemetry.proto.trace.v1.ResourceSpans\"\xa7\x01\n\rResourceSpans\x12;\n\x08resource\x18\x01 \x01(\x0b\x32).opentelemetry.proto.resource.v1.Resource\x12=\n\x0bscope_spans\x18\x02 \x03(\x0b\x32(.opentelemetry.proto.trace.v1.ScopeSpans\x12\x12\n\nschema_url\x18\x03 \x01(\tJ\x06\x08\xe8\x07\x10\xe9\x07\"\x97\x01\n\nScopeSpans\x12\x42\n\x05scope\x18\x01 \x01(\x0b\x32\x33.opentelemetry.proto.common.v1.InstrumentationScope\x12\x31\n\x05spans\x18\x02 \x03(\x0b\x32\".opentelemetry.proto.trace.v1.Span\x12\x12\n\nschema_url\x18\x03 \x01(\t\"\xe6\x07\n\x04Span\x12\x10\n\x08trace_id\x18\x01 \x01(\x0c\x12\x0f\n\x07span_id\x18\x02 \x01(\x0c\x12\x13\n\x0btrace_state\x18\x03 \x01(\t\x12\x16\n\x0eparent_span_id\x18\x04 \x01(\x0c\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\x39\n\x04kind\x18\x06 \x01(\x0e\x32+.opentelemetry.proto.trace.v1.Span.SpanKind\x12\x1c\n\x14start_time_unix_nano\x18\x07 \x01(\x06\x12\x1a\n\x12\x65nd_time_unix_nano\x18\x08 \x01(\x06\x12;\n\nattributes\x18\t \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\n \x01(\r\x12\x38\n\x06\x65vents\x18\x0b \x03(\x0b\x32(.opentelemetry.proto.trace.v1.Span.Event\x12\x1c\n\x14\x64ropped_events_count\x18\x0c \x01(\r\x12\x36\n\x05links\x18\r \x03(\x0b\x32\'.opentelemetry.proto.trace.v1.Span.Link\x12\x1b\n\x13\x64ropped_links_count\x18\x0e \x01(\r\x12\x34\n\x06status\x18\x0f \x01(\x0b\x32$.opentelemetry.proto.trace.v1.Status\x1a\x8c\x01\n\x05\x45vent\x12\x16\n\x0etime_unix_nano\x18\x01 \x01(\x06\x12\x0c\n\x04name\x18\x02 \x01(\t\x12;\n\nattributes\x18\x03 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x04 \x01(\r\x1a\x9d\x01\n\x04Link\x12\x10\n\x08trace_id\x18\x01 \x01(\x0c\x12\x0f\n\x07span_id\x18\x02 \x01(\x0c\x12\x13\n\x0btrace_state\x18\x03 \x01(\t\x12;\n\nattributes\x18\x04 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x05 \x01(\r\"\x99\x01\n\x08SpanKind\x12\x19\n\x15SPAN_KIND_UNSPECIFIED\x10\x00\x12\x16\n\x12SPAN_KIND_INTERNAL\x10\x01\x12\x14\n\x10SPAN_KIND_SERVER\x10\x02\x12\x14\n\x10SPAN_KIND_CLIENT\x10\x03\x12\x16\n\x12SPAN_KIND_PRODUCER\x10\x04\x12\x16\n\x12SPAN_KIND_CONSUMER\x10\x05\"\xae\x01\n\x06Status\x12\x0f\n\x07message\x18\x02 \x01(\t\x12=\n\x04\x63ode\x18\x03 \x01(\x0e\x32/.opentelemetry.proto.trace.v1.Status.StatusCode\"N\n\nStatusCode\x12\x15\n\x11STATUS_CODE_UNSET\x10\x00\x12\x12\n\x0eSTATUS_CODE_OK\x10\x01\x12\x15\n\x11STATUS_CODE_ERROR\x10\x02J\x04\x08\x01\x10\x02\x42w\n\x1fio.opentelemetry.proto.trace.v1B\nTraceProtoP\x01Z\'go.opentelemetry.io/proto/otlp/trace/v1\xaa\x02\x1cOpenTelemetry.Proto.Trace.V1b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(opentelemetry/proto/trace/v1/trace.proto\x12\x1copentelemetry.proto.trace.v1\x1a*opentelemetry/proto/common/v1/common.proto\x1a.opentelemetry/proto/resource/v1/resource.proto\"Q\n\nTracesData\x12\x43\n\x0eresource_spans\x18\x01 \x03(\x0b\x32+.opentelemetry.proto.trace.v1.ResourceSpans\"\xa7\x01\n\rResourceSpans\x12;\n\x08resource\x18\x01 \x01(\x0b\x32).opentelemetry.proto.resource.v1.Resource\x12=\n\x0bscope_spans\x18\x02 \x03(\x0b\x32(.opentelemetry.proto.trace.v1.ScopeSpans\x12\x12\n\nschema_url\x18\x03 \x01(\tJ\x06\x08\xe8\x07\x10\xe9\x07\"\x97\x01\n\nScopeSpans\x12\x42\n\x05scope\x18\x01 \x01(\x0b\x32\x33.opentelemetry.proto.common.v1.InstrumentationScope\x12\x31\n\x05spans\x18\x02 \x03(\x0b\x32\".opentelemetry.proto.trace.v1.Span\x12\x12\n\nschema_url\x18\x03 \x01(\t\"\x84\x08\n\x04Span\x12\x10\n\x08trace_id\x18\x01 \x01(\x0c\x12\x0f\n\x07span_id\x18\x02 \x01(\x0c\x12\x13\n\x0btrace_state\x18\x03 \x01(\t\x12\x16\n\x0eparent_span_id\x18\x04 \x01(\x0c\x12\r\n\x05\x66lags\x18\x10 \x01(\x07\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\x39\n\x04kind\x18\x06 \x01(\x0e\x32+.opentelemetry.proto.trace.v1.Span.SpanKind\x12\x1c\n\x14start_time_unix_nano\x18\x07 \x01(\x06\x12\x1a\n\x12\x65nd_time_unix_nano\x18\x08 \x01(\x06\x12;\n\nattributes\x18\t \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\n \x01(\r\x12\x38\n\x06\x65vents\x18\x0b \x03(\x0b\x32(.opentelemetry.proto.trace.v1.Span.Event\x12\x1c\n\x14\x64ropped_events_count\x18\x0c \x01(\r\x12\x36\n\x05links\x18\r \x03(\x0b\x32\'.opentelemetry.proto.trace.v1.Span.Link\x12\x1b\n\x13\x64ropped_links_count\x18\x0e \x01(\r\x12\x34\n\x06status\x18\x0f \x01(\x0b\x32$.opentelemetry.proto.trace.v1.Status\x1a\x8c\x01\n\x05\x45vent\x12\x16\n\x0etime_unix_nano\x18\x01 \x01(\x06\x12\x0c\n\x04name\x18\x02 \x01(\t\x12;\n\nattributes\x18\x03 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x04 \x01(\r\x1a\xac\x01\n\x04Link\x12\x10\n\x08trace_id\x18\x01 \x01(\x0c\x12\x0f\n\x07span_id\x18\x02 \x01(\x0c\x12\x13\n\x0btrace_state\x18\x03 \x01(\t\x12;\n\nattributes\x18\x04 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x05 \x01(\r\x12\r\n\x05\x66lags\x18\x06 \x01(\x07\"\x99\x01\n\x08SpanKind\x12\x19\n\x15SPAN_KIND_UNSPECIFIED\x10\x00\x12\x16\n\x12SPAN_KIND_INTERNAL\x10\x01\x12\x14\n\x10SPAN_KIND_SERVER\x10\x02\x12\x14\n\x10SPAN_KIND_CLIENT\x10\x03\x12\x16\n\x12SPAN_KIND_PRODUCER\x10\x04\x12\x16\n\x12SPAN_KIND_CONSUMER\x10\x05\"\xae\x01\n\x06Status\x12\x0f\n\x07message\x18\x02 \x01(\t\x12=\n\x04\x63ode\x18\x03 \x01(\x0e\x32/.opentelemetry.proto.trace.v1.Status.StatusCode\"N\n\nStatusCode\x12\x15\n\x11STATUS_CODE_UNSET\x10\x00\x12\x12\n\x0eSTATUS_CODE_OK\x10\x01\x12\x15\n\x11STATUS_CODE_ERROR\x10\x02J\x04\x08\x01\x10\x02*\x9c\x01\n\tSpanFlags\x12\x19\n\x15SPAN_FLAGS_DO_NOT_USE\x10\x00\x12 \n\x1bSPAN_FLAGS_TRACE_FLAGS_MASK\x10\xff\x01\x12*\n%SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK\x10\x80\x02\x12&\n!SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK\x10\x80\x04\x42w\n\x1fio.opentelemetry.proto.trace.v1B\nTraceProtoP\x01Z\'go.opentelemetry.io/proto/otlp/trace/v1\xaa\x02\x1cOpenTelemetry.Proto.Trace.V1b\x06proto3') +_SPANFLAGS = DESCRIPTOR.enum_types_by_name['SpanFlags'] +SpanFlags = enum_type_wrapper.EnumTypeWrapper(_SPANFLAGS) +SPAN_FLAGS_DO_NOT_USE = 0 +SPAN_FLAGS_TRACE_FLAGS_MASK = 255 +SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK = 256 +SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 512 _TRACESDATA = DESCRIPTOR.message_types_by_name['TracesData'] @@ -84,6 +91,8 @@ DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n\037io.opentelemetry.proto.trace.v1B\nTraceProtoP\001Z\'go.opentelemetry.io/proto/otlp/trace/v1\252\002\034OpenTelemetry.Proto.Trace.V1' + _SPANFLAGS._serialized_start=1782 + _SPANFLAGS._serialized_end=1938 _TRACESDATA._serialized_start=166 _TRACESDATA._serialized_end=247 _RESOURCESPANS._serialized_start=250 @@ -91,15 +100,15 @@ _SCOPESPANS._serialized_start=420 _SCOPESPANS._serialized_end=571 _SPAN._serialized_start=574 - _SPAN._serialized_end=1572 - _SPAN_EVENT._serialized_start=1116 - _SPAN_EVENT._serialized_end=1256 - _SPAN_LINK._serialized_start=1259 - _SPAN_LINK._serialized_end=1416 - _SPAN_SPANKIND._serialized_start=1419 - _SPAN_SPANKIND._serialized_end=1572 - _STATUS._serialized_start=1575 - _STATUS._serialized_end=1749 - _STATUS_STATUSCODE._serialized_start=1665 - _STATUS_STATUSCODE._serialized_end=1743 + _SPAN._serialized_end=1602 + _SPAN_EVENT._serialized_start=1131 + _SPAN_EVENT._serialized_end=1271 + _SPAN_LINK._serialized_start=1274 + _SPAN_LINK._serialized_end=1446 + _SPAN_SPANKIND._serialized_start=1449 + _SPAN_SPANKIND._serialized_end=1602 + _STATUS._serialized_start=1605 + _STATUS._serialized_end=1779 + _STATUS_STATUSCODE._serialized_start=1695 + _STATUS_STATUSCODE._serialized_end=1773 # @@protoc_insertion_point(module_scope) diff --git a/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_pb2.pyi b/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_pb2.pyi index 52052ff7e96..b1aaf784c9c 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_pb2.pyi +++ b/opentelemetry-proto/src/opentelemetry/proto/trace/v1/trace_pb2.pyi @@ -14,6 +14,61 @@ import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ... +class SpanFlags(_SpanFlags, metaclass=_SpanFlagsEnumTypeWrapper): + """SpanFlags represents constants used to interpret the + Span.flags field, which is protobuf 'fixed32' type and is to + be used as bit-fields. Each non-zero value defined in this enum is + a bit-mask. To extract the bit-field, for example, use an + expression like: + + (span.flags & SPAN_FLAGS_TRACE_FLAGS_MASK) + + See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. + + Note that Span flags were introduced in version 1.1 of the + OpenTelemetry protocol. Older Span producers do not set this + field, consequently consumers should not rely on the absence of a + particular flag bit to indicate the presence of a particular feature. + """ + pass +class _SpanFlags: + V = typing.NewType('V', builtins.int) +class _SpanFlagsEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SpanFlags.V], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor = ... + SPAN_FLAGS_DO_NOT_USE = SpanFlags.V(0) + """The zero value for the enum. Should not be used for comparisons. + Instead use bitwise "and" with the appropriate mask as shown above. + """ + + SPAN_FLAGS_TRACE_FLAGS_MASK = SpanFlags.V(255) + """Bits 0-7 are used for trace flags.""" + + SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK = SpanFlags.V(256) + """Bits 8 and 9 are used to indicate that the parent span or link span is remote. + Bit 8 (`HAS_IS_REMOTE`) indicates whether the value is known. + Bit 9 (`IS_REMOTE`) indicates whether the span or link is remote. + """ + + SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = SpanFlags.V(512) + +SPAN_FLAGS_DO_NOT_USE = SpanFlags.V(0) +"""The zero value for the enum. Should not be used for comparisons. +Instead use bitwise "and" with the appropriate mask as shown above. +""" + +SPAN_FLAGS_TRACE_FLAGS_MASK = SpanFlags.V(255) +"""Bits 0-7 are used for trace flags.""" + +SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK = SpanFlags.V(256) +"""Bits 8 and 9 are used to indicate that the parent span or link span is remote. +Bit 8 (`HAS_IS_REMOTE`) indicates whether the value is known. +Bit 9 (`IS_REMOTE`) indicates whether the span or link is remote. +""" + +SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = SpanFlags.V(512) +global___SpanFlags = SpanFlags + + class TracesData(google.protobuf.message.Message): """TracesData represents the traces data that can be stored in a persistent storage, OR can be embedded by other protocols that transfer OTLP traces data but do @@ -61,7 +116,10 @@ class ResourceSpans(google.protobuf.message.Message): """A list of ScopeSpans that originate from a resource.""" pass schema_url: typing.Text = ... - """This schema_url applies to the data in the "resource" field. It does not apply + """The Schema URL, if known. This is the identifier of the Schema that the resource data + is recorded in. To learn more about Schema URL see + https://opentelemetry.io/docs/specs/otel/schemas/#schema-url + This schema_url applies to the data in the "resource" field. It does not apply to the data in the "scope_spans" field which have their own schema_url field. """ @@ -93,7 +151,11 @@ class ScopeSpans(google.protobuf.message.Message): """A list of Spans that originate from an instrumentation scope.""" pass schema_url: typing.Text = ... - """This schema_url applies to all spans and span events in the "spans" field.""" + """The Schema URL, if known. This is the identifier of the Schema that the span data + is recorded in. To learn more about Schema URL see + https://opentelemetry.io/docs/specs/otel/schemas/#schema-url + This schema_url applies to all spans and span events in the "spans" field. + """ def __init__(self, *, @@ -234,6 +296,7 @@ class Span(google.protobuf.message.Message): TRACE_STATE_FIELD_NUMBER: builtins.int ATTRIBUTES_FIELD_NUMBER: builtins.int DROPPED_ATTRIBUTES_COUNT_FIELD_NUMBER: builtins.int + FLAGS_FIELD_NUMBER: builtins.int trace_id: builtins.bytes = ... """A unique identifier of a trace that this linked span is part of. The ID is a 16-byte array. @@ -257,6 +320,26 @@ class Span(google.protobuf.message.Message): then no attributes were dropped. """ + flags: builtins.int = ... + """Flags, a bit field. + + Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace + Context specification. To read the 8-bit W3C trace flag, use + `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`. + + See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. + + Bits 8 and 9 represent the 3 states of whether the link is remote. + The states are (unknown, is not remote, is remote). + To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`. + To read whether the link is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`. + + Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero. + When creating new spans, bits 10-31 (most-significant 22-bits) MUST be zero. + + [Optional]. + """ + def __init__(self, *, trace_id : builtins.bytes = ..., @@ -264,13 +347,15 @@ class Span(google.protobuf.message.Message): trace_state : typing.Text = ..., attributes : typing.Optional[typing.Iterable[opentelemetry.proto.common.v1.common_pb2.KeyValue]] = ..., dropped_attributes_count : builtins.int = ..., + flags : builtins.int = ..., ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["attributes",b"attributes","dropped_attributes_count",b"dropped_attributes_count","span_id",b"span_id","trace_id",b"trace_id","trace_state",b"trace_state"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["attributes",b"attributes","dropped_attributes_count",b"dropped_attributes_count","flags",b"flags","span_id",b"span_id","trace_id",b"trace_id","trace_state",b"trace_state"]) -> None: ... TRACE_ID_FIELD_NUMBER: builtins.int SPAN_ID_FIELD_NUMBER: builtins.int TRACE_STATE_FIELD_NUMBER: builtins.int PARENT_SPAN_ID_FIELD_NUMBER: builtins.int + FLAGS_FIELD_NUMBER: builtins.int NAME_FIELD_NUMBER: builtins.int KIND_FIELD_NUMBER: builtins.int START_TIME_UNIX_NANO_FIELD_NUMBER: builtins.int @@ -311,6 +396,30 @@ class Span(google.protobuf.message.Message): field must be empty. The ID is an 8-byte array. """ + flags: builtins.int = ... + """Flags, a bit field. + + Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace + Context specification. To read the 8-bit W3C trace flag, use + `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`. + + See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. + + Bits 8 and 9 represent the 3 states of whether a span's parent + is remote. The states are (unknown, is not remote, is remote). + To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`. + To read whether the span is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`. + + When creating span messages, if the message is logically forwarded from another source + with an equivalent flags fields (i.e., usually another OTLP span message), the field SHOULD + be copied as-is. If creating from a source that does not have an equivalent flags field + (such as a runtime representation of an OpenTelemetry span), the high 22 bits MUST + be set to zero. + Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero. + + [Optional]. + """ + name: typing.Text = ... """A description of the span's operation. @@ -403,6 +512,7 @@ class Span(google.protobuf.message.Message): span_id : builtins.bytes = ..., trace_state : typing.Text = ..., parent_span_id : builtins.bytes = ..., + flags : builtins.int = ..., name : typing.Text = ..., kind : global___Span.SpanKind.V = ..., start_time_unix_nano : builtins.int = ..., @@ -416,7 +526,7 @@ class Span(google.protobuf.message.Message): status : typing.Optional[global___Status] = ..., ) -> None: ... def HasField(self, field_name: typing_extensions.Literal["status",b"status"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["attributes",b"attributes","dropped_attributes_count",b"dropped_attributes_count","dropped_events_count",b"dropped_events_count","dropped_links_count",b"dropped_links_count","end_time_unix_nano",b"end_time_unix_nano","events",b"events","kind",b"kind","links",b"links","name",b"name","parent_span_id",b"parent_span_id","span_id",b"span_id","start_time_unix_nano",b"start_time_unix_nano","status",b"status","trace_id",b"trace_id","trace_state",b"trace_state"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["attributes",b"attributes","dropped_attributes_count",b"dropped_attributes_count","dropped_events_count",b"dropped_events_count","dropped_links_count",b"dropped_links_count","end_time_unix_nano",b"end_time_unix_nano","events",b"events","flags",b"flags","kind",b"kind","links",b"links","name",b"name","parent_span_id",b"parent_span_id","span_id",b"span_id","start_time_unix_nano",b"start_time_unix_nano","status",b"status","trace_id",b"trace_id","trace_state",b"trace_state"]) -> None: ... global___Span = Span class Status(google.protobuf.message.Message): diff --git a/opentelemetry-proto/src/opentelemetry/proto/version.py b/opentelemetry-proto/src/opentelemetry/proto/version.py index 8c35630f0e1..e8b404f0501 100644 --- a/opentelemetry-proto/src/opentelemetry/proto/version.py +++ b/opentelemetry-proto/src/opentelemetry/proto/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "1.24.0.dev" +__version__ = "1.25.0.dev" diff --git a/opentelemetry-proto/test-requirements.txt b/opentelemetry-proto/test-requirements-0.txt similarity index 94% rename from opentelemetry-proto/test-requirements.txt rename to opentelemetry-proto/test-requirements-0.txt index 4908ed5baaf..811544a0826 100644 --- a/opentelemetry-proto/test-requirements.txt +++ b/opentelemetry-proto/test-requirements-0.txt @@ -6,6 +6,7 @@ importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==23.2 pluggy==1.4.0 +protobuf==3.20.3 py==1.11.0 py-cpuinfo==9.0.0 pytest==7.1.3 diff --git a/opentelemetry-proto/test-requirements-1.txt b/opentelemetry-proto/test-requirements-1.txt new file mode 100644 index 00000000000..5b10e6867a7 --- /dev/null +++ b/opentelemetry-proto/test-requirements-1.txt @@ -0,0 +1,18 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +flaky==3.7.0 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +protobuf==4.25.3 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-proto diff --git a/opentelemetry-sdk/pyproject.toml b/opentelemetry-sdk/pyproject.toml index ea5d1ec2b0c..25568d42c6d 100644 --- a/opentelemetry-sdk/pyproject.toml +++ b/opentelemetry-sdk/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ "Typing :: Typed", ] dependencies = [ - "opentelemetry-api == 1.24.0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-api == 1.25.0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", "typing-extensions >= 3.7.4", ] diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/aggregation.py b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/aggregation.py index 3ec37473f60..3f93c91fa24 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/aggregation.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/aggregation.py @@ -37,6 +37,9 @@ from opentelemetry.sdk.metrics._internal.exponential_histogram.buckets import ( Buckets, ) +from opentelemetry.sdk.metrics._internal.exponential_histogram.mapping import ( + Mapping, +) from opentelemetry.sdk.metrics._internal.exponential_histogram.mapping.exponent_mapping import ( ExponentMapping, ) @@ -519,6 +522,12 @@ def collect( return None +def _new_exponential_mapping(scale: int) -> Mapping: + if scale <= 0: + return ExponentMapping(scale) + return LogarithmMapping(scale) + + # pylint: disable=protected-access class _ExponentialBucketHistogramAggregation(_Aggregation[HistogramPoint]): # _min_max_size and _max_max_size are the smallest and largest values @@ -592,13 +601,15 @@ def __init__( "larger than the recommended value of 20", self._max_scale, ) - self._mapping = LogarithmMapping(self._max_scale) + self._mapping = _new_exponential_mapping(self._max_scale) self._instrument_aggregation_temporality = AggregationTemporality.DELTA self._start_time_unix_nano = start_time_unix_nano self._previous_scale = None self._previous_start_time_unix_nano = None + self._previous_zero_count = None + self._previous_count = None self._previous_sum = None self._previous_max = None self._previous_min = None @@ -678,11 +689,14 @@ def aggregate(self, measurement: Measurement) -> None: # 4. Rescale the mapping if needed. if is_rescaling_needed: + scale_change = self._get_scale_change(low, high) self._downscale( - self._get_scale_change(low, high), + scale_change, self._positive, self._negative, ) + new_scale = self._mapping.scale - scale_change + self._mapping = _new_exponential_mapping(new_scale) index = self._mapping.map_to_index(value) @@ -756,28 +770,6 @@ def collect( self._min = inf self._max = -inf - current_point = ExponentialHistogramDataPoint( - attributes=self._attributes, - start_time_unix_nano=current_start_time_unix_nano, - time_unix_nano=collection_start_nano, - count=current_count, - sum=current_sum, - scale=current_scale, - zero_count=current_zero_count, - positive=BucketsPoint( - offset=current_positive.offset, - bucket_counts=current_positive.counts, - ), - negative=BucketsPoint( - offset=current_negative.offset, - bucket_counts=current_negative.counts, - ), - # FIXME: Find the right value for flags - flags=0, - min=current_min, - max=current_max, - ) - if self._previous_scale is None or ( self._instrument_aggregation_temporality is collection_aggregation_temporality @@ -789,18 +781,48 @@ def collect( self._previous_max = current_max self._previous_min = current_min self._previous_sum = current_sum + self._previous_count = current_count + self._previous_zero_count = current_zero_count self._previous_positive = current_positive self._previous_negative = current_negative + current_point = ExponentialHistogramDataPoint( + attributes=self._attributes, + start_time_unix_nano=current_start_time_unix_nano, + time_unix_nano=collection_start_nano, + count=current_count, + sum=current_sum, + scale=current_scale, + zero_count=current_zero_count, + positive=BucketsPoint( + offset=current_positive.offset, + bucket_counts=current_positive.get_offset_counts(), + ), + negative=BucketsPoint( + offset=current_negative.offset, + bucket_counts=current_negative.get_offset_counts(), + ), + # FIXME: Find the right value for flags + flags=0, + min=current_min, + max=current_max, + ) + return current_point min_scale = min(self._previous_scale, current_scale) low_positive, high_positive = self._get_low_high_previous_current( - self._previous_positive, current_positive, min_scale + self._previous_positive, + current_positive, + current_scale, + min_scale, ) low_negative, high_negative = self._get_low_high_previous_current( - self._previous_negative, current_negative, min_scale + self._previous_negative, + current_negative, + current_scale, + min_scale, ) min_scale = min( @@ -814,10 +836,11 @@ def collect( # but the histogram) has a count larger than zero, if not, scale # (the histogram scale) would be zero. See exponential.go 191 self._downscale( - self._mapping.scale - min_scale, + self._previous_scale - min_scale, self._previous_positive, self._previous_negative, ) + self._previous_scale = min_scale if ( collection_aggregation_temporality @@ -826,6 +849,8 @@ def collect( start_time_unix_nano = self._previous_start_time_unix_nano sum_ = current_sum + self._previous_sum + zero_count = current_zero_count + self._previous_zero_count + count = current_count + self._previous_count # Only update min/max on delta -> cumulative max_ = max(current_max, self._previous_max) min_ = min(current_min, self._previous_min) @@ -844,10 +869,16 @@ def collect( min_scale, collection_aggregation_temporality, ) + current_scale = min_scale + + current_positive = self._previous_positive + current_negative = self._previous_negative else: start_time_unix_nano = self._previous_start_time_unix_nano sum_ = current_sum - self._previous_sum + zero_count = current_zero_count + count = current_count max_ = current_max min_ = current_min @@ -870,17 +901,17 @@ def collect( attributes=self._attributes, start_time_unix_nano=start_time_unix_nano, time_unix_nano=collection_start_nano, - count=current_count, + count=count, sum=sum_, scale=current_scale, - zero_count=current_zero_count, + zero_count=zero_count, positive=BucketsPoint( offset=current_positive.offset, - bucket_counts=current_positive.counts, + bucket_counts=current_positive.get_offset_counts(), ), negative=BucketsPoint( offset=current_negative.offset, - bucket_counts=current_negative.counts, + bucket_counts=current_negative.get_offset_counts(), ), # FIXME: Find the right value for flags flags=0, @@ -892,19 +923,27 @@ def collect( self._previous_positive = current_positive self._previous_negative = current_negative self._previous_start_time_unix_nano = current_start_time_unix_nano - self._previous_sum = current_sum + self._previous_sum = sum_ + self._previous_count = count + self._previous_max = max_ + self._previous_min = min_ + self._previous_zero_count = zero_count return current_point def _get_low_high_previous_current( - self, previous_point_buckets, current_point_buckets, min_scale + self, + previous_point_buckets, + current_point_buckets, + current_scale, + min_scale, ): (previous_point_low, previous_point_high) = self._get_low_high( - previous_point_buckets, min_scale + previous_point_buckets, self._previous_scale, min_scale ) (current_point_low, current_point_high) = self._get_low_high( - current_point_buckets, min_scale + current_point_buckets, current_scale, min_scale ) if current_point_low > current_point_high: @@ -921,11 +960,12 @@ def _get_low_high_previous_current( return low, high - def _get_low_high(self, buckets, min_scale): + @staticmethod + def _get_low_high(buckets, scale, min_scale): if buckets.counts == [0]: return 0, -1 - shift = self._mapping._scale - min_scale + shift = scale - min_scale return buckets.index_start >> shift, buckets.index_end >> shift @@ -941,7 +981,8 @@ def _get_scale_change(self, low, high): return change - def _downscale(self, change: int, positive, negative): + @staticmethod + def _downscale(change: int, positive, negative): if change == 0: return @@ -949,22 +990,13 @@ def _downscale(self, change: int, positive, negative): if change < 0: raise Exception("Invalid change of scale") - new_scale = self._mapping.scale - change - positive.downscale(change) negative.downscale(change) - if new_scale <= 0: - mapping = ExponentMapping(new_scale) - else: - mapping = LogarithmMapping(new_scale) - - self._mapping = mapping - def _merge( self, - previous_buckets, - current_buckets, + previous_buckets: Buckets, + current_buckets: Buckets, current_scale, min_scale, aggregation_temporality, @@ -983,9 +1015,11 @@ def _merge( # would not happen because self._previous_point is only assigned to # an ExponentialHistogramDataPoint object if self._count != 0. - index = ( - current_buckets.offset + current_bucket_index - ) >> current_change + current_index = current_buckets.index_base + current_bucket_index + if current_index > current_buckets.index_end: + current_index -= len(current_buckets.counts) + + index = current_index >> current_change if index < previous_buckets.index_start: span = previous_buckets.index_end - index @@ -999,7 +1033,7 @@ def _merge( previous_buckets.index_start = index if index > previous_buckets.index_end: - span = index - previous_buckets.index_end + span = index - previous_buckets.index_start if span >= self._max_size: raise Exception("Incorrect merge scale") diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/exponential_histogram/buckets.py b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/exponential_histogram/buckets.py index 5c6b04bd39b..4dbe8f385e8 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/exponential_histogram/buckets.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/exponential_histogram/buckets.py @@ -73,6 +73,10 @@ def index_base(self, value: int) -> None: def counts(self): return self._counts + def get_offset_counts(self): + bias = self.__index_base - self.__index_start + return self._counts[-bias:] + self._counts[:-bias] + def grow(self, needed: int, max_size: int) -> None: size = len(self._counts) @@ -129,7 +133,6 @@ def downscale(self, amount: int) -> None: bias = self.__index_base - self.__index_start if bias != 0: - self.__index_base = self.__index_start # [0, 1, 2, 3, 4] Original backing array diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/point.py b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/point.py index c30705c59a4..42420b9008e 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/point.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/point.py @@ -101,6 +101,18 @@ class ExponentialHistogram: "opentelemetry.sdk.metrics.export.AggregationTemporality" ) + def to_json(self, indent=4) -> str: + return dumps( + { + "data_points": [ + loads(data_point.to_json(indent=indent)) + for data_point in self.data_points + ], + "aggregation_temporality": self.aggregation_temporality, + }, + indent=indent, + ) + @dataclass(frozen=True) class Sum: diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py index ff999b9ba89..c07f4f42c46 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py @@ -983,7 +983,7 @@ def __exit__( def record_exception( self, - exception: Exception, + exception: BaseException, attributes: types.Attributes = None, timestamp: Optional[int] = None, escaped: bool = False, @@ -995,8 +995,15 @@ def record_exception( type(exception), value=exception, tb=exception.__traceback__ ) ) + module = type(exception).__module__ + qualname = type(exception).__qualname__ + exception_type = ( + f"{module}.{qualname}" + if module and module != "builtins" + else qualname + ) _attributes: MutableMapping[str, types.AttributeValue] = { - "exception.type": exception.__class__.__name__, + "exception.type": exception_type, "exception.message": str(exception), "exception.stacktrace": stacktrace, "exception.escaped": str(escaped), diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/version.py b/opentelemetry-sdk/src/opentelemetry/sdk/version.py index 8c35630f0e1..e8b404f0501 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/version.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "1.24.0.dev" +__version__ = "1.25.0.dev" diff --git a/opentelemetry-sdk/tests/metrics/exponential_histogram/test_exponential_bucket_histogram_aggregation.py b/opentelemetry-sdk/tests/metrics/exponential_histogram/test_exponential_bucket_histogram_aggregation.py index 311f00a0b00..bae0aca20bf 100644 --- a/opentelemetry-sdk/tests/metrics/exponential_histogram/test_exponential_bucket_histogram_aggregation.py +++ b/opentelemetry-sdk/tests/metrics/exponential_histogram/test_exponential_bucket_histogram_aggregation.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import random as insecure_random from itertools import permutations from logging import WARNING from math import ldexp @@ -37,6 +38,9 @@ LogarithmMapping, ) from opentelemetry.sdk.metrics._internal.measurement import Measurement +from opentelemetry.sdk.metrics._internal.point import ( + ExponentialHistogramDataPoint, +) from opentelemetry.sdk.metrics.view import ( ExponentialBucketHistogramAggregation, ) @@ -853,13 +857,14 @@ def test_aggregate_collect(self): AggregationTemporality.CUMULATIVE, 0 ) - def test_collect_results_cumulative(self): + def test_collect_results_cumulative(self) -> None: exponential_histogram_aggregation = ( _ExponentialBucketHistogramAggregation( Mock(), Mock(), ) ) + self.maxDiff = None self.assertEqual(exponential_histogram_aggregation._mapping._scale, 20) @@ -884,7 +889,7 @@ def test_collect_results_cumulative(self): self.assertEqual(collection_0.zero_count, 0) self.assertEqual( collection_0.positive.bucket_counts, - [1, *[0] * 63, 1, *[0] * 31, 1, *[0] * 63], + [1, *[0] * 63, 1, *[0] * 63, 1, *[0] * 31], ) self.assertEqual(collection_0.flags, 0) self.assertEqual(collection_0.min, 1) @@ -911,7 +916,7 @@ def test_collect_results_cumulative(self): previous_count = count count_counts.append([previous_count, 1]) - self.assertEqual(collection_1.count, 5) + self.assertEqual(collection_1.count, 8) self.assertEqual(collection_1.sum, 16.645) self.assertEqual(collection_1.scale, 4) self.assertEqual(collection_1.zero_count, 0) @@ -920,21 +925,68 @@ def test_collect_results_cumulative(self): collection_1.positive.bucket_counts, [ 1, - *[0] * 15, + *[0] * 17, 1, - *[0] * 47, + *[0] * 36, 1, - *[0] * 40, + *[0] * 15, + 2, + *[0] * 15, 1, - *[0] * 17, + *[0] * 15, 1, - *[0] * 36, + *[0] * 15, + 1, + *[0] * 40, ], ) self.assertEqual(collection_1.flags, 0) self.assertEqual(collection_1.min, 0.045) self.assertEqual(collection_1.max, 8) + def test_cumulative_aggregation_with_random_data(self) -> None: + histogram = _ExponentialBucketHistogramAggregation(Mock(), Mock()) + + def collect_and_validate() -> None: + result: ExponentialHistogramDataPoint = histogram.collect( + AggregationTemporality.CUMULATIVE, 0 + ) + buckets = result.positive.bucket_counts + scale = result.scale + index_start = result.positive.offset + + for i in range(len(buckets)): + index = index_start + i + count = buckets[i] + lower_bound = 2 ** (index / (2**scale)) + upper_bound = 2 ** ((index + 1) / (2**scale)) + matches = 0 + for value in values: + if value > lower_bound and value <= upper_bound: + matches += 1 + assert ( + matches == count + ), f"index: {index}, count: {count}, scale: {scale}, lower_bound: {lower_bound}, upper_bound: {upper_bound}, matches: {matches}" + + assert sum(buckets) + result.zero_count == len(values) + assert result.sum == sum(values) + assert result.count == len(values) + assert result.min == min(values) + assert result.max == max(values) + assert result.zero_count == len([v for v in values if v == 0]) + assert scale >= 3 + + random = insecure_random.Random("opentelemetry2") + values = [] + for i in range(2000): + value = random.randint(0, 1000) + values.append(value) + histogram.aggregate(Measurement(value, Mock())) + if i % 20 == 0: + collect_and_validate() + + collect_and_validate() + def test_merge_collect_cumulative(self): exponential_histogram_aggregation = ( _ExponentialBucketHistogramAggregation(Mock(), Mock(), max_size=4) @@ -974,7 +1026,8 @@ def test_merge_collect_cumulative(self): 0, ) - self.assertEqual(result.scale, result_1.scale) + self.assertEqual(result.scale, 0) + self.assertEqual(result_1.scale, -1) def test_merge_collect_delta(self): exponential_histogram_aggregation = ( diff --git a/opentelemetry-sdk/tests/metrics/test_point.py b/opentelemetry-sdk/tests/metrics/test_point.py index 5d6640fdea6..20dd0e72384 100644 --- a/opentelemetry-sdk/tests/metrics/test_point.py +++ b/opentelemetry-sdk/tests/metrics/test_point.py @@ -16,6 +16,9 @@ from opentelemetry.sdk.metrics.export import ( AggregationTemporality, + Buckets, + ExponentialHistogram, + ExponentialHistogramDataPoint, Gauge, Histogram, HistogramDataPoint, @@ -100,6 +103,22 @@ def setUpClass(cls): ) cls.histogram_data_point_1_str = f'{{"attributes": {cls.attributes_1_str}, "start_time_unix_nano": 2, "time_unix_nano": 3, "count": 4, "sum": 4.4, "bucket_counts": [2, 1, 1], "explicit_bounds": [1.2, 2.3, 3.4, 4.5], "min": 0.3, "max": 4.4}}' + cls.exp_histogram_data_point_0 = ExponentialHistogramDataPoint( + attributes=cls.attributes_0, + start_time_unix_nano=1, + time_unix_nano=2, + count=1, + sum=10, + scale=1, + zero_count=0, + positive=Buckets(offset=0, bucket_counts=[1]), + negative=Buckets(offset=0, bucket_counts=[0]), + flags=0, + min=10, + max=10, + ) + cls.exp_histogram_data_point_0_str = f'{{"attributes": {cls.attributes_0_str}, "start_time_unix_nano": 1, "time_unix_nano": 2, "count": 1, "sum": 10, "scale": 1, "zero_count": 0, "positive": {{"offset": 0, "bucket_counts": [1]}}, "negative": {{"offset": 0, "bucket_counts": [0]}}, "flags": 0, "min": 10, "max": 10}}' + cls.sum_0 = Sum( data_points=[cls.number_data_point_0, cls.number_data_point_1], aggregation_temporality=AggregationTemporality.DELTA, @@ -121,6 +140,14 @@ def setUpClass(cls): ) cls.histogram_0_str = f'{{"data_points": [{cls.histogram_data_point_0_str}, {cls.histogram_data_point_1_str}], "aggregation_temporality": 1}}' + cls.exp_histogram_0 = ExponentialHistogram( + data_points=[ + cls.exp_histogram_data_point_0, + ], + aggregation_temporality=AggregationTemporality.CUMULATIVE, + ) + cls.exp_histogram_0_str = f'{{"data_points": [{cls.exp_histogram_data_point_0_str}], "aggregation_temporality": 2}}' + cls.metric_0 = Metric( name="metric_0", description="description_0", @@ -209,6 +236,15 @@ def test_histogram_data_point(self): self.histogram_data_point_1_str, ) + def test_exp_histogram_data_point(self): + + self.maxDiff = None + + self.assertEqual( + self.exp_histogram_data_point_0.to_json(indent=None), + self.exp_histogram_data_point_0_str, + ) + def test_sum(self): self.assertEqual(self.sum_0.to_json(indent=None), self.sum_0_str) @@ -225,6 +261,14 @@ def test_histogram(self): self.histogram_0.to_json(indent=None), self.histogram_0_str ) + def test_exp_histogram(self): + + self.maxDiff = None + + self.assertEqual( + self.exp_histogram_0.to_json(indent=None), self.exp_histogram_0_str + ) + def test_metric(self): self.assertEqual(self.metric_0.to_json(indent=None), self.metric_0_str) diff --git a/opentelemetry-sdk/tests/trace/test_trace.py b/opentelemetry-sdk/tests/trace/test_trace.py index 5441bed6dd7..72c7095da70 100644 --- a/opentelemetry-sdk/tests/trace/test_trace.py +++ b/opentelemetry-sdk/tests/trace/test_trace.py @@ -636,6 +636,10 @@ def test_events(self): self.assertEqual(span.events, tuple(events)) +class DummyError(Exception): + pass + + class TestSpan(unittest.TestCase): # pylint: disable=too-many-public-methods @@ -1144,6 +1148,25 @@ def error_status_test(context): .start_as_current_span("root") ) + def test_record_exception_fqn(self): + span = trace._Span("name", mock.Mock(spec=trace_api.SpanContext)) + exception = DummyError("error") + exception_type = "tests.trace.test_trace.DummyError" + span.record_exception(exception) + exception_event = span.events[0] + self.assertEqual("exception", exception_event.name) + self.assertEqual( + "error", exception_event.attributes["exception.message"] + ) + self.assertEqual( + exception_type, + exception_event.attributes["exception.type"], + ) + self.assertIn( + "DummyError: error", + exception_event.attributes["exception.stacktrace"], + ) + def test_record_exception(self): span = trace._Span("name", mock.Mock(spec=trace_api.SpanContext)) try: diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/version.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/version.py index 2b23bc49941..ff4933b20b8 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/version.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/propagator/opentelemetry-propagator-b3/src/opentelemetry/propagators/b3/version.py b/propagator/opentelemetry-propagator-b3/src/opentelemetry/propagators/b3/version.py index 8c35630f0e1..e8b404f0501 100644 --- a/propagator/opentelemetry-propagator-b3/src/opentelemetry/propagators/b3/version.py +++ b/propagator/opentelemetry-propagator-b3/src/opentelemetry/propagators/b3/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "1.24.0.dev" +__version__ = "1.25.0.dev" diff --git a/propagator/opentelemetry-propagator-jaeger/src/opentelemetry/propagators/jaeger/version.py b/propagator/opentelemetry-propagator-jaeger/src/opentelemetry/propagators/jaeger/version.py index 8c35630f0e1..e8b404f0501 100644 --- a/propagator/opentelemetry-propagator-jaeger/src/opentelemetry/propagators/jaeger/version.py +++ b/propagator/opentelemetry-propagator-jaeger/src/opentelemetry/propagators/jaeger/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "1.24.0.dev" +__version__ = "1.25.0.dev" diff --git a/scripts/proto_codegen.sh b/scripts/proto_codegen.sh index 26fb8b1ee85..f445d3f42a0 100755 --- a/scripts/proto_codegen.sh +++ b/scripts/proto_codegen.sh @@ -12,7 +12,7 @@ # PROTO_REPO_DIR - the path to an existing checkout of the opentelemetry-proto repo # Pinned commit/branch/tag for the current version used in opentelemetry-proto python package. -PROTO_REPO_BRANCH_OR_COMMIT="v0.20.0" +PROTO_REPO_BRANCH_OR_COMMIT="v1.2.0" set -e diff --git a/scripts/public_symbols_checker.py b/scripts/public_symbols_checker.py index 05b7ad4abb4..c8bf7fd22e7 100644 --- a/scripts/public_symbols_checker.py +++ b/scripts/public_symbols_checker.py @@ -123,11 +123,11 @@ def remove_common_symbols(): del removed_symbols[file_path] -if added_symbols or removed_symbols: +# If a symbol is added and removed in the same commit, we consider it as not +# added or removed. +remove_common_symbols() - # If a symbol is added and removed in the same commit, we consider it - # as not added or removed. - remove_common_symbols() +if added_symbols or removed_symbols: print("The code in this branch adds the following public symbols:") print() for file_path_, symbols_ in added_symbols.items(): diff --git a/shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/version.py b/shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/version.py index 2b23bc49941..ff4933b20b8 100644 --- a/shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/version.py +++ b/shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/shim/opentelemetry-opentracing-shim/src/opentelemetry/shim/opentracing_shim/version.py b/shim/opentelemetry-opentracing-shim/src/opentelemetry/shim/opentracing_shim/version.py index 2b23bc49941..ff4933b20b8 100644 --- a/shim/opentelemetry-opentracing-shim/src/opentelemetry/shim/opentracing_shim/version.py +++ b/shim/opentelemetry-opentracing-shim/src/opentelemetry/shim/opentracing_shim/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/tests/opentelemetry-test-utils/pyproject.toml b/tests/opentelemetry-test-utils/pyproject.toml index 9d68cb67088..e4547b6e340 100644 --- a/tests/opentelemetry-test-utils/pyproject.toml +++ b/tests/opentelemetry-test-utils/pyproject.toml @@ -24,8 +24,8 @@ classifiers = [ ] dependencies = [ "asgiref ~= 3.0", - "opentelemetry-api == 1.24.0.dev", - "opentelemetry-sdk == 1.24.0.dev", + "opentelemetry-api == 1.25.0.dev", + "opentelemetry-sdk == 1.25.0.dev", ] [project.urls] diff --git a/tests/opentelemetry-test-utils/src/opentelemetry/test/version.py b/tests/opentelemetry-test-utils/src/opentelemetry/test/version.py index ef9e7fdbaf9..e38c2cb2e40 100644 --- a/tests/opentelemetry-test-utils/src/opentelemetry/test/version.py +++ b/tests/opentelemetry-test-utils/src/opentelemetry/test/version.py @@ -1 +1 @@ -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/tox.ini b/tox.ini index 2b82d804dc9..2e12556b4d1 100644 --- a/tox.ini +++ b/tox.ini @@ -8,9 +8,12 @@ envlist = py3{8,9,10,11}-opentelemetry-api pypy3-opentelemetry-api - ; Test against both protobuf 3.x and 4.x - py3{8,9,10,11}-proto{3,4}-opentelemetry-protobuf - pypy3-proto{3,4}-opentelemetry-protobuf + ; The numbers at the end of the environment names + ; below mean these dependencies are being used: + ; 0: protobuf==3.20.3 + ; 1: protobuf==4.25.3 + py3{8,9,10,11}-opentelemetry-protobuf-{0,1} + pypy3-opentelemetry-protobuf-{0,1} py3{8,9,10,11}-opentelemetry-sdk pypy3-opentelemetry-sdk @@ -31,18 +34,30 @@ envlist = py3{8,9,10,11}-opentelemetry-exporter-opencensus ; exporter-opencensus intentionally excluded from pypy3 - py3{8,9,10,11}-proto{3,4}-opentelemetry-exporter-otlp-proto-common - pypy3-proto{3,4}-opentelemetry-exporter-otlp-proto-common + ; The numbers at the end of the environment names + ; below mean these dependencies are being used: + ; 0: protobuf==3.20.3 + ; 1: protobuf==4.25.3 + py3{8,9,10,11}-opentelemetry-exporter-otlp-proto-common-{0,1} + pypy3-opentelemetry-exporter-otlp-proto-common-{0,1} ; opentelemetry-exporter-otlp py3{8,9,10,11}-opentelemetry-exporter-otlp-combined ; intentionally excluded from pypy3 - py3{8,9,10,11}-proto{3,4}-opentelemetry-exporter-otlp-proto-grpc + ; The numbers at the end of the environment names + ; below mean these dependencies are being used: + ; 0: protobuf==3.20.3 + ; 1: protobuf==4.25.3 + py3{8,9,10,11}-opentelemetry-exporter-otlp-proto-grpc-{0,1} ; intentionally excluded from pypy3 - py3{8,9,10,11}-proto{3,4}-opentelemetry-exporter-otlp-proto-http - pypy3-opentelemetry-proto{3,4}-exporter-otlp-proto-http + ; The numbers at the end of the environment names + ; below mean these dependencies are being used: + ; 0: protobuf==3.20.3 + ; 1: protobuf==4.25.3 + py3{8,9,10,11}-opentelemetry-exporter-otlp-proto-http-{0,1} + pypy3-opentelemetry-exporter-otlp-proto-http-{0,1} py3{8,9,10,11}-opentelemetry-exporter-prometheus pypy3-opentelemetry-exporter-prometheus @@ -109,7 +124,8 @@ commands_pre = ; cases but it saves a lot of boilerplate in this file. opentelemetry: pip install {toxinidir}/opentelemetry-api {toxinidir}/opentelemetry-semantic-conventions {toxinidir}/opentelemetry-sdk {toxinidir}/tests/opentelemetry-test-utils - protobuf: pip install -r {toxinidir}/opentelemetry-proto/test-requirements.txt + protobuf-0: pip install -r {toxinidir}/opentelemetry-proto/test-requirements-0.txt + protobuf-1: pip install -r {toxinidir}/opentelemetry-proto/test-requirements-1.txt getting-started: pip install -r {toxinidir}/docs/getting_started/tests/requirements.txt getting-started: pip install -e {env:CONTRIB_REPO}\#egg=opentelemetry-util-http&subdirectory=util/opentelemetry-util-http @@ -120,16 +136,16 @@ commands_pre = exporter-opencensus: pip install -r {toxinidir}/exporter/opentelemetry-exporter-opencensus/test-requirements.txt - exporter-otlp-proto-common: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements.txt + exporter-otlp-proto-common-0: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-0.txt + exporter-otlp-proto-common-1: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-1.txt exporter-otlp-combined: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp/test-requirements.txt - exporter-otlp-proto-grpc: pip install {toxinidir}/opentelemetry-proto - exporter-otlp-proto-grpc: pip install {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-common - exporter-otlp-proto-grpc: pip install {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc + opentelemetry-exporter-otlp-proto-grpc-0: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-0.txt + opentelemetry-exporter-otlp-proto-grpc-1: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-1.txt - proto3-opentelemetry-exporter-otlp-proto-http: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-0.txt - proto4-opentelemetry-exporter-otlp-proto-http: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-1.txt + opentelemetry-exporter-otlp-proto-http-0: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-0.txt + opentelemetry-exporter-otlp-proto-http-1: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-1.txt opentracing-shim: pip install -r {toxinidir}/shim/opentelemetry-opentracing-shim/test-requirements.txt @@ -205,27 +221,24 @@ deps = -r dev-requirements.txt commands_pre = - pip install -r {toxinidir}/opentelemetry-api/test-requirements.txt - pip install -r {toxinidir}/opentelemetry-sdk/test-requirements.txt - pip install -r {toxinidir}/opentelemetry-semantic-conventions/test-requirements.txt - pip install -r {toxinidir}/opentelemetry-proto/test-requirements.txt - pip install -r {toxinidir}/shim/opentelemetry-opentracing-shim/test-requirements.txt - pip install -r {toxinidir}/shim/opentelemetry-opencensus-shim/test-requirements.txt - pip install -r {toxinidir}/exporter/opentelemetry-exporter-opencensus/test-requirements.txt - pip install -r {toxinidir}/tests/opentelemetry-test-utils/test-requirements.txt - pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements.txt - python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc[test] - pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-1.txt - pip install -r {toxinidir}/exporter/opentelemetry-exporter-prometheus/test-requirements.txt - pip install -r {toxinidir}/exporter/opentelemetry-exporter-zipkin-proto-http/test-requirements.txt - pip install -r {toxinidir}/exporter/opentelemetry-exporter-zipkin-json/test-requirements.txt - pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp/test-requirements.txt - pip install -r {toxinidir}/exporter/opentelemetry-exporter-zipkin/test-requirements.txt - pip install -r {toxinidir}/propagator/opentelemetry-propagator-b3/test-requirements.txt - pip install -r {toxinidir}/propagator/opentelemetry-propagator-jaeger/test-requirements.txt - # Pin protobuf version due to lint failing on v3.20.0 - # https://github.com/protocolbuffers/protobuf/issues/9730 - python -m pip install protobuf==3.19.4 + pip install -r {toxinidir}/opentelemetry-api/test-requirements.txt \ + -r {toxinidir}/opentelemetry-sdk/test-requirements.txt \ + -r {toxinidir}/opentelemetry-semantic-conventions/test-requirements.txt \ + -r {toxinidir}/opentelemetry-proto/test-requirements-0.txt \ + -r {toxinidir}/shim/opentelemetry-opentracing-shim/test-requirements.txt \ + -r {toxinidir}/shim/opentelemetry-opencensus-shim/test-requirements.txt \ + -r {toxinidir}/exporter/opentelemetry-exporter-opencensus/test-requirements.txt \ + -r {toxinidir}/tests/opentelemetry-test-utils/test-requirements.txt \ + -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-0.txt \ + -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-0.txt \ + -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-0.txt \ + -r {toxinidir}/exporter/opentelemetry-exporter-prometheus/test-requirements.txt \ + -r {toxinidir}/exporter/opentelemetry-exporter-zipkin-proto-http/test-requirements.txt \ + -r {toxinidir}/exporter/opentelemetry-exporter-zipkin-json/test-requirements.txt \ + -r {toxinidir}/exporter/opentelemetry-exporter-otlp/test-requirements.txt \ + -r {toxinidir}/exporter/opentelemetry-exporter-zipkin/test-requirements.txt \ + -r {toxinidir}/propagator/opentelemetry-propagator-b3/test-requirements.txt \ + -r {toxinidir}/propagator/opentelemetry-propagator-jaeger/test-requirements.txt commands = python scripts/eachdist.py lint --check-only