Skip to content

Spurious warning "Failed to load the instrumentation modules status because the Kanela agent is not available" #1422

@agido-schallaboeck

Description

@agido-schallaboeck

When starting our applications, we get a warning Failed to load the instrumentation modules status because the Kanela agent is not available (once). Despite the message, metrics seem to be working fine.

The warning is logged in kamon.status.InstrumentationStatus#create

      case t: Throwable =>
        if (warnIfFailed || true) {
          t match {
            case _: ClassNotFoundException =>
              _logger.warn(
                "Failed to load the instrumentation modules status because the Kanela agent is not available"
              )

Both places calling this method pass in warnIfFailed = false, but this is ignored because of the || true. I'm assuming this is just debugging code that made it into a release (in commit c06913a) @ivantopo?

diff --git a/core/kamon-core/src/main/scala/kamon/status/InstrumentationStatus.scala b/core/kamon-core/src/main/scala/kamon/status/InstrumentationStatus.scala
index fe54ffa3..fea6b0c0 100644
--- a/core/kamon-core/src/main/scala/kamon/status/InstrumentationStatus.scala
+++ b/core/kamon-core/src/main/scala/kamon/status/InstrumentationStatus.scala
@@ -65,7 +65,7 @@ object InstrumentationStatus {
       Status.Instrumentation(present, Option(kanelaVersion), modules.toSeq)
     } catch {
       case t: Throwable =>
-        if (warnIfFailed || true) {
+        if (warnIfFailed) {
           t match {
             case _: ClassNotFoundException =>
               _logger.warn(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions