process_discovery: expose threadlocal_attribute_keys#135
Merged
Conversation
Add the optional `threadlocal_attribute_keys: Option<Vec<String>>`
field to the NAPI `TracerMetadata` and forward it to libdatadog's
`tracer_metadata::TracerMetadata`. When set, libdatadog's
`to_otel_process_ctx` injects:
threadlocal.schema_version = "tlsdesc_v1_dev"
threadlocal.attribute_key_map = ["datadog.local_root_span_id",
...threadlocal_attribute_keys]
into the OTel process context, giving an out-of-process reader the
name table for the uint8 key indices that OTEP-4947 thread-context
records carry on the wire. The implicit `datadog.local_root_span_id`
key is prepended by libdatadog itself; callers only supply their
*additional* keys (entry 0 in this list = wire key index 1).
The field is gated behind libdatadog's `otel-thread-ctx` Cargo
feature, which arrived after v29.0.0. Bump the
`libdd-library-config` dependency to v35.0.0 (matches the version
already pinned by the crashtracker crate in this workspace) and
enable the feature.
Existing 8-arg constructor calls keep working because the new
field is optional. The test exercises both the absent and present
forms.
Overall package sizeSelf size: 28.01 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------|🤖 This report was automatically generated by heaviest-objects-in-the-universe |
yannham
approved these changes
Jun 22, 2026
Merged
szegedi
added a commit
that referenced
this pull request
Jun 22, 2026
Add the optional `threadlocal_attribute_keys: Option<Vec<String>>`
field to the NAPI `TracerMetadata` and forward it to libdatadog's
`tracer_metadata::TracerMetadata`. When set, libdatadog's
`to_otel_process_ctx` injects:
threadlocal.schema_version = "tlsdesc_v1_dev"
threadlocal.attribute_key_map = ["datadog.local_root_span_id",
...threadlocal_attribute_keys]
into the OTel process context, giving an out-of-process reader the
name table for the uint8 key indices that OTEP-4947 thread-context
records carry on the wire. The implicit `datadog.local_root_span_id`
key is prepended by libdatadog itself; callers only supply their
*additional* keys (entry 0 in this list = wire key index 1).
The field is gated behind libdatadog's `otel-thread-ctx` Cargo
feature, which arrived after v29.0.0. Bump the
`libdd-library-config` dependency to v35.0.0 (matches the version
already pinned by the crashtracker crate in this workspace) and
enable the feature.
Existing 8-arg constructor calls keep working because the new
field is optional. The test exercises both the absent and present
forms.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds an optional
threadlocal_attribute_keys: Option<Vec<String>>field to the NAPITracerMetadataand forwards it to libdatadog'stracer_metadata::TracerMetadata. When set, libdatadog'sto_otel_process_ctxinjects into the OTel process context:— giving an out-of-process reader the name table for the uint8 key indices that OTEP-4947 thread-context records carry on the wire. The implicit
datadog.local_root_span_idkey is prepended by libdatadog itself; callers only supply their additional keys (entry 0 in this list = wire key index 1).Motivation
A Node.js OTEP-4947 thread-context writer (currently in development in DataDog/pprof-nodejs#347, to be integrated into dd-trace-js) needs to publish its attribute key list as part of the OTel process context so that an out-of-process eBPF reader can decode the on-wire
key_indexbytes back to attribute names. This change is the dd-trace-js-facing piece of that plumbing.Implementation notes
otel-thread-ctxCargo feature, which arrived after v29.0.0. Thelibdd-library-configdep is bumped from v29.0.0 → v35.0.0 (matching the version already pinned by the crashtracker crate in this workspace) and the feature is enabled.Test plan
yarn build-debugsucceeds with the bumped dependencynode test/process-discovery.jspasses (both the existing positional call and the new threadlocal-keys variant)yarn lint test/process-discovery.jsclean🤖 Generated with Claude Code