Add SQL Server OTel input package#17429
Conversation
Add SQL Server OpenTelemetry input package (sql_server_input_otel). WHAT: New input package that enables collection of SQL Server metrics using the OpenTelemetry Collector's sqlserverreceiver. The package provides configuration support for the receiver: connection settings (server, port, username, password), instance settings (instance_name, computer_name), collection settings (interval, initial delay), query sample collection, and top query collection. Includes Docker test environment (MSSQL 2019), policy tests, system test (skipped for CI), input template (input.yml.hbs), manifest, docs, and changelog. WHY: To allow users to collect SQL Server metrics via the Elastic Agent with the EDOT Collector using the standard OpenTelemetry SQL Server receiver, with a supported input package. Co-authored-by: Cursor <cursoragent@cursor.com>
Vale Linting ResultsSummary: 1 suggestion found 💡 Suggestions (1)
The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale. |
There was a problem hiding this comment.
The package looks well-structured and follows the OTel input package conventions. The linter passes and policy test configurations appear correct.
Two minor items flagged via inline comments:
- Changelog link should reference this PR (#17429), not the related issue
- System test config may need the
service:field for proper docker-compose integration
Why is Claude responding? | Type @claude to interact further
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
|
@claude address pr review comments and vale linting suggestions. Include the package and codeowner into the .CODEOWNERS file |
|
Claude finished @teresaromero's task in 1m 21s —— View job Addressing PR Review Comments and Vale LintingAll requested changes have been addressed and pushed:
Changes committed in Why is Claude responding? | Type Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
- Fix Vale linting: replace "in order to" with "to" in README docs - Update changelog link to reference PR #17429 instead of issue #17152 - Add service field to system test config for docker-compose integration - Add CODEOWNERS entry for sql_server_input_otel package (@elastic/ecosystem) Co-authored-by: Tere <teresaromero@users.noreply.github.com>
- Fix Vale linting: replace "in order to" with "to" in README docs - Update changelog link to reference PR elastic#17429 instead of issue elastic#17152 - Add service field to system test config for docker-compose integration - Add CODEOWNERS entry for sql_server_input_otel package (@elastic/ecosystem) Co-authored-by: Tere <teresaromero@users.noreply.github.com>
| pipelines: | ||
| metrics: |
There was a problem hiding this comment.
This receiver also produces logs https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/sqlserverreceiver#logs
Would it be required to include that other signal here too?
- Updated the description to include log collection capabilities. - Bumped Kibana version requirement from 9.2.0 to 9.4.0. - Added configuration options for enabling query sample and top query events. - Updated policy templates and test configurations to support new log event features. - Enhanced documentation to reflect the new log collection capabilities. Co-authored-by: Tere <teresaromero@users.noreply.github.com>
There was a problem hiding this comment.
The elastic-package lint command fails due to a mismatch between docs/README.md and its source file _dev/build/docs/README.md. The Logs reference section was added to docs/README.md directly, but it should be in _dev/build/docs/README.md (the source), then regenerated via elastic-package build.
After applying the suggested fix, run:
elastic-package buildto regenerate docs/README.md from the source template.
Note: The unresolved thread on input.yml.hbs regarding logs pipeline appears to be addressed—the logs pipeline is now included in both the template and expected outputs.
Why is Claude responding? | Type @claude to interact further
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
|
|
||
| ## Metrics reference | ||
|
|
||
| For a complete list of all available metrics and their detailed descriptions, refer to the [SQL Server Receiver documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/sqlserverreceiver/documentation.md) in the upstream OpenTelemetry Collector repository. |
There was a problem hiding this comment.
🔴 CRITICAL Missing Logs reference section causes lint failure
Why: elastic-package lint fails because docs/README.md has content not in the source file. The Logs reference section should be in _dev/build/docs/README.md, not docs/README.md (which is auto-generated).
| For a complete list of all available metrics and their detailed descriptions, refer to the [SQL Server Receiver documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/sqlserverreceiver/documentation.md) in the upstream OpenTelemetry Collector repository. | |
| For a complete list of all available metrics and their detailed descriptions, refer to the [SQL Server Receiver documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/sqlserverreceiver/documentation.md) in the upstream OpenTelemetry Collector repository. | |
| ## Logs reference | |
| The SQL Server receiver can collect log events when a direct database connection is configured. Two event types are available, both disabled by default: | |
| - **Query Sample Events** (`db.server.query_sample`): Captures currently executing queries at scrape time, including session details, wait information, and resource consumption. Enable by setting **Enable Query Sample Events** to `true`. | |
| - **Top Query Events** (`db.server.top_query`): Captures the most expensive queries by execution time within a configurable lookback window, including execution counts, CPU time, and logical reads. Enable by setting **Enable Top Query Events** to `true`. | |
| Both event types require a direct database connection (server, port, username, and password must be configured). The `query_sample_collection` and `top_query_collection` settings control the behavior of each event type. | |
| For a complete list of log attributes, refer to the [SQL Server Receiver logs documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/sqlserverreceiver/logs-documentation.md) in the upstream OpenTelemetry Collector repository. |
Why is Claude responding? | Type @claude to interact further
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
- Added dynamic signal types to the manifest for improved configuration. - Updated policy tests to include new log statement configurations for SQL Server metrics. - Enhanced expected output permissions to accommodate log collection capabilities. Co-authored-by: Tere <teresaromero@users.noreply.github.com>
There was a problem hiding this comment.
In addition to the existing unresolved thread about the missing Logs reference section in _dev/build/docs/README.md, I found a build-blocking issue:
The dynamic_signal_types: true field in the manifest is invalid. Running elastic-package build fails with:
Error: building package failed: invalid content found in built zip package: found 1 validation error:
1. file "manifest.yml" is invalid: field policy_templates.0: Additional property dynamic_signal_types is not allowed
This field does not exist in the package specification and is not used by any other package in the repository. It should be removed or replaced with valid fields.
Note: The @mrodm comment about logs support in input.yml.hbs appears to have been addressed — the logs pipeline is now included in lines 39-41.
Why is Claude responding? | Type @claude to interact further
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
| description: Collect SQL Server metrics using OpenTelemetry Collector | ||
| input: otelcol | ||
| template_path: input.yml.hbs | ||
| dynamic_signal_types: true |
There was a problem hiding this comment.
🔴 CRITICAL Invalid manifest field causes build failure
Why: elastic-package build fails with 'Additional property dynamic_signal_types is not allowed'. This field does not exist in the package specification and no other packages use it.
| dynamic_signal_types: true | |
| template_path: input.yml.hbs | |
| vars: |
Why is Claude responding? | Type @claude to interact further
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
💔 Build Failed
Failed CI StepsHistory
|
There was a problem hiding this comment.
The two critical blocking issues from prior reviews remain unresolved:
-
manifest.yml:30 -
dynamic_signal_types: trueis not a valid field in the package specification.elastic-package buildfails with:Additional property dynamic_signal_types is not allowed. Remove this field. -
_dev/build/docs/README.md - The Logs reference section exists in
docs/README.mdbut is missing from the source file_dev/build/docs/README.md. Copy the Logs reference section to the source file, then runelastic-package buildto regenerate.
Note: The review thread on input.yml.hbs regarding logs support appears to have been addressed—the logs pipeline is now included (lines 39-41). Consider replying to that thread to mark it resolved.
Why is Claude responding? | Type @claude to interact further
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
Proposed commit message
Add SQL Server OpenTelemetry input package (sql_server_input_otel).
WHAT: New input package that enables collection of SQL Server metrics using the OpenTelemetry Collector's sqlserverreceiver. The package provides configuration support for the receiver: connection settings (server, port, username, password), instance settings (instance_name, computer_name), collection settings (interval, initial delay), query sample collection, and top query collection. Includes Docker test environment (MSSQL 2019), policy tests, system test (skipped for CI), input template (input.yml.hbs), manifest, docs, and changelog.
WHY: To allow users to collect SQL Server metrics via the Elastic Agent with the EDOT Collector using the standard OpenTelemetry SQL Server receiver, with a supported input package.
Checklist
changelog.ymlfile.Author's Checklist
elastic-package lintpasses locallySystem test is skipped with reason (SQL Server licensing in CI)@elastic/ecosystem(to be added separately or by maintainers)How to test this PR locally
elastic-package lintfrom thepackages/sql_server_input_oteldirectory:System tests are skipped by default since SQL Server requires a licensed container.Related issues
Screenshots
N/A - This is an input-only package with no dashboards.
Made with Cursor