Make autolog resilient, add UC pre-flight and per-node span descriptions - #33
Open
adamgurary wants to merge 1 commit into
Open
Make autolog resilient, add UC pre-flight and per-node span descriptions#33adamgurary wants to merge 1 commit into
adamgurary wants to merge 1 commit into
Conversation
- Replace the flat autolog block with a per-flavor try/except loop so a
missing dependency does not disable other autolog calls.
- Add a note that LangGraph uses mlflow.langchain.autolog() (no separate
mlflow.langgraph.autolog()) and needs only langchain-core, not langchain.
- Add a pre-flight note that the default experiment backend caps at 100k
traces on Databricks and point to references/databricks.md for the
UC trace-location one-liner.
- Add a pattern for setting span.set_attribute("description", <docstring>)
on LangGraph node spans so traces are readable without opening the code.
Co-authored-by: Isaac
Signed-off-by: Adam Gurary <guraryadam@gmail.com>
adamgurary
force-pushed
the
tracing-skill-resilience-uc-descriptions
branch
from
July 31, 2026 17:39
d191509 to
f97aaa2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three additive improvements to
instrumenting-with-mlflow-tracing/references/python.md, each fixing a concrete failure mode observed when a developer instruments a LangGraph agent for the first time.1. Resilient autolog setup (Method 1)
The existing autolog block calls each flavor sequentially with no error handling. If one flavor's version-compatibility check raises (for example,
mlflow.langchain.autolog()raisesModuleNotFoundError: No module named 'langchain'when onlylangchain-coreis installed), every subsequent autolog call in the same block is skipped. The fix wraps each call in its owntry/exceptso a single missing package does not disable the rest.The section also adds a note clarifying that LangGraph is traced via
mlflow.langchain.autolog()(there is nomlflow.langgraph.autolog()), and that it requires onlylangchain-core, not the fulllangchainpackage.2. Databricks UC trace-storage pre-flight note
On Databricks, the default experiment backend caps at 100,000 traces per experiment. Nothing in the Quick Start section flags this limit. The fix adds a short callout pointing readers to
references/databricks.mdfor theset_experiment(trace_location=UnityCatalog(...))one-liner before they hit the cap in production.3. Per-node span description pattern (new subsection under "Combining AutoLogging with Custom Tracing")
When
mlflow.langchain.autolog()traces a LangGraph graph, each node span is named after the node function. The trace shows inputs and outputs but nothing that explains what the node does. A reader has to open the source file to understand the trace. The fix adds a pattern for writing the node's docstring tospan.set_attribute("description", fn.__doc__), which surfaces in the span's Attributes tab without any changes to MLflow core.Testing
Verified locally that:
mlflow.get_current_active_span()is a valid public API in mlflow>=3.8.0.span.set_attribute(key, value)is a valid public API onLiveSpan.No existing skill tests are affected (this file contains only documentation and code examples).