Skip to content

Implement OTLP export integ tests#669

Merged
JayPolanco merged 5 commits intomainfrom
otlp-testing
Apr 14, 2026
Merged

Implement OTLP export integ tests#669
JayPolanco merged 5 commits intomainfrom
otlp-testing

Conversation

@JayPolanco
Copy link
Copy Markdown
Contributor

@JayPolanco JayPolanco commented Apr 9, 2026

Description of the issue

Add integration tests for the OTLP export feature, which allows the CloudWatch Agent to export metrics directly to the CloudWatch monitoring endpoint via OTLP/HTTP with SigV4 authentication.

Description of changes

  • Add three EC2 integration tests validating OTLP export for hostmetrics, statsd, and collectd receivers
  • Add shared OTLP metrics query utility (otlpmetricsquery.go) that queries the CloudWatch Prometheus-compatible API with SigV4 signing
  • Add shared validation helper (otlpvalidation/validate.go) for PromQL-based metric verification
  • Add OTEL YAML agent configs for each test with otlphttp exporter, sigv4auth, resourcedetection, and batch processing
  • Add test matrix generator entries for the new test suite
  • Tests use native OTEL YAML configs (not CWA JSON), started via agent-ctl -a fetch-config -s -c file:/tmp/config.yaml

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms
of your choice.

Tests

All three tests pass in CI via the EC2LinuxOTLPExportTest workflow job (us-west-2, AL2, amd64). Manually validated on EC2 that metrics flow end-to-end: receiver → pipeline → otlphttp exporter → monitoring endpoint → PromQL query returns results, we validate all metrics were published successfully.

https://github.com/aws/amazon-cloudwatch-agent/actions/runs/24367971739

@JayPolanco JayPolanco requested a review from a team as a code owner April 9, 2026 18:57
Comment thread generator/resources/ec2_linux_otlp_export_test_matrix.json Outdated
Comment thread generator/test_case_generator.go Outdated
Comment thread util/awsservice/otlpmetricsquery.go
@JayPolanco JayPolanco merged commit 84992f3 into main Apr 14, 2026
6 checks passed
@JayPolanco JayPolanco deleted the otlp-testing branch April 14, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants