DatadogStatsD 0.2.5
See the version list below for details.
dotnet add package DatadogStatsD --version 0.2.5
NuGet\Install-Package DatadogStatsD -Version 0.2.5
<PackageReference Include="DatadogStatsD" Version="0.2.5" />
paket add DatadogStatsD --version 0.2.5
#r "nuget: DatadogStatsD, 0.2.5"
// Install DatadogStatsD as a Cake Addin #addin nuget:?package=DatadogStatsD&version=0.2.5 // Install DatadogStatsD as a Cake Tool #tool nuget:?package=DatadogStatsD&version=0.2.5
DatadogStatsD
Full featured DogStatsD client:
- Count, Histogram, Gauge, Distribution, Set
- Events
- Service Checks
- UDP or UDS transport
- Performance - Metrics are aggregated and the submissions are batched
- Back pressure - Transport drops new metrics when it's falling behind
- Telemetry - Metrics to monitor communication between the agent and this client
Installation
DatadogStatsD targets both .NET Standard 2.0 & 2.1.
dotnet add package DatadogStatsD
Examples
await using var dogStatsD = new DogStatsD();
using var requests = dogStatsD.CreateCount("requests", new[] { "environment:dev" });
requests.Increment();
requests.Decrement();
var latency = dogStatsD.CreateHistogram("latency", sampleRate: 0.5);
latency.Sample(5.423);
latency.Sample(1.27);
using var threads = dogStatsD.CreateGauge("threads", () => Process.GetCurrentProcess().Threads.Count);
dogStasD.RaiseEvent(AlertType.Info, "Bad thing happened", "This happened");
dogStasD.SendServiceCheck("is_connected", CheckStatus.Ok);
See DogStatsDConfiguration.cs to configure the client.
Benchmark
Benchmark comparing performance of this library (DatadogStatsD), when sending 10000 metrics, with neuecc/DatadogSharp (DatadogSharp) and DataDog/dogstatsd-csharp-client (StatsDClient). Sources can be found in DatadogStatsD.Benchmark.
Count & Gauge
Method | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|
DatadogStatsD | 55.41 us | 0.273 us | 0.242 us | - | - | - | - |
DatadogSharp | 140,563.34 us | 1,540.997 us | 1,441.449 us | 1750.0000 | - | - | 5599762 B |
StatsDClient | 9,535.01 us | 187.826 us | 348.147 us | 1671.8750 | 531.2500 | 109.3750 | 6089620 B |
This library aggregates for 10 seconds (DogStatsD flush interval) counts and gauges, so for 10000 increments, one packet is sent, hence the ~0 bytes allocated.
Histogram, Set, Distribution
Method | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|
DatadogStatsD | 5.024 ms | 0.0657 ms | 0.0615 ms | - | - | - | 1.18 KB |
DatadogSharp | 140.095 ms | 0.9445 ms | 0.8835 ms | 1750.0000 | - | - | 5468.24 KB |
StatsDClient | 9.951 ms | 0.1976 ms | 0.4658 ms | 1671.8750 | 515.6250 | 109.3750 | 5945.63 KB |
For those metrics, the library lets DogStatsD agent do the aggregation, so with a sample rate of 1.0, each call to Histogram.Update will be sent to the agent.
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 was computed. 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. |
.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 is compatible. |
.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
- System.Buffers (>= 4.5.1)
- System.Threading.Channels (>= 4.7.1)
-
.NETStandard 2.1
- System.Buffers (>= 4.5.1)
- System.Threading.Channels (>= 4.7.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.