diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2015-02-14 11:04:22 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2015-02-14 11:31:22 +0100 |
commit | 073713256939dac73d318faa9cabc3c8c93c5713 (patch) | |
tree | 0ce0afd53229dce4c059deebf5bb67411d554e1b /kamon-core/src/main/scala/kamon | |
parent | 07fc83bb01c5873b47aff50d6d3abbb9f11842bd (diff) | |
download | Kamon-073713256939dac73d318faa9cabc3c8c93c5713.tar.gz Kamon-073713256939dac73d318faa9cabc3c8c93c5713.tar.bz2 Kamon-073713256939dac73d318faa9cabc3c8c93c5713.zip |
! core: special treatment of settings.
Diffstat (limited to 'kamon-core/src/main/scala/kamon')
3 files changed, 15 insertions, 6 deletions
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) } } |