DotEukali.MetricsClient.Core 7.0.0

dotnet add package DotEukali.MetricsClient.Core --version 7.0.0
NuGet\Install-Package DotEukali.MetricsClient.Core -Version 7.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DotEukali.MetricsClient.Core" Version="7.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DotEukali.MetricsClient.Core --version 7.0.0
#r "nuget: DotEukali.MetricsClient.Core, 7.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DotEukali.MetricsClient.Core as a Cake Addin
#addin nuget:?package=DotEukali.MetricsClient.Core&version=7.0.0

// Install DotEukali.MetricsClient.Core as a Cake Tool
#tool nuget:?package=DotEukali.MetricsClient.Core&version=7.0.0

DotEukali.MetricsClient.Core

Simple Http wrapper for New Relic Metrics API.

To use, simply add configuration eg:

{
  "MetricsOptions": {
    "ApiKey": "{{your New Relic metrics api key}}",
    "ApiUrl": "{{this is optional, the current url is hard-coded}}",
    "Async": true|false, //(if excluded, this defaults to true, which is the existing default behaviour)
    "Attributes": {
      "host.name": "my.host",
      "app.name": "myapp",
      "myotherAttribute": 10
    }
  }
}

Change in 7.0.0, have targeted net6 and net7 specifically, instead of netstandard2.1.

Added with 6.1.0 is synchronous metrics sending - not usually desired, but I have added it for use where the background process might get prematurely terminated. This is configured in appsettings and applies to everything, maybe I'll update it later so the send method can be chosen as needed in the code...

If the attribute app.name exists, it will be prefixed to the metric name, eg myapp_mymetricname. ApiUrl is optional, in case the default url needs to be overriden. Attributes are parsed as IDictionary<string, object> and sent with every metric.

Polly has been removed as a dependency as of 0.2.3 and a new registration extension created to replace the old which returns IHttpClientBuilder, allowing Polly or other handling logic to be added explicitly.

Microsoft dependency injection is used and can be wired up like:

serviceCollection.AddMetricsClient(Configuration);

Then, simply inject IMetrics where needed and use.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
7.0.0 158 5/29/2023
6.1.0 445 7/31/2022
6.0.0 417 2/16/2022
0.2.3 434 8/30/2021
0.2.2 349 7/19/2021