hyperdx/smoke-tests/otel-collector
Warren ab50b12a6b
feat: support custom otel collector config (BETA) (#1074)
plus the fix to reduce bloat in opamp agent logs

Users should be able to mount the custom otel collector config file and add/overrider receivers, processors and exporters
For example:
```
receivers:
  hostmetrics:
    collection_interval: 5s
    scrapers:
      cpu:
      load:
      memory:
      disk:
      filesystem:
      network:
# override the default processors
processors:
  batch:
    send_batch_size: 10000
    timeout: 10s
  memory_limiter:
    limit_mib: 2000
service:
  pipelines:
    metrics/hostmetrics:
      receivers: [hostmetrics]
      # attach existing processors
      processors: [memory_limiter, batch]
      # attach existing exporters
      exporters: [clickhouse]
```
This will add a new `hostmetrics` receiver + `metrics/hostmetrics` pipeline and update existing `batch` + `memory_limiter` processors 

WARNING: This feature is still in beta, and future updates may change how it works, potentially affecting compatibility

Ref: HDX-1865
2025-08-18 21:22:43 +00:00
..
data feat: normalize the text case of severity text (#834) 2025-05-22 04:42:00 +00:00
test_helpers Add ingestion key check to otel collector via OpAMP (#825) 2025-05-23 01:41:35 +00:00
auto-parse-json.bats feat: normalize the text case of severity text (#834) 2025-05-22 04:42:00 +00:00
docker-compose.yaml feat: support custom otel collector config (BETA) (#1074) 2025-08-18 21:22:43 +00:00
normalize-severity.bats feat: normalize the text case of severity text (#834) 2025-05-22 04:42:00 +00:00
README.md Add ingestion key check to otel collector via OpAMP (#825) 2025-05-23 01:41:35 +00:00
receiver-config.yaml Add ingestion key check to otel collector via OpAMP (#825) 2025-05-23 01:41:35 +00:00
setup_suite.bash feat: normalize the text case of severity text (#834) 2025-05-22 04:42:00 +00:00
severity-inference.bats feat: normalize the text case of severity text (#834) 2025-05-22 04:42:00 +00:00

OpenTelemetry Collector Smoke Tests

This directory contains smoke tests for validating the OpenTelemetry Collector functionality in HyperDX.

Prerequisites

Before running the tests, ensure you have the following tools installed:

  • Bats - Bash Automated Testing System
  • Docker and Docker Compose
  • curl - Command line tool for transferring data
  • ClickHouse client - Command-line client for ClickHouse
    • Make sure to run clickhouse install to install the ClickHouse client after downloading ClickHouse

Running the Tests

To run all the tests:

cd smoke-tests/otel-collector
bats *.bats

To run a specific test file:

bats hdx-1453-auto-parse-json.bats

Test Structure

  • *.bats - Test files written in Bats
  • setup_suite.bash - Contains global setup_suite and teardown_suite functions that run once for the entire test suite
  • data/ - Test data used by the tests
  • test_helpers/ - Utility functions for the tests
  • docker-compose.yaml - Docker Compose configuration for the test environment

The test suite uses Bats' setup_suite and teardown_suite hooks to initialize the environment only once, regardless of how many test files are run. This optimizes test execution by:

  1. Validating the environment once
  2. Starting Docker containers once at the beginning of the test suite
  3. Cleaning up containers once at the end of the test suite

Debugging

If you need to debug the tests, you can set the SKIP_CLEANUP environment variable to prevent the Docker containers from being torn down after the tests complete:

SKIP_CLEANUP=1 bats *.bats

or

SKIP_CLEANUP=true bats *.bats

With SKIP_CLEANUP enabled, the test containers will remain running after the tests complete, allowing you to inspect logs, connect to the containers, and debug issues.

To manually clean up the containers after debugging:

docker compose down