Add OpenTelemetry to Environment service

This commit is contained in:
2024-01-27 15:37:54 -05:00
parent 92a20e347a
commit 7b2a0c2fea
4 changed files with 16 additions and 2 deletions

View File

@@ -1,4 +1,6 @@
using ChrisKaczor.Common.OpenTelemetry;
using ChrisKaczor.HomeMonitor.Environment.Service.Data;
using System.Reflection;
namespace ChrisKaczor.HomeMonitor.Environment.Service;
@@ -10,6 +12,8 @@ public static class Program
builder.Configuration.AddEnvironmentVariables();
builder.Services.AddCommonOpenTelemetry(Assembly.GetExecutingAssembly().GetName().Name, builder.Configuration["Telemetry:Endpoint"], nameof(MessageHandler));
builder.Services.AddControllers();
builder.Services.AddTransient<Database>();

View File

@@ -20,6 +20,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="ChrisKaczor.Common.OpenTelemetry" Version="1.0.1" />
<PackageReference Include="Dapper" Version="2.1.28" />
<PackageReference Include="dbup-sqlserver" Version="5.0.37" />
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />

View File

@@ -1,8 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
"Default": "Warning",
"Microsoft": "Information"
}
},
"AllowedHosts": "*",
@@ -22,5 +22,8 @@
"Hub": {
"Url": "http://hub-server/environment"
}
},
"Telemetry": {
"Endpoint": "http://signoz-otel-collector.platform:4317/"
}
}

View File

@@ -1,4 +1,10 @@
{
"Logging": {
"LogLevel": {
"Default": "Warning",
"Microsoft": "Information"
}
},
"Weather": {
"Port": {
"Prefix": "/dev/ttyACM",