Skip to content

Use stable config for RUM snippet creation#331

Draft
pawelchcki wants to merge 17 commits intomasterfrom
package_maybe_use_shared_library_for_env
Draft

Use stable config for RUM snippet creation#331
pawelchcki wants to merge 17 commits intomasterfrom
package_maybe_use_shared_library_for_env

Conversation

@pawelchcki
Copy link
Contributor

Summary

  • Auto path: try_build_snippet_from_env now uses snippet_create_from_stable_config to read RUM config from Datadog Agent's application_monitoring.yaml files instead of building JSON from DD_RUM_* env vars
  • Directive path: on_datadog_rum_config seeds rum_config_map from stable config via stable_config_get_entries, with directive block values overriding
  • Env var forwarding: Trimmed to only DD_RUM_ENABLED and DD_RUM_APPLICATION_ID (for telemetry tags)
  • inject-browser-sdk (add-common-way-to-parse-env-variables branch):
    • DD_RUM_SITE, DD_RUM_SERVICE, DD_RUM_ENVIRONMENT take priority over DD_SITE, DD_SERVICE, DD_ENV
    • New stable_config_get_entries / stable_config_entries_cleanup C FFI for reading raw config entries

Test plan

  • cargo test passes in inject-browser-sdk (33 lib + 4 FFI tests)
  • Build nginx-datadog with -DNGINX_DATADOG_RUM_ENABLED=ON -DINJECT_BROWSER_SDK_NO_DEFAULT_FEATURES=OFF
  • Verify snippet_create_from_stable_config and stable_config_get_entries appear in generated injectbrowsersdk.h
  • Integration: provide application_monitoring.yaml with DD_RUM_SITE/DD_RUM_APPLICATION_ID and verify injection works
  • Integration: use datadog_rum_config directive with overrides and verify it seeds from stable config

- Auto path: try_build_snippet_from_env now uses
  snippet_create_from_stable_config to read from application_monitoring.yaml
  instead of building JSON from DD_RUM_* env vars
- Directive path: on_datadog_rum_config seeds from stable config via
  stable_config_get_entries, with directive block values overriding
- Trim env var forwarding to only DD_RUM_ENABLED and DD_RUM_APPLICATION_ID
- Pin inject-browser-sdk to 587b071 (includes stable_config_get_entries FFI)
A transitive dependency (clap_builder 4.6.0, via libdd-library-config)
now requires the Rust 2024 edition which needs Rust 1.85+.
@codecov-commenter
Copy link

codecov-commenter commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.85%. Comparing base (f19926a) to head (352baef).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #331   +/-   ##
=======================================
  Coverage   68.85%   68.85%           
=======================================
  Files          56       56           
  Lines        7471     7471           
  Branches     1058     1058           
=======================================
  Hits         5144     5144           
  Misses       1820     1820           
  Partials      507      507           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The :latest tag was cached by nydus snapshotter on CI runners.
Use an explicit tag to force pulling the updated image with Rust 1.85.0.
aws-lc-sys (transitive dep via libdd-library-config -> rustls) compiles
C code during its build script. Without sysroot flags, the linker
cannot find crtbeginS.o in the musl cross-compilation environment.
Rust_CARGO_TARGET is empty at the point corrosion_set_env_vars runs.
Use hardcoded x86_64/aarch64 target names instead — only one will
match the actual cargo build target, the other is harmlessly ignored.
aws-lc-sys build script compile+links test binaries via clang. Without
these flags, clang invokes system GNU ld which can't find crtbeginS.o
and libgcc in the musl sysroot. Using lld and compiler-rt matches the
rest of the toolchain setup.
test_env_only_config and test_partial_env_config now write
application_monitoring.yaml into the container instead of setting
DD_RUM_* env vars, matching the new stable config integration.
test_env_remote_configuration_id, test_env_disabled_overrides_env_config,
and test_env_disabled_location_override now use application_monitoring.yaml
instead of DD_RUM_* env vars. DD_RUM_ENABLED still uses env var since
it controls the enable/disable flag, not the config source.
…hared_library_for_env

# Conflicts:
#	.gitlab/build-and-test-fast.yml
#	.gitlab/common.yml
#	.gitlab/prepare-oci-package.sh
#	.gitlab/ssi-package.yml
Adds DD_RUM_REMOTE_CONFIGURATION_ID support in configuration_from_getter
so remoteConfigurationId appears in snippets created via stable config.
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.

2 participants