New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable direct connection to SQL Server instance #30297
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Pinging code owners for receiver/sqlquery: @dmitryax @pmcollins. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This makes sense to me. I would prefer that we not depend directly on another receiver though, and instead take the approach where we move common code to a shared package. |
…30709) **Description:** As noted in the related issues, a lot of the logic in the sqlquery receiver can be moved to a central package to be used by other receivers. I realize this appears to be a large change, but it's purely a re-organization PR, there's no functional changes. GitHub is not recognizing moved files, so please refer to new file names and their deleted counterparts. A lot of members are now public in the internal package that were private in the receiver which is likely what's causing GitHub to miss that they're just moved files. This doesn't require a changelog (in my mind) because all things moving were originally private to the receiver. They're now still purely internal, so they won't be published. I believe `internal` is the best destination for now as it allows us to solidify the usage and interface before moving it to `pkg` to be publicly available. There are still a lot of unknowns as far as how it can be used by other receivers, so I fully expect "breaking changes" to this. If we keep it internal we can update all usages with the changing interface, so the changes won't be breaking. **Link to tracking Issue:** #30297, #13546
…pen-telemetry#30709) **Description:** As noted in the related issues, a lot of the logic in the sqlquery receiver can be moved to a central package to be used by other receivers. I realize this appears to be a large change, but it's purely a re-organization PR, there's no functional changes. GitHub is not recognizing moved files, so please refer to new file names and their deleted counterparts. A lot of members are now public in the internal package that were private in the receiver which is likely what's causing GitHub to miss that they're just moved files. This doesn't require a changelog (in my mind) because all things moving were originally private to the receiver. They're now still purely internal, so they won't be published. I believe `internal` is the best destination for now as it allows us to solidify the usage and interface before moving it to `pkg` to be publicly available. There are still a lot of unknowns as far as how it can be used by other receivers, so I fully expect "breaking changes" to this. If we keep it internal we can update all usages with the changing interface, so the changes won't be breaking. **Link to tracking Issue:** open-telemetry#30297, open-telemetry#13546
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
**Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Add a query for the database IO metrics that SQL Server exposes. Read more about available metrics [here](https://learn.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-io-virtual-file-stats-transact-sql?view=sql-server-ver16). This is a no-op update as this query will not be used until direct connection to the SQL Server instance is fully implemented. This is simply part of the effort. **Note:** This code is currently not reached. This is on purpose. **Link to tracking Issue:** <Issue number if applicable> This was originally part of #31915, but I'm breaking this out to make the original PR a more manageable size. #30297 **Testing:** <Describe what testing was performed and which tests were added.> Existing tests and added tests are passing. **Documentation:** <Describe the documentation added.> Purposefully none: This is currently dead code until all of #31915 gets merged, so it shouldn't be used.
…etry#32178) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Add a query for the database IO metrics that SQL Server exposes. Read more about available metrics [here](https://learn.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-io-virtual-file-stats-transact-sql?view=sql-server-ver16). This is a no-op update as this query will not be used until direct connection to the SQL Server instance is fully implemented. This is simply part of the effort. **Note:** This code is currently not reached. This is on purpose. **Link to tracking Issue:** <Issue number if applicable> This was originally part of open-telemetry#31915, but I'm breaking this out to make the original PR a more manageable size. open-telemetry#30297 **Testing:** <Describe what testing was performed and which tests were added.> Existing tests and added tests are passing. **Documentation:** <Describe the documentation added.> Purposefully none: This is currently dead code until all of open-telemetry#31915 gets merged, so it shouldn't be used.
) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> This adds config options for direct connection to a SQL server instance. For the sake of PR size, this adds no functionality, it's simply config options and validation. **Link to tracking Issue:** <Issue number if applicable> This was originally part of #31915, but I'm breaking this out to make the original PR a more manageable size. #30297 **Testing:** <Describe what testing was performed and which tests were added.> Existing tests and added tests are all passing. **Documentation:** <Describe the documentation added.> No documentation on purpose. The added config options currently have no impact on functionality, so users shouldn't be aware of this, and shouldn't try to use them yet.
…32471) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> A major part of #31915 is adding support for other operating systems than Windows. This change moves Windows-specific logic into files named as such, and renames some specific functionality to match purpose, instead of generic names. `newSQLServerScraper` -> `newSQLServerPCScraper` (PC in this context stands for performance counters) `sqlServerScraper` -> `sqlServerPCScraper`` This only renames internal functions and files, there's no user-facing impact of this. **Link to tracking Issue:** <Issue number if applicable> #31915 #30297 **Testing:** <Describe what testing was performed and which tests were added.> Existing tests are passing.
…tems (#32542) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> This change enables the SQL Server receiver to directly connect to SQL Server instances, and to run on operating systems other than Windows. This is part of #31915, but doesn't add any functionality for the end user. No metrics are currently being gathered from SQL server instances, to make the PR (hopefully) simpler to review. **Link to tracking Issue:** <Issue number if applicable> #31915 #30297 **Testing:** <Describe what testing was performed and which tests were added.> Tests added are passing.
…#31915) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> This PR enables direct connection to SQL Server instances, and also allows the SQL Server receiver to run on non-Windows platforms. User-facing changes: 1. More (optional) configuration options. If the receiver wants to connect directly to the SQL Server instance (rather than relying on Windows Performance Counters), all of these options must be specified. 2. Add a new metric, `sqlserver.database_io.read_latency`. This is disabled by default, and way randomly chosen as a single metric to try to restrict this PR's size. I plan on following this PR up with more metrics from the same query, as well as more queries and metrics. Note: Existing users should see no change in functionality with this PR. Using existing configurations with this PR should have no performance or functional impact. **Link to tracking Issue:** <Issue number if applicable> Resolves #30297 **Testing:** <Describe what testing was performed and which tests were added.> Tested on MacOS and Windows. Manual tested with direct connection to a docker container on both platforms, as well as ran all tests in package. Everything is passing. **Working demo for testing:** Docker container start command: ``` docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=StrongPassw0rd" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2022-latest ``` Collector config: ``` sqlserver: password: "StrongPassw0rd" port: 1433 server: 0.0.0.0 username: sa resource_attributes: sqlserver.instance.name: enabled: true sqlserver.computer.name: enabled: true metrics: sqlserver.database_io.read_latency: enabled: true ``` **Documentation:** <Describe the documentation added.> Updated README
… OS (#32878) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> With the enhancement in #30297, the SQL Server receiver can now run on MacOS and Linux, since it no longer solely relies on Windows. The difference in functionality has (hopefully) been documented clearly between the different platforms, so the unsupported warning can be removed. I missed this in my previous PRs.
…etry#32178) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Add a query for the database IO metrics that SQL Server exposes. Read more about available metrics [here](https://learn.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-io-virtual-file-stats-transact-sql?view=sql-server-ver16). This is a no-op update as this query will not be used until direct connection to the SQL Server instance is fully implemented. This is simply part of the effort. **Note:** This code is currently not reached. This is on purpose. **Link to tracking Issue:** <Issue number if applicable> This was originally part of open-telemetry#31915, but I'm breaking this out to make the original PR a more manageable size. open-telemetry#30297 **Testing:** <Describe what testing was performed and which tests were added.> Existing tests and added tests are passing. **Documentation:** <Describe the documentation added.> Purposefully none: This is currently dead code until all of open-telemetry#31915 gets merged, so it shouldn't be used.
…n-telemetry#32176) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> This adds config options for direct connection to a SQL server instance. For the sake of PR size, this adds no functionality, it's simply config options and validation. **Link to tracking Issue:** <Issue number if applicable> This was originally part of open-telemetry#31915, but I'm breaking this out to make the original PR a more manageable size. open-telemetry#30297 **Testing:** <Describe what testing was performed and which tests were added.> Existing tests and added tests are all passing. **Documentation:** <Describe the documentation added.> No documentation on purpose. The added config options currently have no impact on functionality, so users shouldn't be aware of this, and shouldn't try to use them yet.
…pen-telemetry#32471) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> A major part of open-telemetry#31915 is adding support for other operating systems than Windows. This change moves Windows-specific logic into files named as such, and renames some specific functionality to match purpose, instead of generic names. `newSQLServerScraper` -> `newSQLServerPCScraper` (PC in this context stands for performance counters) `sqlServerScraper` -> `sqlServerPCScraper`` This only renames internal functions and files, there's no user-facing impact of this. **Link to tracking Issue:** <Issue number if applicable> open-telemetry#31915 open-telemetry#30297 **Testing:** <Describe what testing was performed and which tests were added.> Existing tests are passing.
…tems (open-telemetry#32542) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> This change enables the SQL Server receiver to directly connect to SQL Server instances, and to run on operating systems other than Windows. This is part of open-telemetry#31915, but doesn't add any functionality for the end user. No metrics are currently being gathered from SQL server instances, to make the PR (hopefully) simpler to review. **Link to tracking Issue:** <Issue number if applicable> open-telemetry#31915 open-telemetry#30297 **Testing:** <Describe what testing was performed and which tests were added.> Tests added are passing.
…open-telemetry#31915) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> This PR enables direct connection to SQL Server instances, and also allows the SQL Server receiver to run on non-Windows platforms. User-facing changes: 1. More (optional) configuration options. If the receiver wants to connect directly to the SQL Server instance (rather than relying on Windows Performance Counters), all of these options must be specified. 2. Add a new metric, `sqlserver.database_io.read_latency`. This is disabled by default, and way randomly chosen as a single metric to try to restrict this PR's size. I plan on following this PR up with more metrics from the same query, as well as more queries and metrics. Note: Existing users should see no change in functionality with this PR. Using existing configurations with this PR should have no performance or functional impact. **Link to tracking Issue:** <Issue number if applicable> Resolves open-telemetry#30297 **Testing:** <Describe what testing was performed and which tests were added.> Tested on MacOS and Windows. Manual tested with direct connection to a docker container on both platforms, as well as ran all tests in package. Everything is passing. **Working demo for testing:** Docker container start command: ``` docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=StrongPassw0rd" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2022-latest ``` Collector config: ``` sqlserver: password: "StrongPassw0rd" port: 1433 server: 0.0.0.0 username: sa resource_attributes: sqlserver.instance.name: enabled: true sqlserver.computer.name: enabled: true metrics: sqlserver.database_io.read_latency: enabled: true ``` **Documentation:** <Describe the documentation added.> Updated README
… OS (open-telemetry#32878) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> With the enhancement in open-telemetry#30297, the SQL Server receiver can now run on MacOS and Linux, since it no longer solely relies on Windows. The difference in functionality has (hopefully) been documented clearly between the different platforms, so the unsupported warning can be removed. I missed this in my previous PRs.
…open-telemetry#31915) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> This PR enables direct connection to SQL Server instances, and also allows the SQL Server receiver to run on non-Windows platforms. User-facing changes: 1. More (optional) configuration options. If the receiver wants to connect directly to the SQL Server instance (rather than relying on Windows Performance Counters), all of these options must be specified. 2. Add a new metric, `sqlserver.database_io.read_latency`. This is disabled by default, and way randomly chosen as a single metric to try to restrict this PR's size. I plan on following this PR up with more metrics from the same query, as well as more queries and metrics. Note: Existing users should see no change in functionality with this PR. Using existing configurations with this PR should have no performance or functional impact. **Link to tracking Issue:** <Issue number if applicable> Resolves open-telemetry#30297 **Testing:** <Describe what testing was performed and which tests were added.> Tested on MacOS and Windows. Manual tested with direct connection to a docker container on both platforms, as well as ran all tests in package. Everything is passing. **Working demo for testing:** Docker container start command: ``` docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=StrongPassw0rd" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2022-latest ``` Collector config: ``` sqlserver: password: "StrongPassw0rd" port: 1433 server: 0.0.0.0 username: sa resource_attributes: sqlserver.instance.name: enabled: true sqlserver.computer.name: enabled: true metrics: sqlserver.database_io.read_latency: enabled: true ``` **Documentation:** <Describe the documentation added.> Updated README
… OS (open-telemetry#32878) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> With the enhancement in open-telemetry#30297, the SQL Server receiver can now run on MacOS and Linux, since it no longer solely relies on Windows. The difference in functionality has (hopefully) been documented clearly between the different platforms, so the unsupported warning can be removed. I missed this in my previous PRs.
Component(s)
receiver/sqlserver
Is your feature request related to a problem? Please describe.
The existing implementation of the SQL Server receiver only collects information from Windows Performance counters. This was by design with the introduction of the receiver, as this solution provided good value for the amount of effort required (source). The main limitation was noted in the proposal as there would be metrics not covered by this solution, but it was acceptable at the time (source).
At this time there are two main drawbacks with the receiver's functionality:
Describe the solution you'd like
I want the sqlserver receiver to be able to run in all environments supported by SQL server itself, as well as scraping more metrics that can help users understand the status of the SQL server instances.
My proposed solution would be to add the sqlquery receiver as an internal dependency of the sqlserver receiver. The sqlserver receiver could expose metrics to the user as it does now, but internally rely on the sqlquery receiver to send the queries that would give metrics we want. This would require the addition of more configuration options for connection to the DB, as well as defining the metrics and queries we want.
Adding a receiver as a dependency of another may not be the best design, so a possible answer to this may also involve moving some sqlquery receiver logic into a central package as suggested here. This would allow re-using the same logic in multiple places without duplicating code.
Describe alternatives you've considered
Additional context
No response
The text was updated successfully, but these errors were encountered: