diff --git a/src/ZB.MOM.WW.MxGateway.Server/GatewayApplication.cs b/src/ZB.MOM.WW.MxGateway.Server/GatewayApplication.cs index bd7e5e1a..312ef0f8 100644 --- a/src/ZB.MOM.WW.MxGateway.Server/GatewayApplication.cs +++ b/src/ZB.MOM.WW.MxGateway.Server/GatewayApplication.cs @@ -121,11 +121,13 @@ public static class GatewayApplication { o.ServiceName = "mxgateway"; o.Meters = [GatewayMetrics.MeterName]; // "MxGateway.Server" — name unchanged - if (Enum.TryParse(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(); builder.Services.AddSingleton(); diff --git a/src/ZB.MOM.WW.MxGateway.Server/ZB.MOM.WW.MxGateway.Server.csproj b/src/ZB.MOM.WW.MxGateway.Server/ZB.MOM.WW.MxGateway.Server.csproj index e609290e..0a9a6361 100644 --- a/src/ZB.MOM.WW.MxGateway.Server/ZB.MOM.WW.MxGateway.Server.csproj +++ b/src/ZB.MOM.WW.MxGateway.Server/ZB.MOM.WW.MxGateway.Server.csproj @@ -18,8 +18,8 @@ - - + +