private DiagnosticSourceAdapter(IMeasureCounterMetrics counter, DiagnosticSourceAdapterOptions options)
        {
            _options = options;
            _metric  = counter;

            var newListenerObserver = new NewListenerObserver(OnNewListener);

            _newListenerSubscription = DiagnosticListener.AllListeners.Subscribe(newListenerObserver);
        }
 /// <summary>
 /// Starts listening for DiagnosticSource events and reporting them as Prometheus metrics.
 /// Dispose of the return value to stop listening.
 /// </summary>
 public static IDisposable StartListening(IMetricsRoot metrics, DiagnosticSourceAdapterOptions options) => new DiagnosticSourceAdapter(metrics.Measure.Counter, options);