Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update initial config code ignore unresolved configs #409

Merged
merged 1 commit into from Nov 5, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions kamon-core/src/main/scala/kamon/Kamon.scala
Expand Up @@ -16,7 +16,7 @@ package kamon

import _root_.akka.actor
import _root_.akka.actor._
import com.typesafe.config.{ Config, ConfigFactory }
import com.typesafe.config.{ Config, ConfigFactory, ConfigParseOptions, ConfigResolveOptions }
import kamon.metric._
import kamon.trace.TracerModuleImpl
import kamon.util.logger.LazyLogger
Expand Down Expand Up @@ -76,10 +76,10 @@ object Kamon {
}

private def resolveConfiguration: Config = {
val defaultConfig = ConfigFactory.load()
val defaultConfig = ConfigFactory.load(this.getClass.getClassLoader, ConfigParseOptions.defaults(), ConfigResolveOptions.defaults().setAllowUnresolved(true))

defaultConfig.getString("kamon.config-provider") match {
case "default" ⇒ defaultConfig
case "default" ⇒ defaultConfig.resolve()
case fqcn ⇒
val dynamic = new ReflectiveDynamicAccess(getClass.getClassLoader)
dynamic.createInstanceFor[ConfigProvider](fqcn, Nil).get.config
Expand Down