Loading...
Loading...
Compare original and translation side by side
mlflow traces getjqheadundefinedmlflow traces getjqheadundefined
**Prefer fetching the full trace and parsing the JSON directly** rather than using `--extract-fields`. The `--extract-fields` flag has limited support for nested span data (e.g., span inputs/outputs may return empty objects). Fetch the complete trace once and parse it as needed.
**优先抓取完整Trace并直接解析JSON**,而不是使用`--extract-fields`。`--extract-fields`标志对嵌套Span数据的支持有限(例如,Span的输入/输出可能返回空对象)。只需抓取一次完整的Trace,然后根据需要解析即可。infodata{
"info": { "trace_id", "state", "request_time", "assessments", ... },
"data": { "spans": [ { "span_id", "name", "status", "attributes", ... } ] }
}| What | jq path |
|---|---|
| Trace state | |
| All spans | |
| Root span | |
| Span status code | |
| Span status message | |
| Span inputs | |
| Span outputs | |
| Assessments | |
| Assessment name | |
| Feedback value | |
| Feedback error | |
| Assessment rationale | |
attributesattributesundefinedinfodata{
"info": { "trace_id", "state", "request_time", "assessments", ... },
"data": { "spans": [ { "span_id", "name", "status", "attributes", ... } ] }
}| 内容 | jq路径 |
|---|---|
| Trace状态 | |
| 所有Span | |
| 根Span | |
| Span状态码 | |
| Span状态消息 | |
| Span输入 | |
| Span输出 | |
| 评估结果 | |
| 评估名称 | |
| 反馈值 | |
| 反馈错误 | |
| 评估理由 | |
attributesattributesundefinedundefinedundefinedjq '{
state: .info.state,
span_count: (.data.spans | length),
error_spans: [.data.spans[] | select(.status.code == "STATUS_CODE_ERROR") | .name],
assessment_errors: [.info.assessments[] | select(.feedback.error) | .assessment_name]
}' /tmp/trace.jsonjq '{
state: .info.state,
span_count: (.data.spans | length),
error_spans: [.data.spans[] | select(.status.code == "STATUS_CODE_ERROR") | .name],
assessment_errors: [.info.assessments[] | select(.feedback.error) | .assessment_name]
}' /tmp/trace.jsonstate: OKrationalevalueuser_frustrationvalue: "no".rationale.feedbackerrorvaluemlflow.trace.tokenUsagemlflow.chat.tokenUsageattributesstate: OKrationalevalueuser_frustrationvalue: "no".rationale.feedbackerrorvaluemlflow.trace.tokenUsagemlflow.chat.tokenUsageattributes@mlflow.tracemlflow.start_span()ChatOpenAIRetrievalQA@mlflow.tracemlflow.start_span()ChatOpenAIRetrievalQAstate: OKresponse_previewcustomer_support_agent (AGENT) — OK
├── plan_action (LLM) — OK
│ outputs: {"tool_call": "search_knowledge_base", "args": {"query": "refund policy"}}
├── search_knowledge_base (TOOL) — OK
│ inputs: {"query": "refund policy"}
│ outputs: [{"doc": "Shipping takes 3-5 business days...", "score": 0.82}]
├── generate_response (LLM) — OK
│ inputs: {"messages": [..., {"role": "user", "content": "Context: Shipping takes 3-5 business days..."}]}
│ outputs: {"content": "Our shipping policy states..."}search_knowledge_basesearch_knowledge_basestate: OKresponse_previewcustomer_support_agent (AGENT) — OK
├── plan_action (LLM) — OK
│ outputs: {"tool_call": "search_knowledge_base", "args": {"query": "refund policy"}}
├── search_knowledge_base (TOOL) — OK
│ inputs: {"query": "refund policy"}
│ outputs: [{"doc": "Shipping takes 3-5 business days...", "score": 0.82}]
├── generate_response (LLM) — OK
│ inputs: {"messages": [..., {"role": "user", "content": "Context: Shipping takes 3-5 business days..."}]}
│ outputs: {"content": "Our shipping policy states..."}search_knowledge_basesearch_knowledge_base