Skip to content

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

Open
jeanscherf wants to merge 4 commits into
mainfrom
feat/sdk-resource-attribute-registry
Open

feat(telemetry): discover companion SDK resource attributes via entry points#288
jeanscherf wants to merge 4 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

@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
… 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 force-pushed the feat/sdk-resource-attribute-registry branch from 2831fac to 8e70d26 Compare August 28, 2026 17:07
@jeanscherf
jeanscherf marked this pull request as ready for review August 28, 2026 17:09
@jeanscherf
jeanscherf requested a review from a team as a code owner August 28, 2026 17:09
@tiagoek

tiagoek commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

SDK Module Review

Check Status Findings
bdd ✅ PASS 0
binding-shape ✅ PASS 0
commits ✅ PASS 0
concurrency ✅ PASS 0
constants ✅ PASS 0
deletion-hygiene ✅ PASS 0
deps-supply ✅ PASS 0
disclosure ✅ PASS 0
docs ✅ PASS 0
errors-logging ✅ PASS 0
hardcode ✅ PASS 0
http-hygiene ✅ PASS 0
license-spdx ✅ PASS 0
pr-size ✅ PASS 0
quality-gate-parity ✅ PASS 0
secrets ✅ PASS 0
telemetry ✅ PASS 0
testing-depth ✅ PASS 0
versioning ✅ PASS 0

0 finding(s): 0 posted as inline comment(s) on the affected lines, 0 not tied to a code line (listed above).


Generated by sdk-review-skill · v1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants