Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.
/ A55.Signoz Public archive

.NET package for Sinoz configuration

License

Notifications You must be signed in to change notification settings

access55/A55.Signoz

Repository files navigation

A55 Signoz Extensions for .NET

Nuget CI https://editorconfig.org/

This project groups and configure opentelemetry instrumentation for .NET focusing on OTPL exporter for Signoz

💡 More about opentelemetry-dotnet HERE


🌐 ASPNET CORE

Instalation:

From command line:

$ dotnet add PROJECT package A55.Signoz.AspNetCore

How to use it:

Configuration

Add services on WebApplicationBuild in your Program.cs or another startup file:

using A55.Signoz;

var builder = WebApplication.CreateBuilder(args);

builder.UseSignoz();
/* other configurations */

var app = builder.Build();

And add the Signoz key in your appsettings.json and/or appsettings.Environment.json

{
    // other configuration keys
    "Signoz": {
        "Enabled": true,
        // Enable or disables telemetry
        "ServiceName": null,
        // optional: The service name which will show in signoz, if null or not define will use Environment.ApplicationName
        "ServiceNameSuffix": "",
        ///optional: A Suffix for ServiceName
        "OtlpEndpoint": "https://signoz-env.a55.tech:4317",
        // The OTLP signoz endpoint
        "UseConsole": false,
        // Flags if opentelemetry will print the spans on console
        "UseOtlp": true,
        // Flags if opentelemetry send to the OTPL endpoint
        "ExportLogs": true,
        // Flags if opentelemetry will send logs
        "ExportTraces": true,
        // Flags if opentelemetry will send traces
        "ExportMetrics": true
        // Flags if opentelemetry will send metrics
    }
}

App configuration SAMPLE HERE


🌱 Environment Variables

If you enable use of Environment Variables in your web app with .AddEnvironmentVariables(), you can set any configuration value with SIGNOZ__{PROPERTYNAME}

Eg:

SIGNOZ__ServiceName=MyVeryCoolApp
SIGNOZ__UseOtplp=true
SIGNOZ__UseConsole=false

💅 Formating

The formating are defined by EditorConfig on .editorconfig

The CI uses dotnet format to enforces the .editorconfig and installed analyzers.

If you need to format the code, just run:

dotnet tool restore
dotnet format .

📝 Versioning

This project is versioned with Semantic Versioning aka SemVer using GitVersion

Commit messages:

Adding +semver: breaking or +semver: major will cause the major version to be increased, +semver: feature or +semver: minor will bump minor and +semver: patch or +semver: fix will bump the patch.