public void Enrich(IHaveMeta obj) { var attributes = _assembly.CustomAttributes.Where(x => x.AttributeType.Name.StartsWith("Assembly")); foreach (var attributeData in attributes) { var key = Key(attributeData); var value = Value(attributeData); obj.AddMeta(key, value); } }
protected void EnrichMessage(IHaveMeta message) { if (message == null) { return; } foreach (var enricher in Enrichers) { enricher.Enrich(message); } }
public void Enrich(IHaveMeta obj) { if (obj == null) { return; } foreach (var key in _keys) { if (!obj.Meta.ContainsKey(key) || _overrideDefault) { obj.AddMeta(key, _metaDataCache[key]); } } }
public void Enrich(IHaveMeta obj) { AddHostName(obj); AddMachineName(obj); }
private static void AddHostName(IHaveMeta obj) { var hostName = Dns.GetHostName(); obj.AddMeta("host_name", hostName); }
private void AddMachineName(IHaveMeta obj) { var machineName = Environment.MachineName; obj.AddMeta("machine_name", machineName); }