AnalyticsNET 1.0.8

dotnet add package AnalyticsNET --version 1.0.8                
NuGet\Install-Package AnalyticsNET -Version 1.0.8                
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="AnalyticsNET" Version="1.0.8" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AnalyticsNET --version 1.0.8                
#r "nuget: AnalyticsNET, 1.0.8"                
#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 AnalyticsNET as a Cake Addin
#addin nuget:?package=AnalyticsNET&version=1.0.8

// Install AnalyticsNET as a Cake Tool
#tool nuget:?package=AnalyticsNET&version=1.0.8                

AnalyticsNET (Analytics Library for C#)

AnalyticsNET library is designed to empower your application with robust analytical capabilities, including data logging, error metrics logging, error reporting, and insightful metrics collection.

Features

  • Easy Integration: Inject the library into your application effortlessly and start collecting valuable analytics data right away.
  • Error Reporting: Quickly identify and address errors with built-in error reporting functionality.
  • Customizable Options: Tailor the library to your specific needs with customizable options for app settings, API endpoints, and more.
  • Device Heartbeats: Keep track of your devices' health with automated device heartbeats.

Installation

To get started AnalyticsNET, add it as a Nuget Library:

NuGet Package

nuget Install-Package AnalyticsNET

Init Service

// Init service
var analyticService = new AnalyticsService(new AnalyticsOptions
{
    AppSecretKey = "<<someHashKeyForYourApp>>",
    AppName = "<<YourAppName>>",
    DeviceId = "<<device-id-or-macAddress>",
    AnalyticsAPIEndpoint = "https://your-analytics-api.com/",
    SendDeviceHeartBeats = true
});

// Start service
await analyticService.StartAsync();

// Track events
analyticService.Track("health", "app started successfully")
// Track events 
analyticService.Track("error", "Issue with Server, 404 Response");

AspNetCore Integration

Library is also able to ran as a Hosted Service by creating a class and extending from IHostedService

public class AnalyticsNETHostedService : AnalyticsService, IHostedService
{
    public AnalyticsNETHostedService(AnalyticsOptions analyticsDeviceOptions, IAnalyticsLogger analyticsLogger = null)
    : base(analyticsDeviceOptions, analyticsLogger)
    {

    }
}

Then registering the class like this;

services.AddHostedService(svc => new AnalyticsNETHostedService(new AnalyticsOptions
{
    AppSecretKey = "<<someHashKeyForYourApp>>",
    AppName = "<<YourAppName>>",
    DeviceId = "<<device-id-or-macAddress>",
    AnalyticsAPIEndpoint = "https://your-analytics-api.com/",
    SendDeviceHeartBeats = true
}));

Collecting Analytics Data

There is an example of an Analytics API that shows how you can receive metrics here AnalyticsNet.API

Contributions

Contributions are welcome! If you have ideas for improvements, new features, or bug fixes, feel free to open an issue or submit a pull request on Project Repository

To Do

I am actively adding more features as time goes by and here is the Project Milestones;

  1. Integration with Prometheus and Grafana Dashboards
  2. Ability to add Encryption and Decryption factoring in performance (Done)
  3. More additional features...

License

This project is licensed under the MIT License. See the LICENSE file for details.

Product 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

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
1.0.8 258 3/3/2024
1.0.7 87 2/22/2024
1.0.6 76 2/22/2024
1.0.5 86 2/21/2024
1.0.4 87 2/20/2024
1.0.3 74 2/20/2024
1.0.2 87 2/19/2024
1.0.0 83 2/19/2024

- Initial release of the AnalyticsNET library for C#.
- Added support for data logging, error metrics logging, and error reporting.
- Implemented customizable options for app settings and API endpoints.
- Included device heartbeats feature for monitoring device health.