feat(telemetry): Telemetry 0.3.0 - service.version, site.id/node.role, logs over OTLP (scadaproj#55)
Pins ZB.MOM.WW.Telemetry(.Serilog) 0.1.0 -> 0.3.0. AddZbTelemetry now reads the whole MxGateway:Telemetry section through the shared ApplyConfiguration: node.role defaults to "standalone" (one gateway per box), MxGateway:Telemetry:SiteId / :NodeRole / :ServiceVersion / :ResourceAttributes:* are operator keys, and service.version defaults to the entry assembly's informational version (the git SHA). With MxGateway:Telemetry:Exporter=Otlp the Serilog logs go to the same collector too. Claude-Session: https://claude.ai/code/session_01GT67ACmpMR7b9LGRPLijMi
This commit is contained in:
@@ -121,11 +121,13 @@ public static class GatewayApplication
|
||||
{
|
||||
o.ServiceName = "mxgateway";
|
||||
o.Meters = [GatewayMetrics.MeterName]; // "MxGateway.Server" — name unchanged
|
||||
if (Enum.TryParse<ZbExporter>(builder.Configuration["MxGateway:Telemetry:Exporter"], ignoreCase: true, out var exporter))
|
||||
o.Exporter = exporter;
|
||||
var otlp = builder.Configuration["MxGateway:Telemetry:OtlpEndpoint"];
|
||||
if (!string.IsNullOrWhiteSpace(otlp))
|
||||
o.OtlpEndpoint = otlp;
|
||||
// Resource identity (scadaproj#55): the gateway is one process per box, so node.role
|
||||
// defaults to "standalone"; site.id has no natural value and comes from config.
|
||||
// service.version defaults from the entry assembly (the git SHA).
|
||||
o.NodeRole = "standalone";
|
||||
// MxGateway:Telemetry:{Exporter, OtlpEndpoint, ServiceVersion, SiteId, NodeRole,
|
||||
// ExportLogs, ResourceAttributes:*}. Exporter=Otlp also sends the Serilog logs (0.3.0).
|
||||
o.ApplyConfiguration(builder.Configuration.GetSection("MxGateway:Telemetry"));
|
||||
});
|
||||
builder.Services.AddSingleton<ILogRedactor, GatewayLogRedactorSeam>();
|
||||
builder.Services.AddSingleton<MxAccessGrpcMapper>();
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
<PackageReference Include="ZB.MOM.WW.Theme" Version="0.5.0" />
|
||||
<PackageReference Include="ZB.MOM.WW.Configuration" Version="0.1.0" />
|
||||
<PackageReference Include="ZB.MOM.WW.Health" Version="0.3.0" />
|
||||
<PackageReference Include="ZB.MOM.WW.Telemetry" Version="0.1.0" />
|
||||
<PackageReference Include="ZB.MOM.WW.Telemetry.Serilog" Version="0.1.0" />
|
||||
<PackageReference Include="ZB.MOM.WW.Telemetry" Version="0.3.0" />
|
||||
<PackageReference Include="ZB.MOM.WW.Telemetry.Serilog" Version="0.3.0" />
|
||||
<PackageReference Include="ZB.MOM.WW.GalaxyRepository" Version="0.2.0" />
|
||||
<PackageReference Include="ZB.MOM.WW.Secrets" Version="0.6.2" />
|
||||
<PackageReference Include="ZB.MOM.WW.Secrets.Abstractions" Version="0.6.2" />
|
||||
|
||||
Reference in New Issue
Block a user