From 0f9886f07622bfe7947114c04ae0aff62d9cb080 Mon Sep 17 00:00:00 2001 From: Sander Saares Date: Mon, 23 Dec 2019 06:26:35 +0000 Subject: [PATCH] Main logic touchup --- ExporterLogic.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ExporterLogic.cs b/ExporterLogic.cs index ff2d146..1ae03c7 100644 --- a/ExporterLogic.cs +++ b/ExporterLogic.cs @@ -33,11 +33,9 @@ namespace DockerExporter Metrics.DefaultRegistry.AddBeforeCollectCallback(UpdateMetrics); + var server = new MetricServer(9417); #if DEBUG - var server = new MetricServer("localhost", 3652); - _log.Info($"Open http://localhost:3652/metrics to initiate a probe."); -#else - var server = new MetricServer(80); + _log.Info($"Open http://localhost:9417/metrics to initiate a probe."); #endif server.Start(); @@ -98,10 +96,10 @@ namespace DockerExporter } catch (Exception ex) { - // TODO: Now what? If we throw here prometheus-net will just reject the scrape... - // ... but what if this is a fatal error that we want to crash the app with? + // Errors that reach this point are fatal errors that we should never hide. _log.Error(Helpers.Debug.GetAllExceptionMessages(ex)); - Debugger.Break(); + _log.Error(ex.ToString()); + Environment.Exit(-1); } }