Skip to content

[sql_server_input_otel][mysql_input_otel] Add signal-specific system and policy tests for logs and metrics - #3508

Merged
mrodm merged 4 commits into
elastic:mainfrom
mrodm:update_test_packages
Apr 29, 2026
Merged

mrodm merged 4 commits into
elastic:mainfrom
mrodm:update_test_packages

Conversation

@mrodm

@mrodm mrodm commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

Update the sql_server_input_otel and mysql_input_otel test packages to add signal-specific system and policy tests, aligned with the changes in elastic/integrations#18658.

sql_server_input_otel

  • Enable test-logs-config system test with signal_types: logs, covering db.server.top_query and db.server.query_sample events with fields_present assertions aligned with upstream receiver field names (user.name instead of sqlserver.username; sqlserver.query_plan removed due to ES ignore_above limit). Uses top_query_lookback_time: 20s to match the workload's lock window.
  • Add test-metrics-config system test (skipped pending multisignal input support in elastic-package).
  • Enable log event collection in default and datasource configs so the default system test also exercises log collection alongside metrics.
  • Remove blanket fields_present from default and datasource configs — assertions are now handled per-signal config file.
  • Fix Docker workload to hold an exclusive table lock (TABLOCKX) so foreground SELECTs appear as suspended sessions in sys.dm_exec_requests, making them reliably visible to the query_sample collector.
  • Remove skip directive from all 5 existing policy tests.
  • Add test-resource-attributes policy test for the resource_attributes var.
  • Add test-logs-custom-collection policy test for non-default query-sample and top-query settings.

mysql_input_otel

  • Add test-logs-config and test-metrics-config signal-specific system tests with fields_present assertions using correct mysqlreceiver field names.
  • Add policy tests for logs and metrics enabling.
  • Restrict the default system test to a multisignal run (no signal_types filter), dropping fields_present in favour of the signal-specific configs.

Why

These tests ensure that both OTel SQL integrations collect the expected fields for each signal type, catch regressions in field naming conventions, and validate that policy rendering produces correct agent configurations for all supported configuration options.

Related


This PR was generated with the assistance of Claude (claude-sonnet-4-6).

…_otel and mysql_input_otel

sql_server_input_otel:
- Enable test-logs-config with signal_types: logs, covering
  db.server.top_query and db.server.query_sample events with
  fields_present assertions aligned with upstream receiver field names
  (user.name instead of sqlserver.username; sqlserver.query_plan removed
  due to ES ignore_above limit). Uses top_query_lookback_time: 20s to
  match the workload's 20s lock window.
- Add test-metrics-config (skipped pending multisignal input support).
- Enable log event collection in default and datasource configs so the
  default system test also exercises log collection alongside metrics.
- Remove blanket fields_present from default and datasource configs.
- Fix Docker workload to hold TABLOCKX so foreground SELECTs appear as
  suspended sessions in sys.dm_exec_requests for query_sample collector.
- Remove skip directive from all 5 existing policy tests.
- Add test-resource-attributes policy test for resource_attributes var.
- Add test-logs-custom-collection policy test for non-default query settings.

mysql_input_otel:
- Add test-logs-config and test-metrics-config signal-specific system
  tests with fields_present assertions using correct mysqlreceiver field names.
- Add policy tests for logs and metrics enabling.
- Restrict default system test to a multisignal run (no signal_types
  filter), dropping fields_present in favour of signal-specific configs.

Ref: elastic/integrations#18658 (elastic/integrations#18658)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mrodm mrodm self-assigned this Apr 28, 2026
@elasticmachine

elasticmachine commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

History

cc @mrodm

@teresaromero teresaromero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks

@mrodm
mrodm merged commit 7ba5943 into elastic:main Apr 29, 2026
5 checks passed
@mrodm
mrodm deleted the update_test_packages branch April 29, 2026 12:56
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