Skip to content

.Net: New Feature: Feature Request: Add OpenTelemetry GenAI instrumentation sample & docs #13237

@dineshkumarkummara

Description

@dineshkumarkummara

name: Feature request
about: Suggest an idea for this project


Summary

otel-genai-bridges provides a .NET library (SkOtel) that adds both ASP.NET Core middleware and a DelegatingHandler to emit OpenTelemetry Generative AI telemetry for Semantic Kernel apps. Surfacing this as a community sample in the SK docs would give teams a ready-made path to end-to-end GenAI observability.

Key features

  • AddSemanticKernelTelemetry extension registers options, middleware, and handler
  • Captures prompts/completions/tool invocations, tokens, latency, cost, and RAG retrieval latency
  • Bundled sample (dotnet/samples/sk-chat) plus Dockerized Collector → Tempo/Prometheus → Grafana stack

Snippet

builder.Services.AddSemanticKernelTelemetry(options =>
{
    options.System = "azure.ai.openai";
    options.Model = "gpt-4o";
    options.CapturePrompts = true;
    options.CaptureCompletions = true;
});

builder.Services.AddOpenTelemetry()
    .ConfigureResource(r => r.AddService("sk-chat"))
    .WithTracing(t => t
        .AddSource("otel-genai-bridges/semantic-kernel")
        .AddAspNetCoreInstrumentation()
        .AddOtlpExporter());

Grafana token throughput panel

Proposal

Add a docs/sample entry referencing this instrumentation so developers can adopt OTEL GenAI semantics today. Repository: https://github.com/dineshkumarkummara/otel-genai-bridges

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETIssue or Pull requests regarding .NET codetriage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions