Melic.AgentFramework.Observability.Sessions
0.1.0
dotnet add package Melic.AgentFramework.Observability.Sessions --version 0.1.0
NuGet\Install-Package Melic.AgentFramework.Observability.Sessions -Version 0.1.0
<PackageReference Include="Melic.AgentFramework.Observability.Sessions" Version="0.1.0" />
<PackageVersion Include="Melic.AgentFramework.Observability.Sessions" Version="0.1.0" />
<PackageReference Include="Melic.AgentFramework.Observability.Sessions" />
paket add Melic.AgentFramework.Observability.Sessions --version 0.1.0
#r "nuget: Melic.AgentFramework.Observability.Sessions, 0.1.0"
#:package Melic.AgentFramework.Observability.Sessions@0.1.0
#addin nuget:?package=Melic.AgentFramework.Observability.Sessions&version=0.1.0
#tool nuget:?package=Melic.AgentFramework.Observability.Sessions&version=0.1.0
Melic.AgentFramework.Observability
OpenTelemetry-native observability for the Microsoft Agent Framework (MAF). Adds session identity tracking, per-session token aggregation, custom business tags, optional session-scoped parent spans, tool-call span enrichment, and export-boundary telemetry redaction — all without modifying MAF internals.
Packages
| Package | Purpose |
|---|---|
Melic.AgentFramework.Observability |
Recommended metapackage — installs Sessions, Tools, and Redaction together |
Melic.AgentFramework.Observability.Abstractions |
Shared attribute constants (SessionAttributeNames, ToolAttributeNames) and adapter contracts |
Melic.AgentFramework.Observability.Sessions |
Session lifecycle tracing — enriches every invoke_agent span with genai.session.* tags |
Melic.AgentFramework.Observability.Tools |
Tool-call tracing — enriches MAF execute_tool spans with bounded payload and retry attributes |
Melic.AgentFramework.Observability.Redaction |
Export-boundary trace redaction — masks selected sensitive span attributes before export |
Quick Start
using Melic.AgentFramework.Observability.Redaction;
using Melic.AgentFramework.Observability.Sessions;
using Melic.AgentFramework.Observability.Tools;
using OpenTelemetry;
using OpenTelemetry.Trace;
// Register the middleware (order matters: UseOpenTelemetry must be outermost)
var agent = new AIAgentBuilder(innerAgent)
.UseOpenTelemetry() // outermost — creates the invoke_agent span
.UseSessionTelemetry() // innermost — enriches the open span
.UseToolTelemetry() // enriches execute_tool spans for tools
.Build();
// Each AgentSession gets a stable, auto-generated session ID automatically.
// Optionally assign your own:
session.AssignSessionId("order-42");
// Optionally attach business context tags:
session.SetSessionTag("tenant.id", "contoso");
session.SetSessionTag("user.tier", "premium");
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddSource("Experimental.Microsoft.Agents.AI")
.AddSource("Melic.AgentFramework.Observability.Sessions")
.AddSource("Melic.AgentFramework.Observability.Tools")
.AddTelemetryRedaction()
.AddConsoleExporter()
.Build();
Installing the metapackage is the recommended entrypoint for most consumers. If you only want part of the suite, you can still install Sessions, Tools, and Redaction individually.
Key Features
- Zero-config session IDs — every session gets a stable
genai.session.idautomatically - Token aggregation —
genai.session.input_tokensandgenai.session.output_tokensaccumulate across all turns - Custom tags — attach arbitrary
genai.*business context to every span in a session - Mode B tracing — opt-in explicit parent span via
BeginSessionTrace()for visual trace trees - Tool-call enrichment — adds stable
genai.tool.*attributes to MAFexecute_toolspans - Payload diagnostics — optional valid-JSON input and output capture with bounded size
- Retry detection — repeated tool call ids are marked with retry attributes within the current invocation
- Telemetry redaction — selected high-risk tool and GenAI attributes can be masked before export
- OTel-only dependencies — depends only on
OpenTelemetry.Api, no MAF internals
Documentation
Full technical documentation — including deployment patterns, stateless REST API guidance, public API reference, and the complete telemetry schema — lives in the GitHub repository:
Links
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Melic.AgentFramework.Observability.Abstractions (>= 0.1.0)
- Microsoft.Agents.AI (>= 1.5.0)
- Microsoft.Extensions.AI.Abstractions (>= 10.5.1)
- OpenTelemetry.Api (>= 1.15.3)
-
net8.0
- Melic.AgentFramework.Observability.Abstractions (>= 0.1.0)
- Microsoft.Agents.AI (>= 1.5.0)
- Microsoft.Extensions.AI.Abstractions (>= 10.5.1)
- OpenTelemetry.Api (>= 1.15.3)
-
net9.0
- Melic.AgentFramework.Observability.Abstractions (>= 0.1.0)
- Microsoft.Agents.AI (>= 1.5.0)
- Microsoft.Extensions.AI.Abstractions (>= 10.5.1)
- OpenTelemetry.Api (>= 1.15.3)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Melic.AgentFramework.Observability.Sessions:
| Package | Downloads |
|---|---|
|
Melic.AgentFramework.Observability
Convenience metapackage for the Melic Agent Framework Observability suite. Installs Sessions, Tools, and Redaction together for Microsoft Agent Framework applications. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 181 | 7/5/2026 |
| 0.1.0-preview.3 | 77 | 5/21/2026 |
| 0.1.0-preview.2 | 68 | 5/20/2026 |
| 0.1.0-preview.1 | 64 | 5/18/2026 |