databrickslabs / databrickslabs/coding-agents-databricks-apps
MLflow tracing with async Stop hook (opt-in) — resolves #9
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40
- Forks
- 11
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
Summary
Fix for #9 (MLflow tracing silently disabled). Migrating from datasciencemonkey PR #139.
- Opt-in tracing via
MLFLOW_CLAUDE_TRACING_ENABLED=trueinapp.yaml— keeps default behaviour unchanged for existing deployments, but gives users a single env-var to flip. - Stop hook delegates to
mlflow-trace-stop.sh, which backgrounds the handler vianohup timeout 30 … & disown. Returns in <1s so the rest of the Stop hook chain isn't blocked. - Hook-event JSON via temp file captured synchronously before backgrounding — naive
nohupwould redirect stdin to/dev/nulland the handler would lose the transcript path. - Hard 30s ceiling on the backgrounded flush prevents a wedged handler from leaking memory/CPU.
- Pins
mlflow-skinnyandmlflow-tracingto3.11.1to match the Apps runtime — version mismatches caused silent import failures.
Why this resolves #9
#9 documents that MLFLOW_CLAUDE_TRACING_ENABLED="false" is hardcoded today; the upstream Stop hook short-circuits and no traces are written despite the README claiming auto-tracing. This PR introduces the env-var override so users can flip it on without modifying source, and adds the async wrapper so enabling it doesn't slow session teardown.
Branch
feat/mlflow-tracing — about to be pushed.
Diff scope
+128 / -32, 3 files. Tests in tests/test_mlflow_tracing.py.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with app.yaml, the Stop hook, and mlflow-trace-stop.sh, then run tests/test_mlflow_tracing.py. Verify that opt-in tracing uses the documented environment variable, the hook returns promptly while the handler is bounded, and the pinned MLflow versions match the Apps runtime.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100