-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
chore(config): Refactor secrets loading to avoid use of futures::executor::block_on #21073
Conversation
…ock_on Since the caller was async no need to have the nested functions be sync. Signed-off-by: Jesse Szwedko <[email protected]>
Datadog ReportBranch report: ✅ 0 Failed, 7 Passed, 0 Skipped, 25.5s Total Time |
src/config/loading/secret.rs
Outdated
let backend_secrets = backend | ||
.retrieve(keys.clone(), signal_rx) | ||
.map_ok(|backend_secrets| { | ||
backend_secrets.into_iter().map(|(k, v)| { | ||
trace!(message = "Successfully retrieved a secret.", backend = ?backend_name, key = ?k); | ||
(format!("{}.{}", backend_name, k), v) | ||
}).collect::<HashMap<String, String>>() | ||
}) | ||
.map_err(|e| { | ||
format!( | ||
"Error while retrieving secret from backend \"{}\": {}.", | ||
backend_name, e | ||
) | ||
}) | ||
.await?; | ||
|
||
secrets.extend(backend_secrets); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you were unable to find a functional-style mechanism for this (possibly due to interactions with async calls), would it make sense to just loop over backend.retrieve(…)
instead of using map_ok
and map_err
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good thought, that is clearer. I made this change in 34964f4
Co-authored-by: Bruce Guenter <[email protected]>
Signed-off-by: Jesse Szwedko <[email protected]>
Regression Detector ResultsRun ID: 2a621853-51c4-477a-bbdb-00cd5ef4b6e6 Metrics dashboard Baseline: 61b1b18 Performance changes are noted in the perf column of each table:
Significant changes in experiment optimization goalsConfidence level: 90.00%
|
perf | experiment | goal | Δ mean % | Δ mean % CI | links |
---|---|---|---|---|---|
✅ | file_to_blackhole | egress throughput | +16.06 | [+8.65, +23.48] |
Fine details of change detection per experiment
perf | experiment | goal | Δ mean % | Δ mean % CI | links |
---|---|---|---|---|---|
✅ | file_to_blackhole | egress throughput | +16.06 | [+8.65, +23.48] | |
✅ | syslog_log2metric_humio_metrics | ingress throughput | +5.26 | [+5.08, +5.43] | |
➖ | syslog_splunk_hec_logs | ingress throughput | +1.92 | [+1.77, +2.07] | |
➖ | splunk_hec_route_s3 | ingress throughput | +1.91 | [+1.60, +2.22] | |
➖ | http_text_to_http_json | ingress throughput | +1.48 | [+1.35, +1.62] | |
➖ | http_to_http_acks | ingress throughput | +1.05 | [-0.27, +2.37] | |
➖ | http_to_s3 | ingress throughput | +0.66 | [+0.39, +0.93] | |
➖ | fluent_elasticsearch | ingress throughput | +0.46 | [-0.03, +0.95] | |
➖ | syslog_regex_logs2metric_ddmetrics | ingress throughput | +0.33 | [+0.19, +0.47] | |
➖ | http_to_http_noack | ingress throughput | +0.17 | [+0.09, +0.26] | |
➖ | datadog_agent_remap_datadog_logs_acks | ingress throughput | +0.16 | [-0.04, +0.36] | |
➖ | http_to_http_json | ingress throughput | +0.08 | [+0.01, +0.14] | |
➖ | syslog_loki | ingress throughput | +0.05 | [-0.02, +0.12] | |
➖ | splunk_hec_indexer_ack_blackhole | ingress throughput | +0.02 | [-0.06, +0.10] | |
➖ | socket_to_socket_blackhole | ingress throughput | +0.02 | [-0.03, +0.07] | |
➖ | splunk_hec_to_splunk_hec_logs_noack | ingress throughput | +0.01 | [-0.08, +0.10] | |
➖ | splunk_hec_to_splunk_hec_logs_acks | ingress throughput | +0.01 | [-0.12, +0.14] | |
➖ | otlp_http_to_blackhole | ingress throughput | -0.07 | [-0.21, +0.06] | |
➖ | otlp_grpc_to_blackhole | ingress throughput | -0.32 | [-0.44, -0.20] | |
➖ | syslog_log2metric_tag_cardinality_limit_blackhole | ingress throughput | -0.42 | [-0.51, -0.34] | |
➖ | syslog_humio_logs | ingress throughput | -0.96 | [-1.09, -0.83] | |
➖ | datadog_agent_remap_blackhole | ingress throughput | -1.76 | [-1.89, -1.64] | |
➖ | syslog_log2metric_splunk_hec_metrics | ingress throughput | -1.95 | [-2.08, -1.83] | |
➖ | datadog_agent_remap_datadog_logs | ingress throughput | -2.30 | [-2.48, -2.13] | |
➖ | http_elasticsearch | ingress throughput | -2.51 | [-2.68, -2.35] | |
➖ | datadog_agent_remap_blackhole_acks | ingress throughput | -4.58 | [-4.73, -4.43] |
Explanation
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:
-
Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.
-
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.
-
Its configuration does not mark it "erratic".
…utor::block_on (vectordotdev#21073) * chore: Refactor secrets loading to avoid use of futures::executor::block_on Since the caller was async no need to have the nested functions be sync. Signed-off-by: Jesse Szwedko <[email protected]> * Apply suggestions from code review Co-authored-by: Bruce Guenter <[email protected]> * pr feedback Signed-off-by: Jesse Szwedko <[email protected]> --------- Signed-off-by: Jesse Szwedko <[email protected]> Co-authored-by: Bruce Guenter <[email protected]>
Since the caller was async no need to have the nested functions be sync.
I spent an hour or so trying to keep
SecretBackendLoader#retrieve
in a functional processing style, but gave up and went for the simpler approach of iterating and mutating.Signed-off-by: Jesse Szwedko [email protected]