/// <summary>
 ///     Closes the reporter for this tracer.
 /// </summary>
 public void Close()
 {
     reporter.Close();
     sdkMetricsRegistry?.Dispose();
     metricsScheduler?.Dispose();
     heartbeaterService?.Dispose();
 }
        public void Close()
        {
            sdkMetricsRegistry.Dispose();

            try
            {
                Flush();
            }
            catch (IOException e)
            {
                logger.LogWarning(0, e, "error flushing buffer");
            }

            timer.Dispose();
        }
        /// <summary>
        /// Flushes one last time before stopping the flushing of points on a regular interval.
        /// Closes the connection to the Wavefront proxy.
        /// </summary>
        public void Close()
        {
            sdkMetricsRegistry.Dispose();

            try
            {
                Flush();
            }
            catch (IOException e)
            {
                logger.LogWarning(0, e, "error flushing buffer");
            }

            timer.Dispose();

            try
            {
                metricsProxyConnectionHandler?.Close();
            }
            catch (IOException e)
            {
                logger.LogWarning(0, e, "error closing metricsProxyConnectionHandler");
            }

            try
            {
                histogramProxyConnectionHandler.Close();
            }
            catch (IOException e)
            {
                logger.LogWarning(0, e, "error closing histogramProxyConnectionHandler");
            }

            try
            {
                tracingProxyConnectionHandler.Close();
            }
            catch (IOException e)
            {
                logger.LogWarning(0, e, "error closing tracingProxyConnectionHandler");
            }
        }