Setup
Enable model diagnostics
Set these before importing
semantic_kernel. The first enables GenAI spans; the second adds prompt and response content as log events.Point the exporter at AgentMark
Semantic Kernel reads the global tracer provider, so register one that exports to AgentMark. Use your AgentMark API key and app id from project settings.
Run your kernel
Run your kernel as usual. Each model call arrives in AgentMark as a span, grouped into a trace. See Traces and logs.
What AgentMark captures
Semantic Kernel’s GenAI spans carry the model, token counts, and finish reason, which AgentMark maps onto its normalized trace fields — so cost and latency are tracked, and token counts feed cost tracking automatically.Semantic Kernel records prompt and response content as OpenTelemetry log events rather than span attributes, so message text does not appear on the trace through this path — only the model, token counts, and timing. For full input/output capture, use a framework with an OpenInference instrumentor (for example LangChain or Pydantic AI).
Next steps
OpenTelemetry
The endpoint, authentication, and GenAI conventions AgentMark reads
Traces and logs
Explore traces once they arrive
Have questions?
Reach out any time:
- Email us at hello@agentmark.co for support
- Schedule an Enterprise Demo to learn about our business solutions