Skip to content

feat: add Semantic Kernel instrumentor - #200

Closed
NivedhN160 wants to merge 1 commit into
future-agi:devfrom
NivedhN160:feat/semantic-kernel-instrumentor
Closed

NivedhN160 wants to merge 1 commit into
future-agi:devfrom
NivedhN160:feat/semantic-kernel-instrumentor

Conversation

@NivedhN160

Copy link
Copy Markdown
Contributor

Adds instrumentor for Microsoft Semantic Kernel. Includes wrapping Kernel.invoke and KernelFunction.invoke. Follows CrewAI pattern.

@nik13

nik13 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Thanks for opening this. We are going to use the package path and the SemanticKernelInstrumentor().instrument() entry point.

We are not going to merge the wrapt wrappers on Kernel.invoke and KernelFunction.invoke. Semantic Kernel already emits OpenTelemetry GenAI spans when SEMANTICKERNEL_EXPERIMENTAL_GENAI_ENABLE_OTEL_DIAGNOSTICS is on (semantic_kernel/utils/telemetry/model_diagnostics and agent_diagnostics at microsoft/semantic-kernel 9974625). Wrapping invoke on top of that double-counts the same call and breaks when those experimental internals move. The attribute names in _wrappers.py (FI_AGENT_NAME, FI_AGENT_OUTPUT, FI_TOOL_NAME, FI_TOOL_OUTPUT) are also not on SpanAttributes in current fi_instrumentation.

What we will take from this PR: the package location, the class name, and the one-call instrument() shape. The body will enable Semantic Kernel's native diagnostics and add a mapping processor only for gaps a conformance test shows (span kind, provider alias from gen_ai.system). The current test asserts the wrapper was installed, so it cannot be kept as written. The example never invokes the kernel, so it will be rewritten against a mock connector.

Happy to add you as a co-author on the replacement PR if you want. We will not merge this PR as it stands.

@nik13

nik13 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Thanks for starting the Semantic Kernel integration, NivedhN160. Your package path and the one-call SemanticKernelInstrumentor().instrument() entry point are what we shipped in #213. It's now on dev and builds on Semantic Kernel's own telemetry rather than wrapping invoke, so we're closing this one as superseded. If a workflow you care about still isn't traced, please open an issue with a small example and we'll take a look.

@nik13 nik13 closed this Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants