Skip to content

Commit 1691294

Browse files
committed
Rename entrypoint to pre_sdk_init_function
1 parent 8e79bfc commit 1691294

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

opentelemetry-sdk/src/opentelemetry/sdk/_configuration/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ def _import_opamp() -> Callable[[Resource], None] | None:
564564
entry_point = next(
565565
iter(
566566
entry_points(
567-
group="_opentelemetry_opamp", name="init_function"
567+
group="_opentelemetry_opamp", name="pre_sdk_init_function"
568568
)
569569
)
570570
)

opentelemetry-sdk/tests/test_configurator.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,13 +1581,19 @@ class TestOpAMPInit(TestCase):
15811581
def test_init_function_found(self, mock_resource, mock_entry_points):
15821582
init_function = mock.Mock()
15831583
mock_entry_points.configure_mock(
1584-
return_value=[IterEntryPoint("init_function", init_function)]
1584+
return_value=[
1585+
IterEntryPoint("pre_sdk_init_function", init_function)
1586+
]
15851587
)
15861588

15871589
_initialize_components(id_generator=1)
15881590

15891591
mock_entry_points.assert_has_calls(
1590-
[mock.call(group="_opentelemetry_opamp", name="init_function")]
1592+
[
1593+
mock.call(
1594+
group="_opentelemetry_opamp", name="pre_sdk_init_function"
1595+
)
1596+
]
15911597
)
15921598
init_function.assert_called_once_with(
15931599
mock_resource.create.return_value
@@ -1608,7 +1614,11 @@ def test_init_function_load_failure(self, mock_entry_points):
16081614
_initialize_components(id_generator=1)
16091615

16101616
mock_entry_points.assert_has_calls(
1611-
[mock.call(group="_opentelemetry_opamp", name="init_function")]
1617+
[
1618+
mock.call(
1619+
group="_opentelemetry_opamp", name="pre_sdk_init_function"
1620+
)
1621+
]
16121622
)
16131623

16141624
self.assertIn(

0 commit comments

Comments
 (0)