-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve naming convention for schedules #9
Comments
Do you have a suggestion for what to put in the schedule name? The naming of schedules didn't have any particular motivation (aligning with task name was pretty much a default), so using it to capture something else isn't taking away from any existing requirement. When inspecting schedules on the server the mapping is explicitly captured by the schedule's link to the job, so the name losing that is ok. |
How about a complexified version of For task {
"TaskUid": "deadbeef-deaf-beef-dead-beefdeadbeef",
"Identifier": "foo",
"TSQLCommand": "exec foo.bar.baz;",
"StartTime": "06:30:00",
"Frequency": "Day",
"FrequencyInterval": 0,
"NotifyOnFailureOperator": "DBA",
"IsNotifyOnfailure": true,
"IsEnabled": true,
"IsDeleted": false,
"NotifyLevelEventLog": "OnFailure"
} ...those attributes (plus some judicious text massaging) might give us the schedule name The JOB RUN: 'foo' was run on 12/1/2021 at 06:30:00 AM
DURATION: 1 hours, 1 minutes, 1 seconds
STATUS: Failed
- MESSAGES: The job failed. The Job was invoked by Schedule 100 (foo). The last step to run was step 1 (foo).
+ MESSAGES: The job failed. The Job was invoked by Schedule 100 (deadbeefdeafbeefdeadbeefdeadbeef-daily-0-06300). The last step to run was step 1 (foo). This provides a greater information density more rapidly in a triage situation. |
Looks good, and not even sure we need the |
Presently - each task gets its own dedicated schedule with the same name as the task itself. This is helpful for small-volume deployments but as you scale up the human-readability value of this model decreases.
Most notably, when default job failure notifications come through - the name of the schedule confers no information about its frequency or interval start time.
A schedule name that communicates information about the schedule itself improves the information density of a job failure notification and allows the receiver to better take action.
msdb.dbo.sysschedules.name
is of typesysname
which limits us to 128 characters. Therefore if there's a desire to keep the 1:1 schedule→task mapping communicated also in the name, then it may be prudent to usesysjobs.job_id
rather thansysjobs.name
for this pointer to reduce risk of overflowThe text was updated successfully, but these errors were encountered: