EDGE FDE
IntermediateTrace every step of an AI call
Debug a slow or wrong answer by seeing each hop instead of one opaque duration.
OpenTelemetry-style spans around context pack, tool, model, and guardrail next to Instruments.
Name the hops, wrap LanguageModelSession in OSSignposter spans, and read a bad trace. iOS 27 and macOS 27 only.
Lessons
Key concepts
- One
LanguageModelSessioncall is a chain: context pack, tool, model, guardrail. - Use four hop names:
ai.context_pack,ai.tool,ai.model,ai.guardrailunderai.request. - The Foundation Models instrument shows Apple's hops. OSSignposter spans show yours.
- There is no Apple OpenTelemetry exporter. Instruments is the official timeline.
Takeaways
- You can wrap each hop in OSSignposter spans with stable names.
- You can debug a slow or wrong answer by naming the hop first.
- You can keep Instruments for framework time and your spans for packer and guardrail.
Agent briefs
Related courses
Stream tokens and measure speed · Test AI behavior before you ship · Version prompts like product copy · Core AI vs Core ML vs MLX