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

[NDMII-3310] add support for HA integrations #33828

Conversation

jedupau
Copy link
Contributor

@jedupau jedupau commented Feb 7, 2025

What does this PR do?

This PR adds a method IsHASupported to the Check interface which returns false by default.
Overriding it to true means that the integration does support HA.
If a user configures an integration with ha_enabled: true on a non supported integration the Configure will fail and the check not schedule

Describe how you validated your changes

Run a supported and an unsupported integration with and without ha_enabled: true.

  • unsupported integration without configuration : nothing change
  • unsupported integration with configuration : configuration fails, visible in agent status
  • supported integration without configuration : nothing change
  • supported integration with configuration : HA works as expected

Possible Drawbacks / Trade-offs

Additional Notes

@jedupau jedupau force-pushed the jed/flag-integrations-ha-compatible branch 2 times, most recently from 6768c06 to 609adf7 Compare February 10, 2025 14:14
@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Feb 10, 2025

Static quality checks ✅

Please find below the results from static quality gates

Info

Result Quality gate On disk size On disk size limit On wire size On wire size limit
static_quality_gate_agent_deb_amd64 849.54MiB 858.45MiB 204.66MiB 214.3MiB
static_quality_gate_docker_agent_amd64 933.94MiB 942.69MiB 311.9MiB 321.56MiB

@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Feb 10, 2025

Test changes on VM

Use this command from test-infra-definitions to manually test this PR changes on a VM:

inv aws.create-vm --pipeline-id=55784795 --os-family=ubuntu

Note: This applies to commit c1f429b

@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Feb 10, 2025

Uncompressed package size comparison

Comparison with ancestor 16bfa4fdf67f4c67a45582c254d1bef347dd1757

Diff per package
package diff status size ancestor threshold
datadog-agent-aarch64-rpm 5.30MB 876.59MB 871.29MB 0.50MB
datadog-agent-arm64-deb 5.27MB 866.84MB 861.57MB 0.50MB
datadog-agent-x86_64-rpm 4.81MB 888.25MB 883.43MB 0.50MB
datadog-agent-x86_64-suse 4.81MB 888.25MB 883.43MB 0.50MB
datadog-heroku-agent-amd64-deb 4.80MB 450.87MB 446.07MB 0.50MB
datadog-agent-amd64-deb 4.79MB 878.48MB 873.69MB 0.50MB
datadog-iot-agent-amd64-deb 0.02MB ⚠️ 86.51MB 86.49MB 0.50MB
datadog-iot-agent-arm64-deb 0.02MB ⚠️ 82.79MB 82.77MB 0.50MB
datadog-iot-agent-x86_64-rpm 0.02MB ⚠️ 86.58MB 86.56MB 0.50MB
datadog-iot-agent-x86_64-suse 0.02MB ⚠️ 86.58MB 86.56MB 0.50MB
datadog-iot-agent-aarch64-rpm 0.02MB ⚠️ 82.86MB 82.84MB 0.50MB
datadog-dogstatsd-x86_64-rpm -0.00MB 59.18MB 59.18MB 0.50MB
datadog-dogstatsd-x86_64-suse -0.00MB 59.18MB 59.18MB 0.50MB
datadog-dogstatsd-amd64-deb -0.00MB 59.10MB 59.10MB 0.50MB
datadog-dogstatsd-arm64-deb -0.00MB 56.57MB 56.57MB 0.50MB

Decision

❌ Failed

Currently this PR is blocked, you can reach out to #agent-delivery-help to get support/ask for an exception.

Copy link

cit-pr-commenter bot commented Feb 10, 2025

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: c9b5a73b-afd9-4f64-b62b-f232d3964666

Baseline: 16bfa4f
Comparison: dd699ed
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
quality_gate_logs % cpu utilization +1.62 [-1.46, +4.70] 1 Logs
file_to_blackhole_1000ms_latency_linear_load egress throughput +0.63 [+0.16, +1.09] 1 Logs
tcp_syslog_to_blackhole ingress throughput +0.20 [+0.13, +0.27] 1 Logs
file_to_blackhole_1000ms_latency egress throughput +0.10 [-0.68, +0.87] 1 Logs
uds_dogstatsd_to_api ingress throughput +0.02 [-0.26, +0.30] 1 Logs
file_to_blackhole_100ms_latency egress throughput +0.01 [-0.68, +0.69] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.01, +0.02] 1 Logs
file_to_blackhole_0ms_latency egress throughput -0.01 [-0.89, +0.87] 1 Logs
file_to_blackhole_0ms_latency_http2 egress throughput -0.01 [-0.85, +0.83] 1 Logs
file_to_blackhole_300ms_latency egress throughput -0.01 [-0.65, +0.62] 1 Logs
file_to_blackhole_0ms_latency_http1 egress throughput -0.02 [-0.92, +0.87] 1 Logs
quality_gate_idle memory utilization -0.08 [-0.11, -0.05] 1 Logs bounds checks dashboard
file_to_blackhole_500ms_latency egress throughput -0.10 [-0.89, +0.69] 1 Logs
file_tree memory utilization -0.21 [-0.27, -0.14] 1 Logs
quality_gate_idle_all_features memory utilization -0.22 [-0.28, -0.16] 1 Logs bounds checks dashboard
uds_dogstatsd_to_api_cpu % cpu utilization -1.37 [-2.22, -0.52] 1 Logs

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed links
file_to_blackhole_0ms_latency lost_bytes 10/10
file_to_blackhole_0ms_latency memory_usage 10/10
file_to_blackhole_0ms_latency_http1 lost_bytes 10/10
file_to_blackhole_0ms_latency_http1 memory_usage 10/10
file_to_blackhole_0ms_latency_http2 lost_bytes 10/10
file_to_blackhole_0ms_latency_http2 memory_usage 10/10
file_to_blackhole_1000ms_latency memory_usage 10/10
file_to_blackhole_1000ms_latency_linear_load 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_300ms_latency lost_bytes 10/10
file_to_blackhole_300ms_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
quality_gate_logs lost_bytes 10/10
quality_gate_logs memory_usage 10/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".

CI Pass/Fail Decision

Passed. All Quality Gates 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_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.

@jedupau jedupau force-pushed the jed/flag-integrations-ha-compatible branch from fb8850d to 85ba6a6 Compare February 11, 2025 09:32
@jedupau jedupau force-pushed the jed/flag-integrations-ha-compatible branch from 85ba6a6 to dd699ed Compare February 11, 2025 09:33
@jedupau jedupau changed the title [NDMII-3310] Jed/flag integrations ha compatible [NDMII-3310] add support for HA integrations Feb 11, 2025
@jedupau jedupau force-pushed the jed/flag-integrations-ha-compatible branch from 79c04d9 to 3742efa Compare February 11, 2025 16:06
@jedupau jedupau marked this pull request as ready for review February 11, 2025 16:11
@jedupau jedupau requested review from a team as code owners February 11, 2025 16:11
@jedupau jedupau requested review from akarpz and FlorianVeaux and removed request for a team February 11, 2025 16:11
@jedupau jedupau force-pushed the jed/flag-integrations-ha-compatible branch from 3742efa to c159e6a Compare February 11, 2025 16:39
@jedupau jedupau force-pushed the jed/flag-integrations-ha-compatible branch from c159e6a to 8141d48 Compare February 11, 2025 17:15
@AlexandreYang AlexandreYang self-requested a review February 11, 2025 18:39
@github-actions github-actions bot added the long review PR is complex, plan time to review it label Feb 11, 2025
@AlexandreYang AlexandreYang self-requested a review February 11, 2025 21:40
Copy link
Member

@GustavoCaso GustavoCaso left a comment

Choose a reason for hiding this comment

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

LGTM 👏

@@ -56,6 +56,8 @@ type Check interface {
GetDiagnoses() ([]diagnosis.Diagnosis, error)
// IsHAEnabled returns if High Availability is enabled for this check
IsHAEnabled() bool
// IsHASupported returns if the check is compatible with High Availability
IsHASupported() bool
Copy link
Contributor

Choose a reason for hiding this comment

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

CheckWrapper#IsHASupported is the only place where this interface method is called. Since we don't call anywhere useful, this can be safely removed.


// IsHASupported returns if the check is compatible with High Availability
func (c *CheckBase) IsHASupported() bool {
return false
Copy link
Contributor

Choose a reason for hiding this comment

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

How checks would opt-in? Since go doesn't support virtual methods, CommonConfigure will always call this exact implementation, and will always get false.

@@ -68,3 +72,19 @@ func TestCommonConfigureCustomID(t *testing.T) {
assert.Equal(t, string(mycheck.ID()), "test:foobar:a934df33209f45f4")
mockSender.AssertExpectations(t)
}

func TestCommonConfigureNotHASupported(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please also add a test that a check can actually opt-in?

@@ -290,6 +290,11 @@ func (c *CiscoSdwanCheck) Interval() time.Duration {
return c.interval
}

// IsHASupported returns true if the check supports HA
func (c *CiscoSdwanCheck) IsHASupported() bool {
return true
Copy link
Contributor

Choose a reason for hiding this comment

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

Could not configure check cisco_sdwan: High Availability is enabled for check cisco_sdwan:2a628ec07bc21842 but this integration does not support it

@@ -478,6 +480,9 @@ func (j *JMXFetch) ConfigureFromInitConfig(initConfig integration.Data) error {
j.JavaCustomJarPaths = initConf.CustomJarPaths
}
}
if initConf.HAEnabled {
return fmt.Errorf("High Availability is not supported in JMX integrations")
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem to propagate to agent status the same way that other integrations report this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it seems that no configuration errors in jmx integrations appears in the status 🤔
https://github.com/DataDog/datadog-agent/blob/jed/flag-integrations-ha-compatible/pkg/jmxfetch/scheduler.go#L59-L62

@jedupau jedupau force-pushed the jed/flag-integrations-ha-compatible branch from 4dd480e to 9bc8a11 Compare February 17, 2025 16:58
@jedupau jedupau requested review from a team as code owners February 17, 2025 16:58
@jedupau jedupau marked this pull request as draft February 17, 2025 17:00
@jedupau jedupau closed this Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
long review PR is complex, plan time to review it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants