Skip to content

fix(model-monitor): honor base_job_name for job definition names - #6373

Merged
rsareddy0329 merged 1 commit into
aws:master-v2from
rsareddy0329:fix/monitor-base-job-name-v2
Oct 5, 2026
Merged

rsareddy0329 merged 1 commit into
aws:master-v2from
rsareddy0329:fix/monitor-base-job-name-v2

Conversation

@rsareddy0329

Copy link
Copy Markdown
Contributor

Issue #, if available: Relates to #4783

Description of changes:

ModelMonitor subclasses generated the monitoring job definition name from the
type's JOB_DEFINITION_BASE_NAME constant, ignoring a user-supplied base_job_name —
even though the monitoring schedule name already honors it. So base_job_name was
silently dropped for the job definition and the monitoring resources derived from it,
which is what #4783 reports.

Add a _generate_job_definition_name() helper on the ModelMonitor base (mirroring the
existing _generate_monitoring_schedule_name / _generate_baselining_job_name helpers)
that uses base_job_name when provided and falls back to JOB_DEFINITION_BASE_NAME
otherwise. It's used in the create and update paths of the data-quality, model-quality,
model-bias and model-explainability monitors.

This is the V2 (master-v2) counterpart of the V3 change in #6372.

Scope note: the recurring execution processing-job names are assigned by the SageMaker
service (CreateMonitoringSchedule exposes no field to name them), so those remain
non-customizable. This change makes base_job_name flow into every monitoring name the
SDK does control (schedule + job definition).

Testing:

  • New unit tests: _generate_job_definition_name() uses base_job_name when set and
    falls back to the type default otherwise.
  • Hardened the four *_update_failure tests, which asserted the regenerated job
    definition name differs from the original — that relied on two name_from_base calls
    landing in different milliseconds and is flaky on master-v2. They now patch
    name_from_base with a counter-based unique name (verified deterministic across repeated
    runs).
  • Full monitor/ unit suites pass (57 passed). flake8 and black -l 100 clean on
    changed files.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

ModelMonitor subclasses generated the monitoring job definition name from
the type's JOB_DEFINITION_BASE_NAME constant, ignoring a user-supplied
base_job_name -- even though the monitoring schedule name already honors it.
As a result base_job_name was silently dropped for the job definition (and
the monitoring resources derived from it).

Add a _generate_job_definition_name() helper on the ModelMonitor base
(mirroring _generate_monitoring_schedule_name) that uses base_job_name when
provided and falls back to JOB_DEFINITION_BASE_NAME otherwise, and use it in
the data-quality, model-quality, model-bias and model-explainability create
and update paths.

Also make the four *_update_failure tests deterministic: they asserted the
regenerated job definition name differs from the original, which relied on
two name_from_base calls landing in different milliseconds (flaky on master).
Patch name_from_base with a counter-based unique name in those tests.

Note: the recurring execution processing job names are assigned by the
SageMaker service and remain non-customizable.

Relates-to aws#4783
@rsareddy0329
rsareddy0329 requested a review from a team as a code owner October 1, 2026 20:48
@rsareddy0329
rsareddy0329 requested a review from jam-jee October 1, 2026 20:48
@rsareddy0329
rsareddy0329 deployed to auto-approve October 1, 2026 21:45 — with GitHub Actions Active
@rsareddy0329
rsareddy0329 merged commit 7c37579 into aws:master-v2 Oct 5, 2026
19 of 27 checks passed

This branch was successfully deployed

1 active deployment
auto-approve — 849cbdc5 Deployed Oct 1, 2026 by rsareddy0329 via wait-for-approval #243
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants