Skip to content

Commit 2cf133d

Browse files
authored
Merge branch 'main' into otel-attribute-count-not-respected
2 parents e630c14 + dd93fa7 commit 2cf133d

File tree

29 files changed

+614
-16
lines changed

29 files changed

+614
-16
lines changed

.github/workflows/contrib.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches-ignore:
66
- 'release/*'
7+
- 'otelbot/*'
78
pull_request:
89

910
permissions:

.github/workflows/lint_0.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
push:
88
branches-ignore:
99
- 'release/*'
10+
- 'otelbot/*'
1011
pull_request:
1112

1213
permissions:

.github/workflows/misc_0.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
push:
88
branches-ignore:
99
- 'release/*'
10+
- 'otelbot/*'
1011
pull_request:
1112

1213
permissions:

.github/workflows/templates/lint.yml.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
push:
88
branches-ignore:
99
- 'release/*'
10+
- 'otelbot/*'
1011
pull_request:
1112

1213
permissions:

.github/workflows/templates/misc.yml.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
push:
88
branches-ignore:
99
- 'release/*'
10+
- 'otelbot/*'
1011
pull_request:
1112

1213
permissions:

.github/workflows/templates/test.yml.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
push:
88
branches-ignore:
99
- 'release/*'
10+
- 'otelbot/*'
1011
pull_request:
1112

1213
permissions:

.github/workflows/test_0.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
push:
88
branches-ignore:
99
- 'release/*'
10+
- 'otelbot/*'
1011
pull_request:
1112

1213
permissions:

CHANGELOG.md

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

1515
- Add experimental composite samplers
1616
([#4714](https://github.com/open-telemetry/opentelemetry-python/pull/4714))
17+
- Add new environment variables to the SDK `OTEL_PYTHON_EXPORTER_OTLP_{HTTP/GRPC}_{METRICS/TRACES/LOGS}_CREDENTIAL_PROVIDER` that can be used to
18+
inject a `requests.Session` or `grpc.ChannelCredentials` object into OTLP exporters created during auto instrumentation [#4689](https://github.com/open-telemetry/opentelemetry-python/pull/4689).
1719
- Filter duplicate logs out of some internal `logger`'s logs on the export logs path that might otherwise endlessly log or cause a recursion depth exceeded issue in cases where logging itself results in an exception.
1820
([#4695](https://github.com/open-telemetry/opentelemetry-python/pull/4695)).
1921
- docs: linked the examples with their github source code location and added Prometheus example
@@ -24,6 +26,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2426
([#4731](https://github.com/open-telemetry/opentelemetry-python/pull/4731))
2527
- opentelemetry-sdk: fix handling of OTEL_ATTRIBUTE_COUNT_LIMIT in logs
2628
([#4677](https://github.com/open-telemetry/opentelemetry-python/pull/4677))
29+
- Performance: Cache `importlib_metadata.entry_points`
30+
([#4735](https://github.com/open-telemetry/opentelemetry-python/pull/4735))
31+
- opentelemetry-sdk: fix calling Logger.emit with an API LogRecord instance
32+
([#4741](https://github.com/open-telemetry/opentelemetry-python/pull/4741))
2733

2834
## Version 1.36.0/0.57b0 (2025-07-29)
2935

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ def _encode_log(log_data: LogData) -> PB2LogRecord:
6161
log_data.log_record.attributes, allow_null=True
6262
),
6363
dropped_attributes_count=log_data.log_record.dropped_attributes,
64-
severity_number=log_data.log_record.severity_number.value,
64+
severity_number=getattr(
65+
log_data.log_record.severity_number, "value", None
66+
),
6567
event_name=log_data.log_record.event_name,
6668
)
6769

exporter/opentelemetry-exporter-otlp-proto-common/tests/test_log_encoder.py

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def test_dropped_attributes_count(self):
8989

9090
@staticmethod
9191
def _get_sdk_log_data() -> List[LogData]:
92+
# pylint:disable=too-many-locals
9293
ctx_log1 = set_span_in_context(
9394
NonRecordingSpan(
9495
SpanContext(
@@ -304,7 +305,29 @@ def _get_sdk_log_data() -> List[LogData]:
304305
"extended_name", "extended_version"
305306
),
306307
)
307-
return [log1, log2, log3, log4, log5, log6, log7, log8]
308+
309+
ctx_log9 = set_span_in_context(
310+
NonRecordingSpan(
311+
SpanContext(
312+
212592107417388365804938480559624925566,
313+
6077757853989569466,
314+
False,
315+
TraceFlags(0x01),
316+
)
317+
)
318+
)
319+
log9 = LogData(
320+
log_record=SDKLogRecord(
321+
# these are otherwise set by default
322+
observed_timestamp=1644650584292683045,
323+
context=ctx_log9,
324+
resource=SDKResource({}),
325+
),
326+
instrumentation_scope=InstrumentationScope(
327+
"empty_log_record_name", "empty_log_record_version"
328+
),
329+
)
330+
return [log1, log2, log3, log4, log5, log6, log7, log8, log9]
308331

309332
def get_test_logs(
310333
self,
@@ -593,6 +616,29 @@ def get_test_logs(
593616
),
594617
],
595618
),
619+
PB2ScopeLogs(
620+
scope=PB2InstrumentationScope(
621+
name="empty_log_record_name",
622+
version="empty_log_record_version",
623+
),
624+
log_records=[
625+
PB2LogRecord(
626+
time_unix_nano=None,
627+
observed_time_unix_nano=1644650584292683045,
628+
trace_id=_encode_trace_id(
629+
212592107417388365804938480559624925566
630+
),
631+
span_id=_encode_span_id(
632+
6077757853989569466,
633+
),
634+
flags=int(TraceFlags(0x01)),
635+
severity_text=None,
636+
severity_number=None,
637+
body=None,
638+
attributes=None,
639+
),
640+
],
641+
),
596642
],
597643
),
598644
]

0 commit comments

Comments
 (0)