Version 2.1.0
JustEat.StatsD v2.1.0
Available from NuGet.
Changes
Adds extension methods for service registration when using netstandard2.0
.
Registration
For simple use cases, register services using your StatsD hostname:
services.AddStatsD("metrics_server.mycompany.com");
For advanced usage, use IServiceProvider
to resolve additional services and create an instance of StatsDConfiguration
with the appropriate property values:
services.AddStatsD(
(provider) =>
{
var options = provider.GetRequiredService<MyOptions>().StatsD;
return new StatsDConfiguration()
{
Host = options.HostName,
Port = options.Port,
Prefix = options.Prefix,
OnError = ex => LogError(ex),
Culture = CultureInfo.InvariantCulture,
};
});