Skip to content

Version 2.1.0

Compare
Choose a tag to compare
@martincostello martincostello released this 06 Mar 16:23
· 669 commits to master since this release
0303224

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,
        };
    });

Contributors