Autodiscovery Config Filtering via CEL - #41031
Conversation
40c1310 to
3bd30ed
Compare
Regression DetectorRegression Detector ResultsMetrics dashboard Baseline: 8497514 Optimization Goals: ✅ No significant changes detected
|
| perf | experiment | goal | Δ mean % | Δ mean % CI | trials | links |
|---|---|---|---|---|---|---|
| ✅ | docker_containers_cpu | % cpu utilization | -23.81 | [-25.43, -22.18] | 1 | Logs |
Fine details of change detection per experiment
| perf | experiment | goal | Δ mean % | Δ mean % CI | trials | links |
|---|---|---|---|---|---|---|
| ➖ | quality_gate_metrics_logs | memory utilization | +1.11 | [+0.89, +1.32] | 1 | Logs bounds checks dashboard |
| ➖ | tcp_syslog_to_blackhole | ingress throughput | +0.70 | [+0.62, +0.79] | 1 | Logs |
| ➖ | otlp_ingest_metrics | memory utilization | +0.39 | [+0.26, +0.51] | 1 | Logs |
| ➖ | file_tree | memory utilization | +0.37 | [+0.33, +0.41] | 1 | Logs |
| ➖ | quality_gate_idle | memory utilization | +0.18 | [+0.13, +0.24] | 1 | Logs bounds checks dashboard |
| ➖ | ddot_metrics_sum_delta | memory utilization | +0.07 | [-0.09, +0.22] | 1 | Logs |
| ➖ | ddot_logs | memory utilization | +0.07 | [-0.00, +0.14] | 1 | Logs |
| ➖ | file_to_blackhole_100ms_latency | egress throughput | +0.06 | [-0.54, +0.67] | 1 | Logs |
| ➖ | file_to_blackhole_0ms_latency | egress throughput | +0.05 | [-0.55, +0.66] | 1 | Logs |
| ➖ | file_to_blackhole_500ms_latency | egress throughput | +0.02 | [-0.59, +0.64] | 1 | Logs |
| ➖ | uds_dogstatsd_to_api | ingress throughput | +0.00 | [-0.21, +0.21] | 1 | Logs |
| ➖ | tcp_dd_logs_filter_exclude | ingress throughput | +0.00 | [-0.01, +0.01] | 1 | Logs |
| ➖ | uds_dogstatsd_20mb_12k_contexts_20_senders | memory utilization | -0.01 | [-0.06, +0.03] | 1 | Logs |
| ➖ | quality_gate_idle_all_features | memory utilization | -0.03 | [-0.07, +0.01] | 1 | Logs bounds checks dashboard |
| ➖ | file_to_blackhole_1000ms_latency | egress throughput | -0.12 | [-0.74, +0.50] | 1 | Logs |
| ➖ | otlp_ingest_logs | memory utilization | -0.15 | [-0.29, -0.02] | 1 | Logs |
| ➖ | ddot_metrics_sum_cumulativetodelta_exporter | memory utilization | -0.24 | [-0.43, -0.05] | 1 | Logs |
| ➖ | docker_containers_memory | memory utilization | -0.30 | [-0.74, +0.15] | 1 | Logs |
| ➖ | ddot_metrics | memory utilization | -0.57 | [-0.73, -0.40] | 1 | Logs |
| ➖ | ddot_metrics_sum_cumulative | memory utilization | -0.62 | [-0.73, -0.51] | 1 | Logs |
| ➖ | quality_gate_logs | % cpu utilization | -2.31 | [-5.03, +0.42] | 1 | Logs bounds checks dashboard |
| ✅ | docker_containers_cpu | % cpu utilization | -23.81 | [-25.43, -22.18] | 1 | Logs |
Bounds Checks: ❌ Failed
| perf | experiment | bounds_check_name | replicates_passed | links |
|---|---|---|---|---|
| ✅ | docker_containers_cpu | simple_check_run | 10/10 | |
| ❌ | docker_containers_memory | memory_usage | 9/10 | |
| ✅ | docker_containers_memory | simple_check_run | 10/10 | |
| ✅ | file_to_blackhole_0ms_latency | lost_bytes | 10/10 | |
| ✅ | file_to_blackhole_0ms_latency | memory_usage | 10/10 | |
| ✅ | file_to_blackhole_1000ms_latency | memory_usage | 10/10 | |
| ✅ | file_to_blackhole_100ms_latency | lost_bytes | 10/10 | |
| ✅ | file_to_blackhole_100ms_latency | memory_usage | 10/10 | |
| ✅ | file_to_blackhole_500ms_latency | lost_bytes | 10/10 | |
| ✅ | file_to_blackhole_500ms_latency | memory_usage | 10/10 | |
| ✅ | quality_gate_idle | intake_connections | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_idle | memory_usage | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_idle_all_features | intake_connections | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_idle_all_features | memory_usage | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_logs | intake_connections | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_logs | lost_bytes | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_logs | memory_usage | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_metrics_logs | cpu_usage | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_metrics_logs | intake_connections | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_metrics_logs | lost_bytes | 10/10 | bounds checks dashboard |
| ✅ | quality_gate_metrics_logs | memory_usage | 10/10 | bounds checks dashboard |
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:
-
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".
CI Pass/Fail Decision
✅ Passed. All Quality Gates passed.
- quality_gate_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
- quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_idle_all_features, bounds check intake_connections: 10/10 replicas passed. Gate passed.
- quality_gate_metrics_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_metrics_logs, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
- quality_gate_metrics_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
- quality_gate_metrics_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
- quality_gate_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
- quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
Static quality checks✅ Please find below the results from static quality gates Successful checksInfo
|
3472f23 to
710500b
Compare
972dab1 to
d3c19d9
Compare
710500b to
1e3b27a
Compare
Simplifies the overall interface of users interacting with the `WorkloadFilter` store component. Previously, the experienced flow of using the component look like: ``` Init: c.filterStore = filterStore c.selectedFilterIDs = util.GetContainerSharedMetricFilters() Run: c.filterStore.IsContainerExcluded(filterableContainer, c.selectedFilterIDs) ``` The new interface allows users to get the actual filters from the store in a bundle and use that object to make filtering decisions. This avoids the need of holding onto the filterStore and also the client does not need to pass around the selectedFilterIDs. ``` Init: c.containerFilter := filterStore.GetContainerSharedMetricFilters() Run: c.containerFilter.IsExcluded(filterableContainer) ``` Simplify the experience of users with the `WorkloadFilter` store component. CI
9db067d to
69fc217
Compare
69fc217 to
30097b2
Compare
aqian01
left a comment
There was a problem hiding this comment.
LGTM for files owned by ALP
44d3a70 to
98a5fac
Compare
25debaa to
906f547
Compare
c7cda97 to
9e2721f
Compare
9e2721f to
d0e556f
Compare
5956c87 to
561becf
Compare
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
### What does this PR do? Fixes an issue where empty `cel_selector` fields appear in Fleet Automation inventory payloads for integration configs that don't define CEL selectors. ### Motivation Following #41031 which added CEL selector support to autodiscovery, the `cel_selector` field appears in all inventory payloads with empty values even when not defined in the config file: ```yaml cel_selector: containers: [] processes: [] pods: [] kube_services: [] kube_endpoints: [] ``` This confuses customers viewing their configs in Fleet Automation, as they see fields that aren't in their actual `.conf` files. ### How Added `omitempty` YAML tag to the `CELSelector` field in `configFormat` struct, consistent with all other optional fields. This ensures empty CEL selectors are omitted during YAML marshaling for inventory payloads while preserving configs that explicitly define CEL selectors. ### Describe how to test/QA your changes - Unit tests pass for autodiscovery providers - Configs without `cel_selector` → field omitted from inventory payload - Configs with `cel_selector` → field present with values Co-authored-by: baptiste.foy <baptiste.foy@datadoghq.com>
What does this PR do?
Introduces a new matching capability for check-configurations and services within Autodiscovery. The
cel_selectortakes in rules defined by Google's Common Expression Language and allows more granular decision making onto which service a check gets scheduled on.The
cel_selectorwill be able to be configured independently and also with traditionalad_identifiers / advanced_ad_identifiers:cel_selectorwill be used to compare every candidate service with the check-config (more computational expensive and can be risky).cel_selectoris defined with an ADID, then the Autodiscovery Identifier will be applied first. Only if the ADIDs match between the service and config will the cel_selector execute to perform more granular matching.The support of the
cel_selectorin Autodiscovery is limited tocontainers,kube_services,kube_endpoints, and in the near futureprocesses. The structures for each entity are defined here in the WorkloadFilter proto definitions. This still remains to be documented.Motivation
Expose more granular check scheduling capabilities for the Agent. CONTP-984
Describe how you validated your changes
Deploy the Agent with the subsequent helm chart.- On the Node Agent, it contains a check config which targets all containers in the
- On the Cluster Agent, it container a check config which targets
datadog-agentnamespace. It also contains a check config which targets an nginx image in a container called load-balancer.my-nginxservice in thedefaultnamespace withdatadog-obsannotation. It also contains a check config which targets all services in the cluster.Case 1 (Node + CEL + File): On the node agent, you should expect
agent configcheckto expose a redisdb check configured for all containers in the datadog-agent namespace (node agent, dca, and clc runners).Case 2 (Node + ADID + CEL + File): On the node agent, you should expect `agent configcheck` to expose a http check configured for the nginx pod.
Case 3 (DCA + CEL + File): On the cluster agent, you should expect
agent configcheckto expose a http check2 configured for every single service in your cluster.Case 4 (DCA + ADID + CEL + File): On the cluster agent, you should expect `agent configcheck` to expose a http check configured for the service defined below.
Additional Notes
CELSelector via Annotations: We have decided to not implement support for parsing this rule when defining check configuration via annotations/labels on a resource. We assume that if you are explicitly adding a check config directly onto a granular resource, the user would be wanting to run the check. This simplifies Agent side code as well as reduces risks of misconfiguration from users.
DCA KubeServices + KubeEndpoints: We want to allow users to filter on services and endpoints based on their parameters like name, namespace, and annotations. Currently in the cluster-agent we do not store a complete view of these entities. Autodiscovery has its own direct collector from the APIServer. Therefore, we must store the metadata of the k8s object within the Autodiscovery service entity. This is limited to the name, namespace, and annotations of the entity.
Performance: This change was tested and profiled on an experimental cluster. We can see that in terms of CPU usage there are no drastic changes. The service reconciliation only happens when new workloads enter the node which should be relatively infrequent. In terms of memory usage, the compiled regex expression accounts for about half the memory usage for the compiled program and the other half is other miscellaneous costs of CEL. Memory costs linearly scale with the size of rules which users define.
CPU Profiles
Memory Profiles
TODO Remaining Work: