Skip to main content

glue-doctor

Tests Lint PyPI Python versions License

Audit CLI for AWS Glue jobs. It reads job definitions and run history (read-only), reports configuration risks, and exits non-zero so it can gate CI.

Install

uvx glue-doctor audit --region eu-central-1
# or
uv tool install glue-doctor

Requires Python 3.13 or newer.

Quick start

glue-doctor audit --profile my-profile --region eu-central-1
glue-doctor audit --format json | jq '.summary'
glue-doctor audit --job "etl-*" --fail-on error

Example output:

┏━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Severity ┃ Job        ┃ Check                ┃ Message                                                             ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ warning  │ etl-orders │ timeout-too-generous │ Timeout is 2880 min but the median successful run takes 12 min      │
│          │            │                      │ (240x)                                                              │
│          │            │                      │ Set the timeout closer to the observed runtime so a hung run is     │
│          │            │                      │ stopped early                                                       │
│ info     │ etl-legacy │ glue-version         │ Glue 4.0 (Spark 3.3.0, Python 3.10) is older than 5.1               │
│          │            │                      │ Upgrade to Glue 5.1 or newer. Glue 6.0 runs Spark 4 (ANSI SQL mode  │
│          │            │                      │ on by default) and costs less, so validate your job before          │
│          │            │                      │ migrating                                                           │
└──────────┴────────────┴──────────────────────┴─────────────────────────────────────────────────────────────────────┘
2 finding(s) in 34 job(s)

Checks

ID Default severity What it detects
timeout-too-generous warning Timeout far above the median runtime of recent successful runs, once it exceeds a minimum (2 h by default; short timeouts are a sensible safety net). With little history, a timeout above an absolute cap
timeout-too-tight warning Recent runs take most of the timeout (p95 above 80% of it)
glue-version warning below 5.0, info below 5.1 Glue version older than the configured minimum. Glue 5.1 and 6.0 are supported
observability-off info --enable-metrics absent, job run insights explicitly disabled, or continuous logging off (only checked on Glue 4.0 and earlier; from 5.0 every job has real-time logging)
collect-error warning A job's data could not be read, so the audit of that job is incomplete

Streaming jobs are skipped by the timeout checks; Python shell jobs are skipped by the version and observability checks. glue-doctor audit --help lists every check.

Exit codes

Code Meaning
0 No finding at or above --fail-on (default warning)
1 At least one finding at or above the threshold (including collect-error)
2 Usage or configuration error
3 Audit impossible (no credentials, GetJobs denied, no or invalid region) or an internal error

Configuration

Optional. glue-doctor reads ./glue-doctor.toml (or --config PATH); flags override the file. Unknown keys are errors, so a typo never silently disables a check.

fail_on = "warning"          # error | warning | info | never
region  = "eu-central-1"
profile = "my-profile"

[jobs]
include = ["*"]
exclude = ["scratch-*"]

[checks.timeout-too-generous]
severity    = "warning"
max_ratio   = 10.0           # timeout / median of successful runs
history     = 20             # last N successful runs
min_runs    = 5              # fewer runs: fall back to cap_minutes
cap_minutes = 1440
min_timeout_minutes = 120    # ignore timeouts up to this value, whatever the ratio

[checks.timeout-too-tight]
p95_ratio = 0.8

[checks.glue-version]
warn_below = "5.0"
info_below = "5.1"

[checks.observability-off]
enabled = false

[[suppress]]
check  = "timeout-too-generous"
job    = "nightly-*"
reason = "Highly variable runtime"   # required
until  = 2027-01-31                  # optional; after this date the finding returns

Any check accepts enabled and severity (error, warning or info); a severity override applies to every finding of that check. The region is read from AWS_DEFAULT_REGION when neither the flag nor the file sets it.

Permissions

glue-doctor only calls glue:GetJobs and glue:GetJobRuns (plus sts:GetCallerIdentity, which needs no permission). A minimal policy:

{
  "Version": "2012-10-17",
  "Statement": [
    { "Effect": "Allow", "Action": ["glue:GetJobs", "glue:GetJobRuns"], "Resource": "*" }
  ]
}

Any other AWS operation is blocked inside the tool. Only Glue's own special job arguments are read from a job definition; your custom arguments (which can hold secrets) never enter a report.

JSON output

--format json prints a document validated by glue_doctor/schemas/report-v1.json (schema_version: 1) on stdout; warnings and errors go to stderr.

Development

make sync    # install dependencies
make check   # lint + format + test

License

Apache-2.0.

Metadata

Release files for glue-doctor 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for glue-doctor 0.1.1
File Size Uploaded
glue_doctor-0.1.1.tar.gz 32.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for glue-doctor 0.1.1
File Interpreter ABI Platform
glue_doctor-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 57.8 kB

Release files / glue_doctor-0.1.1.tar.gz

Download URL glue_doctor-0.1.1.tar.gz
Size 32.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2bf29bb9c6e1a712eed0c398f35c5bad31403203b701e8f5f93a258f660a9004
BLAKE2b-256 checksum
How to use checksums
e0fe468fe8e1c92b3f13c057deb2872d8d1f15ecdd2103d7b541e43367a1417b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / glue_doctor-0.1.1-py3-none-any.whl

Download URL glue_doctor-0.1.1-py3-none-any.whl
Size 25.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d13fcf5d32a7d6bf38b7b11c6853633eb3b7bc655ad27d9a2a67788fad97488d
BLAKE2b-256 checksum
How to use checksums
1b093b83b8f6933cb51ea8c504a0dc5ff1da6b6b06cfd8437bda7ff189ed3755
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page