This project groups and configure opentelemetry instrumentation for .NET focusing on OTPL exporter for Signoz
💡 More about opentelemetry-dotnet HERE
Instalation:
From command line:
$ dotnet add PROJECT package A55.Signoz.AspNetCore
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
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
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 .
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.