Skip to content
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

feat(inputs.sqlserver): Add SERVERPROPERTY(''IsHadrenabled'') #13448

Merged
merged 1 commit into from
Jun 20, 2023
Merged

feat(inputs.sqlserver): Add SERVERPROPERTY(''IsHadrenabled'') #13448

merged 1 commit into from
Jun 20, 2023

Conversation

soccypowa
Copy link
Contributor

@soccypowa soccypowa commented Jun 15, 2023

resolves #12799

Added the gathering of the serverproperty IsHadrEnabled in the sqlserver_server_properties, following the design ideas given in the issue that this pull request solves.

Did not find any tests so I ran some rudimentary tests on SQL 2014 (to my knowledge the oldest one supported by MSFT) gave the expected result according to this MSFT page.

@telegraf-tiger telegraf-tiger bot added area/sqlserver feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Jun 15, 2023
@telegraf-tiger
Copy link
Contributor

Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip.
Downloads for additional architectures and packages are available below.

🥳 This pull request decreases the Telegraf binary size by -10.79 % for linux amd64 (new size: 167.0 MB, nightly size 187.2 MB)

📦 Click here to get additional PR build artifacts

Artifact URLs

DEB RPM TAR GZ ZIP
amd64.deb aarch64.rpm darwin_amd64.tar.gz windows_amd64.zip
arm64.deb armel.rpm darwin_arm64.tar.gz windows_arm64.zip
armel.deb armv6hl.rpm freebsd_amd64.tar.gz windows_i386.zip
armhf.deb i386.rpm freebsd_armv7.tar.gz
i386.deb ppc64le.rpm freebsd_i386.tar.gz
mips.deb riscv64.rpm linux_amd64.tar.gz
mipsel.deb s390x.rpm linux_arm64.tar.gz
ppc64el.deb x86_64.rpm linux_armel.tar.gz
riscv64.deb linux_armhf.tar.gz
s390x.deb linux_i386.tar.gz
linux_mips.tar.gz
linux_mipsel.tar.gz
linux_ppc64le.tar.gz
linux_riscv64.tar.gz
linux_s390x.tar.gz

@powersj
Copy link
Contributor

powersj commented Jun 15, 2023

Thanks for the PR

@Trovalo thoughts on this addition? I thought we produce a number of other metrics if IsHadrenabled was enabled already via the sqlServerAvailabilityReplicaStates query? Could those be used to do the same?

@powersj powersj self-assigned this Jun 15, 2023
@powersj powersj added the waiting for response waiting for response from contributor label Jun 15, 2023
@Trovalo
Copy link
Collaborator

Trovalo commented Jun 16, 2023

Thanks for the PR

@Trovalo thoughts on this addition? I thought we produce a number of other metrics if IsHadrenabled was enabled already via the sqlServerAvailabilityReplicaStates query? Could those be used to do the same?

That's correct, as of now there are two queries to get data about hadr, sqlServerAvailabilityReplicaStates and sqlServerDatabaseReplicaStates.

Also, the properties just says if the feature is enabled, and that does not mean it's actually used...
Do you want to check if the feature is enabled? you can use that property...
Do you want to check if the feature is actually used? that property is not enough...

I'd query the usage and maybe check how many "Always On availability groups" I've got on the instance

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label Jun 16, 2023
@soccypowa
Copy link
Contributor Author

Maybe the use case is to local, and a custom local build is better, our use case was "how can I as a data consumer" or "how can I as a new employee" in the Grafana dashboard understand that this server is a part of AAG.

As you say the settings state does not say anything about the usage...

@srebhan
Copy link
Contributor

srebhan commented Jun 16, 2023

@soccypowa I'm not sure I fully understand your answer... To see if hadr is actually used you could just check the two mentioned metrics for indications of usage. If you want to know if hadr is enabled we can merge the PR. Just let me know which state you are aiming for...

@srebhan srebhan changed the title feat(inputs.sqlserver): Adds SERVERPROPERTY(''IsHadrenabled'') feat(inputs.sqlserver): Add SERVERPROPERTY(''IsHadrenabled'') Jun 16, 2023
@soccypowa
Copy link
Contributor Author

soccypowa commented Jun 16, 2023

@srebhan My aim is to se the setting's state. (To see usage I have the already available queries for "hadr related metrics". Which I hopefully then enabled for the correct instances).

The reason for wanting to se the setting's state is to see that it is not erroneously set where it should not, and to simplify the display for less technical users (or new employees) that this instance is part of an AAG setup.

Don't know if this is strong enough a case.

Copy link
Contributor

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

@soccypowa in this case, thank you for your contribution! Looks good to me.

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Jun 20, 2023
@powersj powersj merged commit 390751b into influxdata:master Jun 20, 2023
26 of 30 checks passed
@soccypowa soccypowa deleted the #12799-inputs.sqlserver branch June 29, 2023 08:44
@srebhan srebhan added this to the v1.28.0 milestone Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sqlserver feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[inputs.sqlserver] SERVERPROPERTY(''IsHadrenabled'')
4 participants