hyperdx/smoke-tests/otel-collector
Warren Lee 4c42fdc3a4
fix(otel-collector): improve log level extraction with word boundaries in regex (#1747)
For a log line like 
```
x-amz-id-2: WxwS/N175wqLyRlzCXLpGZGszCEbQA0f63uFgdQN1qfcPr2IAmwE/P7HF2b1NdZLg18pNLF3ecTw5CrItXJid/uLe+fxh3jMBiJ7UlUxidw=
```
The level will be inferred as fatal because it contains `CrIt`, which is incorrect.

To fix this, we need to add a word boundary at the start

Ref: HDX-3439


CLAUDE: made a mistake.
```
 Test expects "ALERTING" to match "alert" keyword → "ALERTING" won't match with word boundary because "alert" is a substring, not at a word boundary. Expected should be "info",9,"ALERTING system engaged" not "fatal",21.
``` 
-> incorrect statement
2026-02-18 22:16:07 +00:00
..
data fix(otel-collector): improve log level extraction with word boundaries in regex (#1747) 2026-02-18 22:16:07 +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: add TLS support for OTel collector migration script (#1714) 2026-02-10 02:40:28 +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 fix(otel-collector): improve log level extraction with word boundaries in regex (#1747) 2026-02-18 22:16:07 +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