<PackageReference Include="Relativity.Server.Import.SDK" Version="2.9.2" />

MetricService

public class MetricService : IMetricService
using Microsoft.VisualBasic.CompilerServices; using Relativity.DataExchange.Logger; using Relativity.DataExchange.Service; using System; using System.Collections.Generic; using System.IO; using System.Runtime.CompilerServices; namespace Monitoring.Sinks { public class MetricService : IMetricService { private readonly List<IMetricSink> _sinks; [CompilerGenerated] private IMetricSinkConfig _MetricSinkConfig; public IMetricSinkConfig MetricSinkConfig { get; } public MetricService(IMetricSinkConfig metricSinkConfig) { _MetricSinkConfig = metricSinkConfig; _sinks = new List<IMetricSink>(); } public MetricService(IMetricSinkConfig metricSinkConfig, IKeplerProxy keplerProxy) { _MetricSinkConfig = metricSinkConfig; _sinks = new List<IMetricSink> { new MetricSinkApm(keplerProxy, MetricSinkConfig.SendApmMetrics), new MetricSinkSum(keplerProxy, new SumMetricFormatter(), MetricSinkConfig.SendSumMetrics), new MetricSinkRelativityLogging(RelativityLogger.Instance.get_IsEnabled()) }; } public void Log(MetricBase metric) { foreach (IMetricSink sink in _sinks) { if (sink.IsEnabled) try { sink.Log(metric); } catch (Exception ex) { ProjectData.SetProjectError(ex); Exception ex2 = ex; RelativityLogger.Instance.LogWarning(ex2, "Failed to submit {metricType}", new object[1] { metric.GetType() }); if (ex2 is FileNotFoundException) throw; ProjectData.ClearProjectError(); } } } void IMetricService.Log(MetricBase metric) { this.Log(metric); } } }