mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-02-14 18:47:28 -05:00
Add OpenTelemetry to Environment service
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
|
using ChrisKaczor.Common.OpenTelemetry;
|
||||||
using ChrisKaczor.HomeMonitor.Environment.Service.Data;
|
using ChrisKaczor.HomeMonitor.Environment.Service.Data;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
namespace ChrisKaczor.HomeMonitor.Environment.Service;
|
namespace ChrisKaczor.HomeMonitor.Environment.Service;
|
||||||
|
|
||||||
@@ -10,6 +12,8 @@ public static class Program
|
|||||||
|
|
||||||
builder.Configuration.AddEnvironmentVariables();
|
builder.Configuration.AddEnvironmentVariables();
|
||||||
|
|
||||||
|
builder.Services.AddCommonOpenTelemetry(Assembly.GetExecutingAssembly().GetName().Name, builder.Configuration["Telemetry:Endpoint"], nameof(MessageHandler));
|
||||||
|
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
|
|
||||||
builder.Services.AddTransient<Database>();
|
builder.Services.AddTransient<Database>();
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="ChrisKaczor.Common.OpenTelemetry" Version="1.0.1" />
|
||||||
<PackageReference Include="Dapper" Version="2.1.28" />
|
<PackageReference Include="Dapper" Version="2.1.28" />
|
||||||
<PackageReference Include="dbup-sqlserver" Version="5.0.37" />
|
<PackageReference Include="dbup-sqlserver" Version="5.0.37" />
|
||||||
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
|
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Information",
|
"Default": "Warning",
|
||||||
"Microsoft.AspNetCore": "Warning"
|
"Microsoft": "Information"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
@@ -22,5 +22,8 @@
|
|||||||
"Hub": {
|
"Hub": {
|
||||||
"Url": "http://hub-server/environment"
|
"Url": "http://hub-server/environment"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"Telemetry": {
|
||||||
|
"Endpoint": "http://signoz-otel-collector.platform:4317/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
{
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Warning",
|
||||||
|
"Microsoft": "Information"
|
||||||
|
}
|
||||||
|
},
|
||||||
"Weather": {
|
"Weather": {
|
||||||
"Port": {
|
"Port": {
|
||||||
"Prefix": "/dev/ttyACM",
|
"Prefix": "/dev/ttyACM",
|
||||||
|
|||||||
Reference in New Issue
Block a user