-
Notifications
You must be signed in to change notification settings - Fork 175
feat: sp_HumanEvents Add Wildcard Support, A Few Fixes, And Event Type Check Handling
#641
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
base: dev
Are you sure you want to change the base?
Conversation
d9c3e44 to
8f9392c
Compare
sp_HumanEvents Add Wildcard Support, A Few Fixes, And Event Type Check Handling
1f70055 to
bf10daa
Compare
I don't understand why this is a parameter and not a local variable that's set internally when a percent sign is present in a wildcard searchable parameter.
I don't know what you're asking here. If there are any major bugs with this, I'll likely pull out the changes and assign the issue to you. You will effectively own this feature.
I guess? It's difficult to gauge what use cases users will want for this. It might be good enough as-is. Someone might ask for it later.
If there's a percent, we shouldn't bother with exact matches. Just get a count of wildcard matches and bail if it's zero. It should be a different code path.
I don't understand this one at all. Can you clarify?
Yes, but I don't generally have a use for this feature on my own. Again, it comes down to how people end up using it. But there should be an explicit check for people trying to use a wildcard here and some sort of message raised to note it's not supported.
No, I have not tested or reviewed any of the actual code here. I'm not sure when I'll have time to. What is the error?
No, not at all. There are many blocking events that occur on system objects that are valid to look at. |
Do we want to support users with wild card characters in their object names, basically. Should there be a hard disable on this wildcard feature for users at the procedure level. Or should users be made aware of certain parameters being "wildcard-aware" and to act accordingly to escape the wildcard characters. Percent signs or brackets in object names isn't super common, of course. Underscores are common though.
One can have a pattern of There is also something to be said for defaulting to always using the like predicate compare for applicable parameters similar to how
My thought process there was that the underscore is pretty common in object names. I would guess defaulting to the like pattern matching could produce unexpected results.
Ok, that does get at some of my comments above too. It does sound like I've gone more complicated and we only want to support the percent sign only.
So the documentation states a 3000 character limit on the Msg 25716, Level 16, State 1, Line 43
The predicate on event, "sqlserver.blocked_process_report", exceeds the maximum length of 3000 characters.Should we force users to use the
Ok, I'll work on that.
Consider the below execution on version USE [master];
GO
EXECUTE dbo.sp_HumanEvents
@event_type = N'wait',
@database_name = N'master',
@object_name = N'sp_WhoIsActive',
@seconds_sample = 2;
GOIt returns the below error. Msg 25706, Level 16, State 8, Line 59
The event attribute or predicate source, "object_name", could not be found.Should probably either
Sounds good. I pushed this change. |
|
@mattcargile My advice here is to design this in the simplest way that allows you to accomplish the feature functionality that you're after. You're getting quite into the weeds with a lot of this. Keep in mind that the goal of this procedure is to make getting extended events set up and running for specific tasks very simple for people. It's okay for things to be dumbed down, as long as the results are correct. Aim to make life easier for the bottom quintile, not to make things impressive for the top end (they're not using this thing anyway). The issue with object names/waits is indeed separate. It should not be included as a predicate there. |
feat:
sp_HumanEventsAdd Wildcard Support, A Few Fixes, And Event Type Check HandlingCloses #639 , #640
Wildcard support for the below parameters:
@database_name
@object_name
@username
@client_hostname
@client_app_name
Remove ending periods on @help for for @cleanup and @gimme_danger
Bug in substring for @view_sql
Bug that Waits session doesn't support object_name
Use @@Procid for @help query
Use Lower on event type to avoid redundancy
Add event type and pattern variables to centralize checks
Format three IF blocks
Considerations For Maintainers
@use_likeparameter appropriate? Should auto opt-in without an opt-out?@database_nameand/or@object_namewith an exact match first even when wild card characters are found to hopefully not break folks and be helpfu. Is this ok?@gimme_dangercheck for predicates close to 1000 characters? The limit is 3000 characters and MSSQL will complain. Is that enough?@object_schema?@event_type = N'waits'using@object_name? Should the procedure raise an error with this or continue as is?object_idfor the blocking@event_typeto filter out theis_ms_shippedobjects. Users could get around this if not using wildcard becauseOBJECT_IDis used instead of a query tosys.objects.Work To Be Done
Update Install All script.Automatically happens upon merge