SessionRecorder 1.0.1
dotnet add package SessionRecorder --version 1.0.1
NuGet\Install-Package SessionRecorder -Version 1.0.1
<PackageReference Include="SessionRecorder" Version="1.0.1" />
<PackageVersion Include="SessionRecorder" Version="1.0.1" />
<PackageReference Include="SessionRecorder" />
paket add SessionRecorder --version 1.0.1
#r "nuget: SessionRecorder, 1.0.1"
#:package SessionRecorder@1.0.1
#addin nuget:?package=SessionRecorder&version=1.0.1
#tool nuget:?package=SessionRecorder&version=1.0.1
<div align="center"> <a href="https://github.com/multiplayer-app/multiplayer-session-recorder-dotnet"> <img src="https://img.shields.io/github/stars/multiplayer-app/multiplayer-session-recorder-dotnet.svg?style=social&label=Star&maxAge=2592000" alt="GitHub stars"> </a> <a href="https://github.com/multiplayer-app/multiplayer-session-recorder-dotnet/blob/main/LICENSE"> <img src="https://img.shields.io/github/license/multiplayer-app/multiplayer-session-recorder-dotnet" alt="License"> </a> <a href="https://multiplayer.app"> <img src="https://img.shields.io/badge/Visit-multiplayer.app-blue" alt="Visit Multiplayer"> </a>
</div> <div> <p align="center"> <a href="https://x.com/trymultiplayer"> <img src="https://img.shields.io/badge/Follow%20on%20X-000000?style=for-the-badge&logo=x&logoColor=white" alt="Follow on X" /> </a> <a href="https://www.linkedin.com/company/multiplayer-app/"> <img src="https://img.shields.io/badge/Follow%20on%20LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white" alt="Follow on LinkedIn" /> </a> <a href="https://discord.com/invite/q9K3mDzfrx"> <img src="https://img.shields.io/badge/Join%20our%20Discord-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Join our Discord" /> </a> </p> </div>
Multiplayer Session Recorder - .NET
A .NET library for recording and managing debugging sessions with Multiplayer.
Features
- Start and stop debugging sessions
- Support for both plain and continuous sessions
- HTTP request/response capture and masking
- Custom trace ID generation
- Session attributes and resource attributes support
Installation
dotnet add package SessionRecorder
Quick Start
The SessionRecorder
is implemented as a singleton, ensuring that only one instance exists throughout your application. This makes it easy to access the session recorder from anywhere in your code.
using SessionRecorder;
using SessionRecorder.Types;
// Initialize the session recorder
var config = new SessionRecorderConfig
{
ApiKey = "your-api-key",
TraceIdGenerator = new SessionRecorderIdGenerator()
ResourceAttributes = new Dictionary<string, object>
{
{ "service.name", "my-service" },
{ "service.version", "1.0.0" }
}
};
// Initialize the session recorder
SessionRecorder.Init(config);
// Start a session
var session = new Session
{
Name = "My Debug Session",
SessionAttributes = new Dictionary<string, object>
{
{ "user.id", "12345" },
{ "environment", "production" }
},
ResourceAttributes = new Dictionary<string, object>
{
{ "host.name", "server-01" }
}
};
await SessionRecorder.Start(SessionType.PLAIN, session);
// Stop the session
var stopSession = new Session
{
SessionAttributes = new Dictionary<string, object>
{
{ "completion.status", "success" },
{ "duration.minutes", 15 }
}
};
await SessionRecorder.Stop(stopSession);
API Reference
Request Structures
Start Session Request
When starting a session, the library sends the following structure to the API:
{
"name": "string",
"tags": [
{
"key": "string",
"value": "string"
}
],
"sessionAttributes": {},
"resourceAttributes": {}
}
Stop Session Request
When stopping a session, the library sends the following structure to the API:
{
"sessionAttributes": {}
}
Session Types
SessionType.PLAIN
: Standard debugging sessionSessionType.CONTINUOUS
: Continuous debugging session with auto-save capabilities
Configuration
The SessionRecorderConfig
class supports the following options:
ApiKey
: Your Multiplayer API keyTraceIdGenerator
: Custom trace ID generatorResourceAttributes
: Global resource attributes for all sessionsGenerateSessionShortIdLocally
: Whether to generate session short IDs locally
HTTP Capture Middleware
The library includes middleware for capturing HTTP requests and responses:
app.UseMiddleware<SessionRecorderHttpCaptureMiddleware>();
License
MIT License - see LICENSE file for details.
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 was computed. 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 was computed. 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. |
-
net8.0
- Microsoft.Extensions.Diagnostics.Abstractions (>= 1.0.1)
- Microsoft.Extensions.Logging.Configuration (>= 1.0.1)
- OpenTelemetry (>= 1.11.1)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.11.1)
- OpenTelemetry.Extensions.Hosting (>= 1.11.1)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.11.0)
- OpenTelemetry.Instrumentation.Http (>= 1.11.0)
- System.Text.Json (>= 9.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.