diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2017-06-19 11:50:34 +0200 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2017-06-19 11:50:34 +0200 |
commit | 7aeeedad6f6684f8aae018fbf433557b2a587172 (patch) | |
tree | de27e46123a0715849ff0606cadef98c197935a8 /kamon-core/src/main/scala/kamon/ReporterRegistry.scala | |
parent | 1d98b9e8a397acf8b6f6f55a3fd5189eb72740ba (diff) | |
download | Kamon-7aeeedad6f6684f8aae018fbf433557b2a587172.tar.gz Kamon-7aeeedad6f6684f8aae018fbf433557b2a587172.tar.bz2 Kamon-7aeeedad6f6684f8aae018fbf433557b2a587172.zip |
log reporter failures
Diffstat (limited to 'kamon-core/src/main/scala/kamon/ReporterRegistry.scala')
-rw-r--r-- | kamon-core/src/main/scala/kamon/ReporterRegistry.scala | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/kamon-core/src/main/scala/kamon/ReporterRegistry.scala b/kamon-core/src/main/scala/kamon/ReporterRegistry.scala index ae43ca3c..5f46edf6 100644 --- a/kamon-core/src/main/scala/kamon/ReporterRegistry.scala +++ b/kamon-core/src/main/scala/kamon/ReporterRegistry.scala @@ -109,6 +109,7 @@ class ReporterRegistryImpl(metrics: MetricsSnapshotGenerator, initialConfig: Con val executor = Executors.newSingleThreadExecutor(threadFactory(name)) val reporterEntry = new MetricReporterEntry( id = reporterCounter.getAndIncrement(), + name = name, reporter = reporter, executionContext = ExecutionContext.fromExecutorService(executor) ) @@ -127,6 +128,7 @@ class ReporterRegistryImpl(metrics: MetricsSnapshotGenerator, initialConfig: Con val executor = Executors.newSingleThreadExecutor(threadFactory(name)) val reporterEntry = new SpanReporterEntry( id = reporterCounter.incrementAndGet(), + name = name, reporter = reporter, bufferCapacity = registryConfiguration.traceReporterQueueSize, executionContext = ExecutionContext.fromExecutorService(executor) @@ -236,6 +238,7 @@ class ReporterRegistryImpl(metrics: MetricsSnapshotGenerator, initialConfig: Con private class MetricReporterEntry( @volatile var isActive: Boolean = true, val id: Long, + val name: String, val reporter: MetricReporter, val executionContext: ExecutionContextExecutorService ) @@ -243,6 +246,7 @@ class ReporterRegistryImpl(metrics: MetricsSnapshotGenerator, initialConfig: Con private class SpanReporterEntry( @volatile var isActive: Boolean = true, val id: Long, + val name: String, val reporter: SpanReporter, val bufferCapacity: Int, val executionContext: ExecutionContextExecutorService @@ -263,8 +267,13 @@ class ReporterRegistryImpl(metrics: MetricsSnapshotGenerator, initialConfig: Con reporterEntries.foreach { case (_, entry) => Future { - if(entry.isActive) - entry.reporter.reportTickSnapshot(tickSnapshot) + Try { + if (entry.isActive) + entry.reporter.reportTickSnapshot(tickSnapshot) + + }.failed.foreach { error => + logger.error(s"Reporter [${entry.name}] failed to process a metrics tick.", error) + } }(entry.executionContext) } |