Skip to content

Conversation

@iunanua
Copy link
Collaborator

@iunanua iunanua commented Sep 23, 2025

What does this PR do?

Get the id of the last RC update and use it to notify the configuration change via telemetry:

  • ApmTracingConfig struct modified to include the id field received in the RC response
  • RC tests changed accordingly
  • Add telemetry::notify_configuration_update method to notify the configuration change from the update_sampling_rules_from_remote and clear_remote_sampling_rules callbacks using the same config_id received previously

Motivation

Make pass some test_dynamic_configuration.py::TestDynamicConfigSamplingRules tests

Additional Notes

libdatadog's TelemetryWorkerHandle manages internally the configuration property changes. It stores the initial configuration values and it is able to know when a value has changed and to emit the app-client-configuration-change telemetry event.

@datadog-official
Copy link

datadog-official bot commented Sep 23, 2025

⚠️ Tests

⚠️ Warnings

❄️ 1 New flaky test detected

span_exporter::tests::test_receiver_sender_timeout from datadog-opentelemetry (Datadog)
thread 'span_exporter::tests::test_receiver_sender_timeout' panicked at datadog-opentelemetry\src\span_exporter.rs:816:9:
a scoped thread panicked
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library\std\src\panicking.rs:697
   1: core::panicking::panic_fmt
             at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library\core\src\panicking.rs:75
   2: std::thread::scoped::scope<datadog_opentelemetry::span_exporter::tests::test_receiver_sender_timeout::closure_env$0,tuple$<> >
             at /rustc/1159e78c4747b02ef996e55082b704c09b970588\library\std\src\thread\scoped.rs:163
   3: datadog_opentelemetry::span_exporter::tests::test_receiver_sender_timeout
...

ℹ️ Info

🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: ca06bf2 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

Base automatically changed from igor/fix-rc-rules-processing to main September 23, 2025 14:58
@iunanua iunanua marked this pull request as ready for review September 23, 2025 15:27
@iunanua iunanua requested a review from a team as a code owner September 23, 2025 15:27
@iunanua iunanua changed the title feat(remote_config): send RC updates via telemetry feat(remote_config): send RC updates via telemetry (sampling rules) Sep 24, 2025
/// - `config_id`: Optional identifier for remote configuration scenarios. When provided, this
/// ID is included in the returned `Configuration` to track which remote configuration is
/// responsible for the current value.
fn get_configuration(&self, config_id: Option<String>) -> Configuration;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having to provide a config_id here which is directly used to fill one of the field of the returned Configuration value feels weird

I would expect ConfigItems to carry their config_id with them, and use it to construct the Configuration value when calling get_configuration.

This will be useful when we enable stable config for instance, where the configurations items we read can have their own config id.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, as I don't know well all the different cases for configuration I tried not to store config_id (and not to mess around with ArcSwap) but I have changed it.

For now, only ConfigItemWithOverride can update its config_id. idk if it would be necessary also for ConfigItem...

Copy link
Collaborator

@paullegranddc paullegranddc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment on lines 184 to 195
let Some(telemetry) = telemetry_cell.get() else {
return;
};
let Ok(mut telemetry) = telemetry.lock() else {
return;
};
if !telemetry.enabled {
return;
}
let Some(handle) = telemetry.handle.as_mut() else {
return;
};
Copy link
Collaborator

@paullegranddc paullegranddc Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: you can replace this with with_telemetry_handle now that the other PR is merged.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@iunanua iunanua merged commit fc851c9 into main Nov 4, 2025
30 of 32 checks passed
@iunanua iunanua deleted the igor/rc_telemetry branch November 4, 2025 10:20
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.

3 participants