Skip to content

Commit 6ed3425

Browse files
committed
Merge branch 'main' of github.com:open-telemetry/opentelemetry-python into mike/config-resource-propagator
2 parents 8232d48 + 63fbcb8 commit 6ed3425

File tree

15 files changed

+157
-25
lines changed

15 files changed

+157
-25
lines changed

.github/workflows/contrib.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ name: Core Contrib Test
22

33
on:
44
push:
5-
branches-ignore:
6-
- 'release/*'
7-
- 'otelbot/*'
5+
branches:
6+
- 'main'
87
pull_request:
98

109
permissions:

.github/workflows/lint_0.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ name: Lint 0
55

66
on:
77
push:
8-
branches-ignore:
9-
- 'release/*'
10-
- 'otelbot/*'
8+
branches:
9+
- 'main'
1110
pull_request:
1211

1312
permissions:

.github/workflows/misc_0.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ name: Misc 0
55

66
on:
77
push:
8-
branches-ignore:
9-
- 'release/*'
10-
- 'otelbot/*'
8+
branches:
9+
- 'main'
1110
pull_request:
1211

1312
permissions:

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ name: Lint {{ file_number }}
55

66
on:
77
push:
8-
branches-ignore:
9-
- 'release/*'
10-
- 'otelbot/*'
8+
branches:
9+
- 'main'
1110
pull_request:
1211

1312
permissions:

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ name: Misc {{ file_number }}
55

66
on:
77
push:
8-
branches-ignore:
9-
- 'release/*'
10-
- 'otelbot/*'
8+
branches:
9+
- 'main'
1110
pull_request:
1211

1312
permissions:

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ name: Test {{ file_number }}
55

66
on:
77
push:
8-
branches-ignore:
9-
- 'release/*'
10-
- 'otelbot/*'
8+
branches:
9+
- 'main'
1110
pull_request:
1211

1312
permissions:

.github/workflows/test_0.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ name: Test 0
55

66
on:
77
push:
8-
branches-ignore:
9-
- 'release/*'
10-
- 'otelbot/*'
8+
branches:
9+
- 'main'
1110
pull_request:
1211

1312
permissions:

.github/workflows/test_1.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ name: Test 1
55

66
on:
77
push:
8-
branches-ignore:
9-
- 'release/*'
10-
- 'otelbot/*'
8+
branches:
9+
- 'main'
1110
pull_request:
1211

1312
permissions:

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2828
([#4973](https://github.com/open-telemetry/opentelemetry-python/pull/4973))
2929
- `opentelemetry-exporter-prometheus`: Fix metric name prefix
3030
([#4895](https://github.com/open-telemetry/opentelemetry-python/pull/4895))
31+
- `opentelemetry-api`, `opentelemetry-sdk`: Add deepcopy support for `BoundedAttributes` and `BoundedList`
32+
([#4934](https://github.com/open-telemetry/opentelemetry-python/pull/4934))
3133

3234
## Version 1.40.0/0.61b0 (2026-03-04)
3335

opentelemetry-api/src/opentelemetry/attributes/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import copy
1516
import logging
1617
import threading
1718
from collections import OrderedDict
@@ -318,5 +319,20 @@ def __iter__(self): # type: ignore
318319
def __len__(self) -> int:
319320
return len(self._dict)
320321

322+
def __deepcopy__(self, memo: dict) -> "BoundedAttributes":
323+
copy_ = BoundedAttributes(
324+
maxlen=self.maxlen,
325+
immutable=self._immutable,
326+
max_value_len=self.max_value_len,
327+
extended_attributes=self._extended_attributes,
328+
)
329+
memo[id(self)] = copy_
330+
with self._lock:
331+
# Assign _dict directly to avoid re-cleaning already clean values
332+
# and to bypass the immutability guard in __setitem__
333+
copy_._dict = copy.deepcopy(self._dict, memo)
334+
copy_.dropped = self.dropped
335+
return copy_
336+
321337
def copy(self): # type: ignore
322338
return self._dict.copy() # type: ignore

0 commit comments

Comments
 (0)