Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APR-278] Add config refresher to update API key #351

Merged
merged 19 commits into from
Dec 4, 2024
Merged

Conversation

rayz
Copy link
Contributor

@rayz rayz commented Nov 25, 2024

Context

We would like to receive configuration updates via the datadog-agent config/v1 endpoint.

Solution

This pr creates a new object RefreshableConfiguration that has a task that sends a request to the endpoint every 15 seconds. This can be configured with refresh_interval_seconds.

Notes

The ResolvedEndpoint will have an optional RefreshableConfiguration that they can use to get the api key.

@github-actions github-actions bot added area/config Configuration. area/components Sources, transforms, and destinations. destination/datadog-metrics Datadog Metrics destination. labels Nov 25, 2024
#[allow(unused)]
pub async fn query_agent(&self) -> Result<(), GenericError> {
let url = format!("https://localhost:5004/config/v1/");
let client = reqwest::ClientBuilder::new()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using reqwest here since I needed .danger_accept_invalid_certs for the request to work.

The curl command i was trying to imitate was
curl -H "authorization: Bearer $(cat /etc/datadog-agent/auth/auth_token)" -k https://localhost:5004/config/v1/

@pr-commenter
Copy link

pr-commenter bot commented Nov 25, 2024

Regression Detector (DogStatsD)

Regression Detector Results

Run ID: b430d5be-2203-49f9-be23-1309b4d7cdf2

Baseline: 7.59.0
Comparison: 7.59.0

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
dsd_uds_512kb_3k_contexts ingress throughput +0.00 [-0.01, +0.01] 1
dsd_uds_1mb_50k_contexts_memlimit ingress throughput +0.00 [-0.00, +0.00] 1
dsd_uds_100mb_250k_contexts ingress throughput +0.00 [-0.00, +0.00] 1
dsd_uds_500mb_3k_contexts ingress throughput +0.00 [-0.01, +0.01] 1
dsd_uds_1mb_50k_contexts ingress throughput +0.00 [-0.00, +0.00] 1
dsd_uds_10mb_3k_contexts ingress throughput -0.00 [-0.00, +0.00] 1
dsd_uds_1mb_3k_contexts ingress throughput -0.00 [-0.00, +0.00] 1
dsd_uds_1mb_3k_contexts_dualship ingress throughput -0.00 [-0.00, +0.00] 1
dsd_uds_100mb_3k_contexts ingress throughput -0.00 [-0.04, +0.04] 1
dsd_uds_100mb_3k_contexts_distributions_only memory utilization -0.55 [-0.76, -0.35] 1
quality_gates_idle_rss memory utilization -2.48 [-2.60, -2.36] 1

Bounds Checks: ❌ Failed

perf experiment bounds_check_name replicates_passed links
quality_gates_idle_rss memory_usage 0/10

Explanation

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
Copy link
Member

@tobz tobz left a comment

Choose a reason for hiding this comment

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

Left a bunch of comments.

bin/agent-data-plane/Cargo.toml Outdated Show resolved Hide resolved
lib/saluki-components/Cargo.toml Outdated Show resolved Hide resolved
bin/agent-data-plane/src/main.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Show resolved Hide resolved
@pr-commenter
Copy link

pr-commenter bot commented Dec 3, 2024

Regression Detector Links

Experiment Result Links

experiment link(s)
dsd_uds_100mb_250k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_100mb_3k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_100mb_3k_contexts_distributions_only [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_10mb_3k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_1mb_3k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_1mb_3k_contexts_dualship [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_1mb_50k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_1mb_50k_contexts_memlimit [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_500mb_3k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_512kb_3k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
quality_gates_idle_rss [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_50mb_10k_contexts_no_inlining (ADP only) [Profiling (ADP)] [SMP Dashboard]
dsd_uds_50mb_10k_contexts_no_inlining_no_allocs (ADP only) [Profiling (ADP)] [SMP Dashboard]

@rayz rayz marked this pull request as ready for review December 4, 2024 15:36
@rayz rayz requested review from a team as code owners December 4, 2024 15:36
lib/saluki-config/Cargo.toml Outdated Show resolved Hide resolved
bin/agent-data-plane/src/main.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
lib/saluki-config/src/refresher.rs Outdated Show resolved Hide resolved
}

fn default_agent_ipc_port() -> u64 {
0
Copy link
Member

Choose a reason for hiding this comment

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

Zero still doesn't make sense as a value for something we're connecting to, so we shouldn't specify a default port at all. This would let us bubble up an error when calling RefresherConfiguration::from_configuration if agent_ipc_port isn't set.

Probably have the code building the refreshable config in bin/agent-data-plane/src/main.rs catch the error and report an INFO-level log that dynamic configuration refreshing will be unavailable due to not being configured, etc etc.

///
/// Defaults to 15 seconds.
#[serde(
rename = "agent_config_refresh_internal_seconds",
Copy link
Member

Choose a reason for hiding this comment

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

Sorry for the flip-flopping here, but now that I see how we're aligning more with the agent_ipc stuff in the Agent, I think we would actually want this to be agent_ipc_config_refresh_interval, which would align with how it's used by the comp/core/configsync component.

@rayz rayz merged commit 5ffdc5e into main Dec 4, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/components Sources, transforms, and destinations. area/config Configuration. destination/datadog-metrics Datadog Metrics destination.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants