feat(telemetry.serilog): AddZbSerilog bootstrap + identity enrichers

This commit is contained in:
Joseph Doherty
2026-06-01 07:38:07 -04:00
parent 3e4d4369bf
commit 1344f249d0
4 changed files with 211 additions and 0 deletions
@@ -0,0 +1,27 @@
namespace ZB.MOM.WW.Telemetry.Serilog;
/// <summary>
/// Canonical Serilog property name constants for the identity enrichers stamped by
/// <see cref="ZbSerilogExtensions.AddZbSerilog"/>. Use these constants — not literal strings —
/// when querying properties in sinks or tests. Each property mirrors a shared OTel Resource
/// attribute so logs and metrics/traces from the same node carry identical dimensions.
/// </summary>
public static class ZbLogEnricherNames
{
/// <summary>
/// Serilog property: physical or logical site identifier. Matches OTel Resource <c>site.id</c>.
/// </summary>
public const string SiteId = "SiteId";
/// <summary>
/// Serilog property: node function (<c>central</c>, <c>site</c>, <c>hub</c>, <c>standalone</c>).
/// Matches OTel Resource <c>node.role</c>.
/// </summary>
public const string NodeRole = "NodeRole";
/// <summary>
/// Serilog property: machine name (<see cref="System.Environment.MachineName"/>).
/// Matches OTel Resource <c>host.name</c>. Populated automatically — not a caller-supplied option.
/// </summary>
public const string NodeHostname = "NodeHostname";
}