Skip to content

feat(examples): add Microsoft 365 Agents SDK example with Splunk AO OTel instrumentation - #223

Draft
etserend wants to merge 3 commits into
mainfrom
feat/microsoft-365-agents-sdk-example
Draft

feat(examples): add Microsoft 365 Agents SDK example with Splunk AO OTel instrumentation#223
etserend wants to merge 3 commits into
mainfrom
feat/microsoft-365-agents-sdk-example

Conversation

@etserend

Copy link
Copy Markdown
Contributor

Summary

  • Adds a Q&A agent example using the Microsoft 365 Agents SDK (microsoft-agents-hosting-aiohttp) wired to Splunk AO via stock SplunkAOSpanProcessor
  • opentelemetry-instrumentation-openai-v2 auto-instruments the Azure OpenAI call, emitting gen_ai.* spans with full i/o content
  • Supports both O11Y deployment mode (SPLUNK_AO_REALM + token) and standalone mode (SPLUNK_AO_API_KEY) via .env.example
  • AnonymousTokenProvider for local testing with npx @microsoft/m365agentsplayground; MsalConnectionManager for authenticated Teams/Copilot channels

What works today

The AO UI correctly renders the chat gpt-4o-mini LLM child span in Messages mode with full i/o and token counts. The root span (agents.adapter.process) renders as type trace with empty Input/Output columns — this is a known backend limitation (the backend classifies spans by span name prefix; agents.adapter.process matches none). Tracked in spike doc: https://splunk.atlassian.net/wiki/x/F4AjjPs

Test plan

  • cd examples/agent/microsoft-365-agents-sdk && cp .env.example .env — fill in credentials
  • uv run python start_server.py
  • npx @microsoft/m365agentsplayground — send a message, verify response
  • Confirm trace appears in Splunk AO with chat gpt-4o-mini span rendered in Messages mode

🤖 Generated with Claude Code

…Tel instrumentation

Adds a working Q&A agent example using the Microsoft 365 Agents SDK
(microsoft-agents-hosting-aiohttp) wired to Splunk AO via stock
SplunkAOSpanProcessor. opentelemetry-instrumentation-openai-v2
auto-instruments the Azure OpenAI call, emitting gen_ai.* spans.

Supports both O11Y (SPLUNK_AO_REALM + token) and standalone
(SPLUNK_AO_API_KEY) deployment modes. AnonymousTokenProvider for
local testing with npx @microsoft/m365agentsplayground; MsalConnectionManager
for authenticated Teams/Copilot channels.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@etserend
etserend marked this pull request as draft August 12, 2026 01:33
etserend and others added 2 commits August 12, 2026 15:54
…65 Agents SDK

app_auto_lab0.py: SplunkAOSpanProcessor + OpenAIAgentsTraceInstrumentor → Splunk AO lab0
app_manual_lab0.py: SplunkAOLogger with full 5-level span hierarchy matching auto trace

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… and MS A365 observability

- start_server.py: APP_MODE dispatch (auto/manual/auto_lab0/manual_lab0/default)
- app.py: rewrite to use MS A365 OpenAIAgentsTraceInstrumentor + InvokeAgentScope
- pyproject.toml: replace opentelemetry-instrumentation-openai-v2 with ms-a365-observability deps

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

1 participant