diff options
Diffstat (limited to 'kamon-core/src')
4 files changed, 30 insertions, 35 deletions
diff --git a/kamon-core/src/main/resources/reference.conf b/kamon-core/src/main/resources/reference.conf index 746652eb..a648c01a 100644 --- a/kamon-core/src/main/resources/reference.conf +++ b/kamon-core/src/main/resources/reference.conf @@ -82,15 +82,6 @@ kamon { instrument-settings { } - - dispatchers { - - # Dispatcher for the actor that will collect all recorded metrics on every tick and dispatch them to all subscribers. - metric-collection = kamon.default-dispatcher - - # Dispatcher for the Kamon refresh scheduler, used by all MinMaxCounters and Gaugues to update their values. - refresh-scheduler = kamon.default-dispatcher - } } @@ -140,35 +131,30 @@ kamon { # open after this point. max-incubation-time = 20 seconds } - - # Default dispatcher for all trace module operations - dispatcher = kamon.default-dispatcher } - default-dispatcher { - # Dispatcher is the name of the event-based dispatcher - type = Dispatcher - # What kind of ExecutionService to use - executor = "fork-join-executor" + # All settings included under the internal-config key will be used to repleace the akka.* and spray.* settings. By + # doing this we avoid applying custom settings that might make sense for the user application to the internal actor + # system and Spray facilities used by Kamon. + internal-config { - # Configuration for the fork join pool - fork-join-executor { - # Min number of threads to cap factor-based parallelism number to - parallelism-min = 2 + akka.actor.default-dispatcher { + fork-join-executor { + parallelism-min = 2 + parallelism-factor = 2.0 + parallelism-max = 10 + } + } - # The parallelism factor is used to determine thread pool size using the - # following formula: ceil(available processors * factor). Resulting size - # is then bounded by the parallelism-min and parallelism-max values. - parallelism-factor = 2.0 + spray { - # Max number of threads to cap factor-based parallelism number to - parallelism-max = 10 } } - - disable-aspectj-missing-warning = false + # Controls whether the AspectJ Weaver missing warning should be displayed if any Kamon module requiring AspectJ is + # found in the classpath but the application is started without the AspectJ Weaver. + show-aspectj-missing-warning = yes modules { # Just a place holder to ensure that the key is always available. Non-core Kamon modules should provide their diff --git a/kamon-core/src/main/scala/kamon/Kamon.scala b/kamon-core/src/main/scala/kamon/Kamon.scala index 2bed4737..ab9ce05e 100644 --- a/kamon-core/src/main/scala/kamon/Kamon.scala +++ b/kamon-core/src/main/scala/kamon/Kamon.scala @@ -32,13 +32,22 @@ object Kamon { @volatile private var _coreComponents: Option[KamonCoreComponents] = None def start(config: Config): Unit = synchronized { + def resolveInternalConfig: Config = { + val internalConfig = config.getConfig("kamon.internal-config") + + config + .withoutPath("akka") + .withoutPath("spray") + .withFallback(internalConfig) + } + if (_coreComponents.isEmpty) { val metrics = MetricsExtensionImpl(config) val simpleMetrics = UserMetricsExtensionImpl(metrics) val tracer = TracerExtensionImpl(metrics, config) _coreComponents = Some(KamonCoreComponents(metrics, tracer, simpleMetrics)) - _system = ActorSystem("kamon", config) + _system = ActorSystem("kamon", resolveInternalConfig) metrics.start(_system) tracer.start(_system) diff --git a/kamon-core/src/main/scala/kamon/supervisor/ModuleSupervisorExtension.scala b/kamon-core/src/main/scala/kamon/supervisor/ModuleSupervisorExtension.scala index e47d0216..ddce63fb 100644 --- a/kamon-core/src/main/scala/kamon/supervisor/ModuleSupervisorExtension.scala +++ b/kamon-core/src/main/scala/kamon/supervisor/ModuleSupervisorExtension.scala @@ -62,7 +62,7 @@ class KamonSupervisor(settings: ModuleSupervisorSettings, dynamicAccess: Dynamic } getOrElse (childPromise.complete(Success(context.actorOf(props, name)))) def init(): Unit = { - if (settings.modulesRequiringAspectJ.nonEmpty && !isAspectJPresent && !settings.disableAspectJMissingWarning) + if (settings.modulesRequiringAspectJ.nonEmpty && !isAspectJPresent && settings.showAspectJMissingWarning) logAspectJWeaverMissing(settings.modulesRequiringAspectJ) // Force initialization of all modules marked with auto-start. @@ -106,7 +106,7 @@ class KamonSupervisor(settings: ModuleSupervisorSettings, dynamicAccess: Dynamic | | If you need help on setting up the aspectj weaver go to http://kamon.io/introduction/get-started/ for more info. On the | other hand, if you are sure that you do not need or do not want to use the weaver then you can disable this error message - | by changing the kamon.disable-aspectj-missing-warning setting in your configuration file. + | by changing the kamon.show-aspectj-missing-warning setting in your configuration file. | """.stripMargin diff --git a/kamon-core/src/main/scala/kamon/supervisor/ModuleSupervisorSettings.scala b/kamon-core/src/main/scala/kamon/supervisor/ModuleSupervisorSettings.scala index 1b7d8a2e..c04157aa 100644 --- a/kamon-core/src/main/scala/kamon/supervisor/ModuleSupervisorSettings.scala +++ b/kamon-core/src/main/scala/kamon/supervisor/ModuleSupervisorSettings.scala @@ -19,7 +19,7 @@ package kamon.supervisor import akka.actor.ActorSystem case class AvailableModuleInfo(name: String, extensionClass: String, requiresAspectJ: Boolean, autoStart: Boolean) -case class ModuleSupervisorSettings(disableAspectJMissingWarning: Boolean, availableModules: List[AvailableModuleInfo]) { +case class ModuleSupervisorSettings(showAspectJMissingWarning: Boolean, availableModules: List[AvailableModuleInfo]) { val modulesRequiringAspectJ = availableModules.filter(_.requiresAspectJ) } @@ -29,7 +29,7 @@ object ModuleSupervisorSettings { import kamon.util.ConfigTools.Syntax val config = system.settings.config.getConfig("kamon.modules") - val disableAspectJMissingWarning = system.settings.config.getBoolean("kamon.disable-aspectj-missing-warning") + val showAspectJMissingWarning = system.settings.config.getBoolean("kamon.show-aspectj-missing-warning") val modules = config.firstLevelKeys val availableModules = modules.map { moduleName ⇒ @@ -43,7 +43,7 @@ object ModuleSupervisorSettings { } toList - ModuleSupervisorSettings(disableAspectJMissingWarning, availableModules) + ModuleSupervisorSettings(showAspectJMissingWarning, availableModules) } } |