-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
New sql server queries (on-prem) - refactoring and formatting #8172
New sql server queries (on-prem) - refactoring and formatting #8172
Conversation
That predates my time :)... I am not a big fan of the whole joining with workload groups/pools section as should have been just native perf counters ( not manufactured perf counters). Yes seems like join can be eliminated, in all honesty there are counters for workload groups so perhaps is there only for older versions - I left it there for back compat as didn't have context on why it was added. |
You are right, there are already counters about that, even in SQL 2008. (some sample data below)
I agree on having only native perf counter so I'll make a PR to remove that section for the new query. To me that's it, at least for this PR. I'll make some more PRs to remove some sections (the one cited above) or add a few fields. @denzilribeiro I'd like you to have a quick look at it and if everything's looks fine just approve the changes. As usual I've tested this queries on SQL 2008 to 2019 and everything looks fine. |
fine by me. We can merge whenever you're ready. |
Just one more info from @denzilribeiro before merging I've run some additional tests with
The same is valid also for Managed Instance Now that there is the check based on engine edition, when the schedulers query is called from any Azure edition an error is returned. --THis is the check
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - the instance "'+ @@SERVERNAME +'" is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
RAISERROR (@ErrorMessage,11,1)
RETURN
END How do you want to address this kind of issue? the query itself is fully compatible but I'm not sure it's a good idea to reference the on-prem query from the azure section.
|
@Trovalo thanks for catching it, I would make a clone follow the same pattern rather than mixing/matching.. . Was a huge PR and I missed it :(, updated one part but not the other. |
I'm done. @denzilribeiro you are free to check whenever you want |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this I would modify the throw of error message to include Database name and server name as logical server on Azure DB can have a ton of databases so won't be able to identify which connection string is incorrectly classified
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:"'+ @@SERVERNAME + ',Database:' + DB_NAME() +'" is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've edited the error message to include the Database name.
I've also removed some DEADLOCK_PRIORITY (where only dmv were referenced), it is now used only in DatabaseIO and PerfCounters queries
@ssoroka can you merge this? |
Looks like there's conflicts with the other merge. |
I was aware of a possible confilict, I'll manage it later or tomorrow.
…On Wed, 7 Oct 2020, 17:56 Steven Soroka, ***@***.***> wrote:
Looks like there's conflicts with the other merge.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8172 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC5J5KWOEZ4DQIB3FVGLSZTSJSFULANCNFSM4RW74YWQ>
.
|
@ssoroka I've fixed the conflict |
@ssoroka can you merge this? I'd like it to be present in the next release of Telegraf. |
Required for all PRs:
This PR affects only the SQL Server on-prem queries (database_type = "SQLServer"), a different PR can be opened for the Azure queries (if this is approved).
The PR does not contain any breaking change, the output is the same as before (with minor fixes)
This PR contains:
DB_NAME() as [database_name]
An additional not breaking fix can be made in the PerfCounters query. on line 436.
this table is joined, but no data is fetched from it. @denzilribeiro, to me this join can be removed, can you confirm? do you have ideas about why it was there?