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); } }
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]); } } }
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); }