diff --git a/test/agent_otel_merging/agent_otel_merging_test.go b/test/agent_otel_merging/agent_otel_merging_test.go index 71951e420..380bfdcdc 100644 --- a/test/agent_otel_merging/agent_otel_merging_test.go +++ b/test/agent_otel_merging/agent_otel_merging_test.go @@ -31,6 +31,7 @@ func TestOtelMerging(t *testing.T) { appendOtelConfig(t) sendPayload(t) verifyMetricsInCloudWatch(t) + verifyHealthCheck(t) } func startAgent(t *testing.T) { @@ -88,3 +89,14 @@ func verifyMetricsInCloudWatch(t *testing.T) { require.NoError(t, err, "Failed to parse CloudWatch response") require.NotEmpty(t, stats.Datapoints, "No data points found for the metric") } + +func verifyHealthCheck(t *testing.T) { + endpoint := "http://localhost:13133/health/status" + + verifyCmd := exec.Command("curl", "-s", "-o", "/dev/null", "-w", "%{http_code}", endpoint) + verifyOutput, err := verifyCmd.CombinedOutput() + require.NoError(t, err, "Failed to execute curl command: %s", verifyOutput) + + httpCode := string(verifyOutput) + require.Equal(t, "200", httpCode, "Expected HTTP status code 200, got %s", httpCode) +} diff --git a/test/agent_otel_merging/resources/otel.yaml b/test/agent_otel_merging/resources/otel.yaml index ca7758cd7..a77e70fbb 100644 --- a/test/agent_otel_merging/resources/otel.yaml +++ b/test/agent_otel_merging/resources/otel.yaml @@ -14,7 +14,12 @@ exporters: enabled: true version: "0" +extensions: + health_check: + service: + extensions: + - health_check pipelines: metrics: receivers: [otlp]