Repository navigation
[sql_server_input_otel][mysql_input_otel] Add system and policy tests for logs and metrics signals - #18658
Merged
Conversation
- Enable test-logs-config with signal_types: logs, covering both db.server.top_query and db.server.query_sample events - Add test-metrics-config for metrics signal validation - Remove fields_present from test-default and test-datasource configs; signal-type-specific assertions are now handled per config file - Fix workload to hold an exclusive lock (TABLOCKX) so foreground SELECTs appear as suspended sessions in sys.dm_exec_requests, making them reliably visible to the query_sample collector - Remove sqlserver.query_plan from fields_present: the XML plan content exceeds the Elasticsearch keyword ignore_above limit and lands in _ignored, making it not indexable/searchable - Replace sqlserver.username with user.name: the receiver follows ECS convention and emits user.name instead of a custom sqlserver.* field Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove skip directive from all 5 existing policy tests; the multisignal input limitation does not affect policy tests since they only validate rendered config output without running the agent - Add test-resource-attributes: exercises the resource_attributes YAML var with a mix of enabled/disabled attributes (sqlserver.computer.name, sqlserver.instance.name, server.address, host.name) - Add test-logs-custom-collection: verifies that non-default values for query_sample and top_query collection settings are correctly rendered (max_rows_per_query: 200, lookback_time: 120s, max_query_sample_count: 500, top_query_count: 100, collection_interval: 30s) - All 7 policy tests pass (elastic-package test policy -v confirmed) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add signal-specific system tests for logs (test-logs-config.yml) and metrics (test-metrics-config.yml) with fields_present assertions using the correct attribute names from the upstream mysqlreceiver documentation. Update the default system test to restrict it to the metrics signal so fields_present assertions are not drowned out by log documents. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… tests - Fix missing unit suffix: top_query_lookback_time: 60 → 60s (mysql) - Add service_notify_signal: SIGHUP to mysql test-metrics-config.yml for consistency with default and logs configs - Remove dead commented-out skip block from sql_server test-logs-config.yml - Remove sqlserver.username tombstone comment from sql_server test-logs-config.yml - Remove commented-out image: lines from sql_server docker-compose.yml (build: stanza is sufficient) - Remove trailing blank lines from sql_server test-metrics-config.yml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove the skip block from all three existing policy tests and add two new ones: test-logs-enabled exercises the top_query_collection template branch with custom collection settings, and test-metrics-enabled overrides the metrics configuration with non-default optional metrics. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The MySQL receiver expects an integer (seconds), not a duration string. Reverts the 60 → 60s change from the previous cleanup commit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Reduce top_query_lookback_time from 60s to 20s in test-logs-config.yml - Enable query_sample and top_query events in test-default-config.yml and test-datasource-config.yml, with top_query_lookback_time: 20s Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
💚 Build Succeeded
History
cc @mrodm |
|
Pinging @elastic/ecosystem (Team:Ecosystem) |
teresaromero
approved these changes
Apr 29, 2026
mrodm
added a commit
to elastic/elastic-package
that referenced
this pull request
Apr 29, 2026
…and policy tests for logs and metrics (#3508) 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. --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
herrBez
pushed a commit
to herrBez/integrations
that referenced
this pull request
Jun 1, 2026
… for logs and metrics signals (elastic#18658) Add signal-specific system tests and policy tests for logs and metrics to the sql_server_input_otel and mysql_input_otel packages. --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed commit message
Add signal-specific system tests and policy tests to the
sql_server_input_otelandmysql_input_otelintegrations.WHAT:
sql_server_input_otel
test-logs-configwithsignal_types: logs, covering bothdb.server.top_queryanddb.server.query_sampleevents, includingfields_presentassertions aligned with the upstream receiver's field names (user.nameinstead ofsqlserver.username;sqlserver.query_planremoved due to the value exceeding the ESignore_abovekeyword limit). Usestop_query_lookback_time: 20sto match the workload's 20s lock window.test-metrics-config(currently skipped pending multisignal input support in elastic-package).enable_query_sample_events,enable_top_query_events,top_query_lookback_time: 20s) in the default and datasource configs so the default system test also exercises log collection alongside metrics.fields_presentfrom the default and datasource configs — assertions are now handled per-signal config file.TABLOCKX) so foregroundSELECTs appear as suspended sessions insys.dm_exec_requests, making them reliably visible to thequery_samplecollector.skipdirective from all 5 existing policy tests (the multisignal input limitation does not affect policy tests).test-resource-attributespolicy test: exercises theresource_attributesYAML var with a mix of enabled/disabled attributes.test-logs-custom-collectionpolicy test: verifies non-default values for query-sample and top-query collection settings are correctly rendered.mysql_input_otel
test-logs-configandtest-metrics-configsignal-specific system tests withfields_presentassertions using correct attribute names from the upstreammysqlreceiverdocumentation.signal_typesfilter), droppingfields_presentin 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.
Checklist
I have verified that all data streams collect metrics or logs.I have added an entry to my package'schangelog.ymlfile.I have verified that any added dashboard complies with Kibana's Dashboard good practicesAuthor's Checklist
sql_server_input_otelandmysql_input_otelpass (elastic-package test policy -v)sql_server_input_otelandmysql_input_otelpass (elastic-package test system -v)How to test this PR locally
Related issues