-
Notifications
You must be signed in to change notification settings - Fork 22
feat: auto-discover instrumentation plugins #620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+882
−7
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
797310e
feat: auto-discover instrumentation plugins
zhongkechen fbb556e
Merge branch 'main' into codex/plugin-auto-discovery
zhongkechen b31aba6
Merge branch 'main' into codex/plugin-auto-discovery
zhongkechen 0a74dce
fix(otel): require plugin discovery core API
zhongkechen 0366610
fix: require providers to pin plugin API version
zhongkechen c4d0f27
test(otel): discover installed plugin entry points
zhongkechen f984e02
fix: align SDK version with plugin API release
zhongkechen 8bdd08e
fix: align conformance tests with SDK version
zhongkechen 3a7ef0a
chore(release): bump otel to 0.4.0
zhongkechen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...-durable-execution-sdk-python-otel/src/aws_durable_execution_sdk_python_otel/__about__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # SPDX-FileCopyrightText: 2025-present Amazon.com, Inc. or its affiliates. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| __version__ = "0.3.0" | ||
| __version__ = "0.4.0" |
23 changes: 23 additions & 0 deletions
23
...le-execution-sdk-python-otel/src/aws_durable_execution_sdk_python_otel/plugin_provider.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| from aws_durable_execution_sdk_python.plugin import ( | ||
| DurableInstrumentationPluginProvider, | ||
| ) | ||
|
zhongkechen marked this conversation as resolved.
|
||
|
|
||
| from aws_durable_execution_sdk_python_otel.execution_plugin import ( | ||
| ExecutionOtelPlugin, | ||
| ) | ||
| from aws_durable_execution_sdk_python_otel.invocation_plugin import ( | ||
| InvocationOtelPlugin, | ||
| ) | ||
|
|
||
|
|
||
| INVOCATION_OTEL_PLUGIN_PROVIDER = DurableInstrumentationPluginProvider( | ||
| plugin_type=InvocationOtelPlugin, | ||
| factory=InvocationOtelPlugin, | ||
| plugin_api_version=1, | ||
| ) | ||
|
|
||
| EXECUTION_OTEL_PLUGIN_PROVIDER = DurableInstrumentationPluginProvider( | ||
| plugin_type=ExecutionOtelPlugin, | ||
| factory=ExecutionOtelPlugin, | ||
| plugin_api_version=1, | ||
| ) | ||
56 changes: 56 additions & 0 deletions
56
packages/aws-durable-execution-sdk-python-otel/tests/test_plugin_provider.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| from aws_durable_execution_sdk_python.plugin import ( | ||
| DURABLE_INSTRUMENTATION_PLUGIN_API_VERSION, | ||
| ) | ||
| from aws_durable_execution_sdk_python.plugin_discovery import ( | ||
| PLUGIN_ENVIRONMENT_VARIABLE, | ||
| load_configured_plugins, | ||
| ) | ||
|
|
||
| from aws_durable_execution_sdk_python_otel.execution_plugin import ( | ||
| ExecutionOtelPlugin, | ||
| ) | ||
| from aws_durable_execution_sdk_python_otel.invocation_plugin import ( | ||
| InvocationOtelPlugin, | ||
| ) | ||
| from aws_durable_execution_sdk_python_otel.plugin_provider import ( | ||
| EXECUTION_OTEL_PLUGIN_PROVIDER, | ||
| INVOCATION_OTEL_PLUGIN_PROVIDER, | ||
| ) | ||
|
zhongkechen marked this conversation as resolved.
|
||
|
|
||
|
|
||
| def test_invocation_otel_plugin_provider_uses_current_plugin_api() -> None: | ||
| assert INVOCATION_OTEL_PLUGIN_PROVIDER.plugin_type is InvocationOtelPlugin | ||
| assert ( | ||
| INVOCATION_OTEL_PLUGIN_PROVIDER.plugin_api_version | ||
| == DURABLE_INSTRUMENTATION_PLUGIN_API_VERSION | ||
| ) | ||
|
|
||
|
|
||
| def test_invocation_otel_plugin_provider_creates_invocation_plugin() -> None: | ||
| assert isinstance(INVOCATION_OTEL_PLUGIN_PROVIDER.factory(), InvocationOtelPlugin) | ||
|
|
||
|
|
||
| def test_execution_otel_plugin_provider_uses_current_plugin_api() -> None: | ||
| assert EXECUTION_OTEL_PLUGIN_PROVIDER.plugin_type is ExecutionOtelPlugin | ||
| assert ( | ||
| EXECUTION_OTEL_PLUGIN_PROVIDER.plugin_api_version | ||
| == DURABLE_INSTRUMENTATION_PLUGIN_API_VERSION | ||
| ) | ||
|
|
||
|
|
||
| def test_execution_otel_plugin_provider_creates_execution_plugin() -> None: | ||
| assert isinstance(EXECUTION_OTEL_PLUGIN_PROVIDER.factory(), ExecutionOtelPlugin) | ||
|
|
||
|
|
||
| def test_installed_otel_entry_points_load_both_plugin_types() -> None: | ||
|
zhongkechen marked this conversation as resolved.
|
||
| plugins = load_configured_plugins( | ||
| None, | ||
| environment={ | ||
| PLUGIN_ENVIRONMENT_VARIABLE: "otel-invocation,otel-execution", | ||
| }, | ||
| ) | ||
|
|
||
| assert [type(plugin) for plugin in plugins] == [ | ||
| InvocationOtelPlugin, | ||
| ExecutionOtelPlugin, | ||
| ] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/aws-durable-execution-sdk-python/src/aws_durable_execution_sdk_python/__about__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # SPDX-FileCopyrightText: 2025-present Amazon.com, Inc. or its affiliates. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| __version__ = "1.7.0" | ||
| __version__ = "1.8.0" | ||
|
zhongkechen marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.