Skip to content

Commit 1cc042c

Browse files
authored
Merge branch 'main' into fix_instrumentation_scope_encoding_to_otlp
2 parents 4e7b905 + a7fe4f8 commit 1cc042c

File tree

88 files changed

+2178
-376
lines changed

Some content is hidden

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

88 files changed

+2178
-376
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
- Fix OTLP encoders missing instrumentation scope schema url and attributes
1111
([#4359](https://github.com/open-telemetry/opentelemetry-python/pull/4359))
12+
- Tolerates exceptions when loading resource detectors via `OTEL_EXPERIMENTAL_RESOURCE_DETECTORS`
13+
([#4373](https://github.com/open-telemetry/opentelemetry-python/pull/4373))
14+
15+
## Version 1.30.0/0.51b0 (2025-02-03)
16+
1217
- Always setup logs sdk, OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED only controls python `logging` module handler setup
1318
([#4340](https://github.com/open-telemetry/opentelemetry-python/pull/4340))
1419
- Add `attributes` field in `metrics.get_meter` wrapper function
@@ -17,6 +22,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1722
([#4353](https://github.com/open-telemetry/opentelemetry-python/pull/4353))
1823
- sdk: don't log or print warnings when the SDK has been disabled
1924
([#4371](https://github.com/open-telemetry/opentelemetry-python/pull/4371))
25+
- Fix span context manager typing by using ParamSpec from typing_extensions
26+
([#4389](https://github.com/open-telemetry/opentelemetry-python/pull/4389))
27+
- Fix serialization of None values in logs body to match 1.31.0+ data model
28+
([#4400](https://github.com/open-telemetry/opentelemetry-python/pull/4400))
29+
- [BREAKING] semantic-conventions: Remove `opentelemetry.semconv.attributes.network_attributes.NETWORK_INTERFACE_NAME`
30+
introduced by mistake in the wrong module.
31+
([#4391](https://github.com/open-telemetry/opentelemetry-python/pull/4391))
32+
- Add support for explicit bucket boundaries advisory for Histograms
33+
([#4361](https://github.com/open-telemetry/opentelemetry-python/pull/4361))
34+
- semantic-conventions: Bump to 1.30.0
35+
([#4337](https://github.com/open-telemetry/opentelemetry-python/pull/4397))
2036

2137
## Version 1.29.0/0.50b0 (2024-12-11)
2238

docs/examples/fork-process-model/flask-gunicorn/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ googleapis-common-protos==1.52.0
44
grpcio==1.56.2
55
gunicorn==22.0.0
66
itsdangerous==2.1.2
7-
Jinja2==3.1.4
7+
Jinja2==3.1.5
88
MarkupSafe==2.1.3
99
opentelemetry-api==1.20.0
1010
opentelemetry-exporter-otlp==1.20.0

docs/examples/fork-process-model/flask-uwsgi/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ googleapis-common-protos==1.52.0
44
grpcio==1.56.2
55
gunicorn==22.0.0
66
itsdangerous==2.1.2
7-
Jinja2==3.1.4
7+
Jinja2==3.1.5
88
MarkupSafe==2.1.3
99
opentelemetry-api==1.20.0
1010
opentelemetry-exporter-otlp==1.20.0

docs/examples/metrics/instruments/example.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,13 @@ def observable_gauge_func(options: CallbackOptions) -> Iterable[Observation]:
5858
histogram = meter.create_histogram("histogram")
5959
histogram.record(99.9)
6060

61+
62+
# Histogram with explicit bucket boundaries advisory
63+
histogram = meter.create_histogram(
64+
"histogram_with_advisory",
65+
explicit_bucket_boundaries_advisory=[0.0, 1.0, 2.0],
66+
)
67+
histogram.record(99.9)
68+
6169
# Async Gauge
6270
gauge = meter.create_observable_gauge("gauge", [observable_gauge_func])

docs/getting_started/tests/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ idna==3.7
99
importlib-metadata==6.8.0
1010
iniconfig==2.0.0
1111
itsdangerous==2.1.2
12-
Jinja2==3.1.4
12+
Jinja2==3.1.5
1313
MarkupSafe==2.1.3
1414
packaging==24.0
1515
pluggy==1.3.0

eachdist.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sortfirst=
1111
exporter/*
1212

1313
[stable]
14-
version=1.30.0.dev
14+
version=1.31.0.dev
1515

1616
packages=
1717
opentelemetry-sdk
@@ -27,7 +27,7 @@ packages=
2727
opentelemetry-api
2828

2929
[prerelease]
30-
version=0.51b0.dev
30+
version=0.52b0.dev
3131

3232
packages=
3333
opentelemetry-opentracing-shim

exporter/opentelemetry-exporter-opencensus/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ classifiers = [
3131
dependencies = [
3232
"grpcio >= 1.0.0, < 2.0.0",
3333
"opencensus-proto >= 0.1.0, < 1.0.0",
34-
"opentelemetry-api >= 1.30.0.dev",
34+
"opentelemetry-api >= 1.31.0.dev",
3535
"opentelemetry-sdk >= 1.15",
3636
"protobuf ~= 3.13",
3737
"setuptools >= 16.0",

exporter/opentelemetry-exporter-opencensus/src/opentelemetry/exporter/opencensus/version/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "0.51b0.dev"
15+
__version__ = "0.52b0.dev"

exporter/opentelemetry-exporter-otlp-proto-common/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ classifiers = [
2828
"Programming Language :: Python :: 3.13",
2929
]
3030
dependencies = [
31-
"opentelemetry-proto == 1.30.0.dev",
31+
"opentelemetry-proto == 1.31.0.dev",
3232
]
3333

3434
[project.urls]

exporter/opentelemetry-exporter-otlp-proto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/__init__.py

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# limitations under the License.
1414

1515

16+
from __future__ import annotations
17+
1618
import logging
1719
from collections.abc import Sequence
1820
from itertools import count
@@ -67,7 +69,11 @@ def _encode_resource(resource: Resource) -> PB2Resource:
6769
return PB2Resource(attributes=_encode_attributes(resource.attributes))
6870

6971

70-
def _encode_value(value: Any) -> PB2AnyValue:
72+
def _encode_value(
73+
value: Any, allow_null: bool = False
74+
) -> Optional[PB2AnyValue]:
75+
if allow_null is True and value is None:
76+
return None
7177
if isinstance(value, bool):
7278
return PB2AnyValue(bool_value=value)
7379
if isinstance(value, str):
@@ -80,19 +86,45 @@ def _encode_value(value: Any) -> PB2AnyValue:
8086
return PB2AnyValue(bytes_value=value)
8187
if isinstance(value, Sequence):
8288
return PB2AnyValue(
83-
array_value=PB2ArrayValue(values=[_encode_value(v) for v in value])
89+
array_value=PB2ArrayValue(
90+
values=_encode_array(value, allow_null=allow_null)
91+
)
8492
)
8593
elif isinstance(value, Mapping):
8694
return PB2AnyValue(
8795
kvlist_value=PB2KeyValueList(
88-
values=[_encode_key_value(str(k), v) for k, v in value.items()]
96+
values=[
97+
_encode_key_value(str(k), v, allow_null=allow_null)
98+
for k, v in value.items()
99+
]
89100
)
90101
)
91102
raise Exception(f"Invalid type {type(value)} of value {value}")
92103

93104

94-
def _encode_key_value(key: str, value: Any) -> PB2KeyValue:
95-
return PB2KeyValue(key=key, value=_encode_value(value))
105+
def _encode_key_value(
106+
key: str, value: Any, allow_null: bool = False
107+
) -> PB2KeyValue:
108+
return PB2KeyValue(
109+
key=key, value=_encode_value(value, allow_null=allow_null)
110+
)
111+
112+
113+
def _encode_array(
114+
array: Sequence[Any], allow_null: bool = False
115+
) -> Sequence[PB2AnyValue]:
116+
if not allow_null:
117+
# Let the exception get raised by _encode_value()
118+
return [_encode_value(v, allow_null=allow_null) for v in array]
119+
120+
return [
121+
_encode_value(v, allow_null=allow_null)
122+
if v is not None
123+
# Use an empty AnyValue to represent None in an array. Behavior may change pending
124+
# https://github.com/open-telemetry/opentelemetry-specification/issues/4392
125+
else PB2AnyValue()
126+
for v in array
127+
]
96128

97129

98130
def _encode_span_id(span_id: int) -> bytes:

0 commit comments

Comments
 (0)