RepoDb.Telemetry.Core
0.0.1-alpha2
Prefix Reserved
dotnet add package RepoDb.Telemetry.Core --version 0.0.1-alpha2
NuGet\Install-Package RepoDb.Telemetry.Core -Version 0.0.1-alpha2
<PackageReference Include="RepoDb.Telemetry.Core" Version="0.0.1-alpha2" />
<PackageVersion Include="RepoDb.Telemetry.Core" Version="0.0.1-alpha2" />
<PackageReference Include="RepoDb.Telemetry.Core" />
paket add RepoDb.Telemetry.Core --version 0.0.1-alpha2
#r "nuget: RepoDb.Telemetry.Core, 0.0.1-alpha2"
#:package RepoDb.Telemetry.Core@0.0.1-alpha2
#addin nuget:?package=RepoDb.Telemetry.Core&version=0.0.1-alpha2&prerelease
#tool nuget:?package=RepoDb.Telemetry.Core&version=0.0.1-alpha2&prerelease
RepoDb.Telemetry.Core
Core building blocks for capturing operation-level telemetry (Insert, Query, Update, Delete, etc.) from RepoDB and publishing it to an insights collector.
This package is not meant to be used standalone by most users — it defines the contracts and reusable pieces that a telemetry implementation is built on. If you just want telemetry working out of the box, use RepoDb.Telemetry.Default instead. Use this package directly only if you want to customize how telemetry is published or captured.
Key Types
TelemetryOption— settings for a telemetry session:Application,Group,Host,ApiKey, andFrequency(how often buffered data is flushed).TelemetryItem— the shape of a single captured telemetry record (operation name, statement, elapsed time, session id, client, source, etc.).TelemetryTrace— an abstractITraceimplementation that hooks into RepoDB's before/after execution events, buffers them in memory, and flushes on a timer. It leavesGetPublisherRepository()for a subclass to implement, so it must be subclassed rather than instantiated directly.IPublisherRepository— the contract for sending bufferedTelemetryItems to a collector.TelemetryPublisherRepository— an abstractIPublisherRepository; gzip-compresses and POSTs the payload to{host}/{GetRequestUri()}/publish, adding anX-API-Keyheader when an API key is provided. It leavesGetRequestUri()for a subclass to implement, so it must be subclassed rather than instantiated directly.
Getting Started
TelemetryTrace and TelemetryPublisherRepository are both abstract — they define the buffering/publishing machinery, but leave one method each for a subclass to fill in. If you just want telemetry working out of the box, use RepoDb.Telemetry.Default, which already provides concrete DefaultTelemetryTrace and DefaultTelemetryPublisherRepository implementations.
To implement your own, subclass both types:
public class MyTelemetryPublisherRepository : TelemetryPublisherRepository
{
public MyTelemetryPublisherRepository(string host, string apiKey = null,
Action<Exception> errorCallback = null, ILogger logger = null)
: base(host, apiKey, errorCallback, logger)
{ }
public override string GetRequestUri() => "v1/telemetry/my-app";
}
public class MyTelemetryTrace : TelemetryTrace
{
public MyTelemetryTrace(TelemetryOption option,
Action<Exception> errorCallback = null, ILogger logger = null)
: base(option, errorCallback, logger)
{ }
public override TelemetryPublisherRepository GetPublisherRepository()
=> new MyTelemetryPublisherRepository(Option.Host, Option.ApiKey, ErrorCallback, Logger);
}
Then create an option, start the trace, and attach it to RepoDB:
var option = new TelemetryOption("MyApp")
{
Host = "https://your-collector-host",
ApiKey = "YOUR_API_KEY",
Group = "Default",
Frequency = TimeSpan.FromSeconds(5)
};
var trace = new MyTelemetryTrace(option, errorCallback: ex => logger.LogError(ex, "Telemetry error"));
trace.Start();
Attach the trace to an individual call:
connection.QueryAll<Customer>(trace: trace);
Or register it so it applies to every operation across the app:
GlobalConfiguration
.Setup(new GlobalConfigurationOptions { UseRegisteredGlobalTraces = true });
GlobalTraceRegistration.Register(trace);
Custom Publishing
To send telemetry somewhere other than an HTTP collector entirely (bypassing TelemetryPublisherRepository), implement IPublisherRepository directly and use it from your own ITrace implementation (following the same pattern as TelemetryTrace):
public class MyPublisherRepository : IPublisherRepository
{
public void Publish(TelemetryItem telemetryItem) { /* send to your sink */ }
public void PublishAsync(TelemetryItem telemetryItem, CancellationToken cancellationToken = default) { /* ... */ }
public void PublishMany(IEnumerable<TelemetryItem> telemetryItems) { /* ... */ }
public void PublishManyAsync(IEnumerable<TelemetryItem> telemetryItems, CancellationToken cancellationToken = default) { /* ... */ }
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- RepoDb (>= 1.14.2)
- Serilog (>= 4.3.1)
- System.Text.Json (>= 9.0.0)
-
net10.0
-
net8.0
- RepoDb (>= 1.14.2)
- Serilog (>= 4.3.1)
- System.Text.Json (>= 9.0.0)
-
net9.0
NuGet packages (1)
Showing the top 1 NuGet packages that depend on RepoDb.Telemetry.Core:
| Package | Downloads |
|---|---|
|
RepoDb.Telemetry.Default
The default telemetry package for RepoDB library. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.1-alpha2 | 39 | 7/11/2026 |
| 0.0.1-alpha1 | 50 | 7/8/2026 |