Skip to content

feat(telemetry): discover companion SDK resource attributes via entry points - #288

Draft
jeanscherf wants to merge 3 commits into
mainfrom
feat/sdk-resource-attribute-registry
Draft

feat(telemetry): discover companion SDK resource attributes via entry points#288
jeanscherf wants to merge 3 commits into
mainfrom
feat/sdk-resource-attribute-registry

Conversation

@jeanscherf

@jeanscherf jeanscherf commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Replaces the import-time registry (register_sdk_resource_attributes / _extra_sdk_attributes) with importlib.metadata entry-points discovery
  • create_resource_attributes_from_env() now calls entry_points(group="sap_cloud_sdk.resource_providers") at OTel init time (inside auto_instrument())
  • Any installed package that registers a callable under that group has its returned dict merged into every span/metric resource automatically — no import-order dependency, no agent code change required
  • Companion SDKs register themselves in their pyproject.toml under [project.entry-points."sap_cloud_sdk.resource_providers"]

Test plan

… SDKs

Adds a module-level registry in create_resource_attributes_from_env() so
companion SDKs (e.g. sap-internal-sdk) can contribute their version as an
OTel resource attribute at import time, without requiring any change to
agent startup code.
Remove the import-time registry (_extra_sdk_attributes / register_sdk_resource_attributes)
and replace it with importlib.metadata entry_points discovery at auto_instrument() call time.

Any installed package that registers a callable under the
"sap_cloud_sdk.resource_providers" group has its returned dict merged into
the resource attributes automatically — no import order dependency, no agent
code change required.
@jeanscherf jeanscherf changed the title feat(telemetry): add register_sdk_resource_attributes() for companion SDKs feat(telemetry): discover companion SDK resource attributes via entry points Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant