databrickslabs / databrickslabs/coding-agents-databricks-apps

MLflow tracing with async Stop hook (opt-in) — resolves #9

Open
#11 0 comments 0 reactions 0 assignees View on GitHub

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=true in app.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 via nohup 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 nohup would redirect stdin to /dev/null and the handler would lose the transcript path.
  • Hard 30s ceiling on the backgrounded flush prevents a wedged handler from leaking memory/CPU.
  • Pins mlflow-skinny and mlflow-tracing to 3.11.1 to 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.