Skip to content

Add SQL Server OTel input package#17429

Merged
teresaromero merged 15 commits intoelastic:mainfrom
teresaromero:17152-sql-server-input-otel
Feb 25, 2026
Merged

Add SQL Server OTel input package#17429
teresaromero merged 15 commits intoelastic:mainfrom
teresaromero:17152-sql-server-input-otel

Conversation

@teresaromero
Copy link
Copy Markdown
Contributor

@teresaromero teresaromero commented Feb 16, 2026

Proposed commit message

Add SQL Server OpenTelemetry input package (sql_server_input_otel).

WHAT: New input package that enables collection of SQL Server metrics and logs using the OpenTelemetry Collector's sqlserverreceiver. The package provides configuration for:

  • Connection settings: server, port, username, password, or an ADO connection string (datasource) as an alternative
  • Instance settings: instance_name, computer_name
  • Collection settings: interval, initial delay
  • Log events (disabled by default):
    • Query Sample Events (db.server.query_sample) with configurable max_rows_per_query
    • Top Query Events (db.server.top_query) with configurable lookback time, max sample count, query count, and collection interval
  • Resource attributes and metrics toggles via YAML configuration

Includes Docker test environment (MSSQL 2019 with workload generator), 5 policy test scenarios (default, default-vars, datasource, logs-enabled, metrics-enabled), 3 system test configs (default, datasource, logs), input template (input.yml.hbs) with both metrics and logs pipelines, manifest (format_version: 3.6.0, Kibana ^9.4.0), docs, changelog, and CODEOWNERS entry.

WHY: To allow users to collect SQL Server metrics and logs via the Elastic Agent with the EDOT Collector using the standard OpenTelemetry SQL Server receiver, with a supported input package.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices (N/A — no dashboards)

Author's Checklist

  • elastic-package lint passes locally
  • Policy test files (test-default, test-default-vars, test-datasource, test-logs-enabled, test-metrics-enabled) and expected outputs are included
  • System test configs for default, datasource, and logs scenarios
  • Docker test environment with MSSQL 2019 and workload generator
  • CODEOWNERS entry for @elastic/ecosystem
  • Logs collection tested manually; system tests for multi-signal input packages are still pending implementation in elastic-package

How to test this PR locally

  1. Clone and check out this branch
  2. Run elastic-package lint from the package directory:
    cd packages/sql_server_input_otel
    elastic-package lint
    
  3. To run policy tests:
    elastic-package stack up -v -d
    elastic-package test policy
    
  4. To run system tests (requires a running Elastic Stack and Docker for MSSQL):
    elastic-package stack up -v -d
    elastic-package test system
    

Related issues

Screenshots

Screenshot 2026-02-20 at 11 17 30

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>
@teresaromero teresaromero requested a review from a team as a code owner February 16, 2026 14:11
@teresaromero teresaromero added the enhancement New feature or request label Feb 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 16, 2026

✅ Vale Linting Results

No issues found on modified lines!


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.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

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:

  1. Changelog link should reference this PR (#17429), not the related issue
  2. 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.

Comment thread packages/sql_server_input_otel/changelog.yml Outdated
@teresaromero
Copy link
Copy Markdown
Contributor Author

@claude address pr review comments and vale linting suggestions. Include the package and codeowner into the .CODEOWNERS file

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 16, 2026

Claude finished @teresaromero's task in 1m 21s —— View job


Addressing PR Review Comments and Vale Linting

All requested changes have been addressed and pushed:

  • Fix Vale linting suggestions (replace "in order to" with "to" in both README files)
  • Fix changelog link to point to PR Add SQL Server OTel input package #17429 instead of issue Create Input Package: SQL Server receiver #17152
  • Add service: field to system test config for docker-compose integration
  • Add CODEOWNERS entry for /packages/sql_server_input_otel with @elastic/ecosystem (matching the pattern used by other OTel input packages)
  • Commit and push changes

Changes committed in 207b7bd.


Why is Claude responding? | Type @claude to interact further

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
|

github-actions Bot added a commit that referenced this pull request Feb 16, 2026
- 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>
Comment thread packages/sql_server_input_otel/agent/input/input.yml.hbs Outdated
Comment thread packages/sql_server_input_otel/img/sql_server_otellogo.svg
- 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>
@teresaromero teresaromero marked this pull request as draft February 16, 2026 15:47
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

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 build

to 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.

Comment thread packages/sql_server_input_otel/_dev/build/docs/README.md
- 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>
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

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.

Comment thread packages/sql_server_input_otel/manifest.yml
@andrewkroh andrewkroh added New Integration Issue or pull request for creating a new integration package. documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. labels Feb 16, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

The two critical blocking issues from prior reviews remain unresolved:

  1. manifest.yml:30 - dynamic_signal_types: true is not a valid field in the package specification. elastic-package build fails with: Additional property dynamic_signal_types is not allowed. Remove this field.

  2. _dev/build/docs/README.md - The Logs reference section exists in docs/README.md but is missing from the source file _dev/build/docs/README.md. Copy the Logs reference section to the source file, then run elastic-package build to 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.

… options and documentation updates

- Updated manifest to include additional settings for query sample and top query collection, specifying their applicability.
- Added metrics configuration options to the input YAML template.
- Expanded documentation to detail the new log event types and their configurations.
- Introduced expected test files for scenarios with metrics enabled.
…tation. Updated policy templates to include new 'datasource' field for connection strings, improved descriptions for connection settings, and added resource attributes configuration. Updated README to reflect new features and known limitations regarding resource attributes. Adjusted Dockerfile healthcheck command for better error handling. Added new test cases for datasource configuration and default variables.
- Introduced `init.sh` for database setup and initialization.
- Added `workload.sh` for generating database workload.
- Updated `Dockerfile` to include new scripts and modified healthcheck logic.
- Enhanced `docker-compose.yml` to define a new service for workload generation with health checks.
- Created `test-logs-config.yml` for system testing with relevant configurations.
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Found one issue that will cause incorrect runtime behavior:

top_query_lookback_time type mismatch: The manifest defines this as type: integer with default 60, but the upstream SQL Server receiver's lookback_time field is time.Duration. When parsed, integer 60 will be interpreted as 60 nanoseconds, not 60 seconds. Change to type: duration with default 60s.

Note: The expected test outputs will also need updating after this fix.


Why is Claude responding? | Type @claude to interact further

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

Comment thread packages/sql_server_input_otel/manifest.yml
…Changed wording from "disabled by default" to "turned off by default" for better clarity.
…configurations. Adjusted component IDs for logs and metrics to ensure correct mapping in policy templates.
@teresaromero teresaromero marked this pull request as ready for review February 20, 2026 13:58
@teresaromero teresaromero requested a review from a team February 24, 2026 11:52
@teresaromero
Copy link
Copy Markdown
Contributor Author

ping to @elastic/obs-infraobs-integrations so they can take a look

Comment thread packages/sql_server_input_otel/_dev/test/system/test-logs-config.yml Outdated
@@ -0,0 +1,13 @@
service: sql_server_input_otel
vars:
datasource: "sqlserver://SA:1234_asdf@{{Hostname}}:{{Port}}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As this field could contain potentially the password in the string, should it be considered as a possible field to be secret too?

Comment thread packages/sql_server_input_otel/_dev/build/docs/README.md Outdated
@@ -0,0 +1,173 @@
format_version: 3.6.0
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As a note, no stable versions (1.x.y) of this package could be released until this spec version as it is released. If it is tried to do so, this error will be raised when building the package:

package with GA version (1.0.0) is using an unreleased version of the spec (3.6.0-next)

Comment thread packages/sql_server_input_otel/sample_event.json Outdated
…field in the manifest with a note on future changes regarding secret handling. Clarified connection requirements in the README to specify the use of either individual connection settings or a datasource connection string.
…from 1 to 10, enhancing test coverage for SQL Server Input.
@elasticmachine
Copy link
Copy Markdown

💚 Build Succeeded

History

Copy link
Copy Markdown
Collaborator

@mrodm mrodm left a comment

Choose a reason for hiding this comment

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

LGTM

@teresaromero teresaromero merged commit 516715c into elastic:main Feb 25, 2026
11 checks passed
@andrewkroh andrewkroh added the Integration:sql_server_input_otel SQL Server OpenTelemetry Input Package label Feb 25, 2026
@elastic-vault-github-plugin-prod
Copy link
Copy Markdown

Package sql_server_input_otel - 0.1.0 containing this change is available at https://epr.elastic.co/package/sql_server_input_otel/0.1.0/

navnit-elastic pushed a commit to navnit-elastic/integrations that referenced this pull request Mar 2, 2026
* Add SQL Server OTel input package

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>

* Address PR review comments and Vale linting suggestions

- 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>

* Enhance SQL Server OpenTelemetry input package

- 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>

* Enhance SQL Server OpenTelemetry input package with log support

- 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>

* Update SQL Server OpenTelemetry input package manifest to version 3.6.0

* Enhance SQL Server OpenTelemetry input package with new configuration options and documentation updates

- Updated manifest to include additional settings for query sample and top query collection, specifying their applicability.
- Added metrics configuration options to the input YAML template.
- Expanded documentation to detail the new log event types and their configurations.
- Introduced expected test files for scenarios with metrics enabled.

* Enhance SQL Server Input integration by updating manifest and documentation. Updated policy templates to include new 'datasource' field for connection strings, improved descriptions for connection settings, and added resource attributes configuration. Updated README to reflect new features and known limitations regarding resource attributes. Adjusted Dockerfile healthcheck command for better error handling. Added new test cases for datasource configuration and default variables.

* Add SQL Server Input workload and initialization scripts

- Introduced `init.sh` for database setup and initialization.
- Added `workload.sh` for generating database workload.
- Updated `Dockerfile` to include new scripts and modified healthcheck logic.
- Enhanced `docker-compose.yml` to define a new service for workload generation with health checks.
- Created `test-logs-config.yml` for system testing with relevant configurations.

* Update SQL Server Input documentation to clarify log event settings. Changed wording from "disabled by default" to "turned off by default" for better clarity.

* Update SQL Server Input expected test files to swap metrics and logs configurations. Adjusted component IDs for logs and metrics to ensure correct mapping in policy templates.

* Update sample_event.json for SQL Server Input

* Update SQL Server Input manifest and documentation. Added a 'secret' field in the manifest with a note on future changes regarding secret handling. Clarified connection requirements in the README to specify the use of either individual connection settings or a datasource connection string.

* Update test-logs-config.yml to increase minimum count for assertions from 1 to 10, enhancing test coverage for SQL Server Input.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Tere <teresaromero@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. enhancement New feature or request Integration:sql_server_input_otel SQL Server OpenTelemetry Input Package New Integration Issue or pull request for creating a new integration package.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Input Package: SQL Server receiver

4 participants