Repository navigation
feat(sdk)!: support resource detectors - #555
hectorhdzg wants to merge 7 commits into
Conversation
Pull request dashboard statusWaiting on maintainers · refreshed 2026-11-25 23:28 UTC Merge when ready. Status above doesn't look right?
|
adityareddy-dev
left a comment
There was a problem hiding this comment.
passing resource together with resourceDetectors or resourceAttributes just drops the extra config without saying anything, could we diag.warn there? easy to set both and not notice detection never ran
|
Or perhaps consider (and document)
FWIW, from the Node.js side, I redesign the options to
|
| const sdkAttributes = resourceFromAttributes({ | ||
| [ATTR_TELEMETRY_SDK_LANGUAGE]: | ||
| defaults.attributes[ATTR_TELEMETRY_SDK_LANGUAGE], | ||
| [ATTR_TELEMETRY_SDK_NAME]: defaults.attributes[ATTR_TELEMETRY_SDK_NAME], | ||
| [ATTR_TELEMETRY_SDK_VERSION]: | ||
| defaults.attributes[ATTR_TELEMETRY_SDK_VERSION], | ||
| }); |
There was a problem hiding this comment.
Is this to specifically guard against resource detectors or the resourceAtrtibutes option overriding telemetry.sdk.* values? FWIW sdk-node doesn't bother guarding this.
There was a problem hiding this comment.
It's there so detectors and resourceAttributes can't override telemetry.sdk.* and telemetry.distro.*, since only the SDK or distro knows those values. This was discussed in #460 (#460 (comment)).
This comment has been minimized.
This comment has been minimized.
|
@trentm thanks. The latest commit removes resource from startBrowserSdk, and on startTracesSdk and startLogsSdk passing resource together with serviceName, serviceVersion or resourceAttributes is now a type error, so those confusing combinations can't happen anymore. Dropping serviceName and serviceVersion like startNodeSdk is a bigger breaking change, so I'd rather track it in a separate issue than grow this PR. |
Follow-up to the discussion in #460. Resource detection should be opt-in, but easy to turn on: you pass detectors in the SDK config and the SDK runs them, instead of calling
detectResourcesyourself and copying attributes over by hand. Logs and traces also need to share one resource instead of each building their own.Fixes #460