Skip to content

Commit

Permalink
include exception in WARN messages about recording values beyond hist…
Browse files Browse the repository at this point in the history
…ogram range
  • Loading branch information
ivantopo committed Sep 30, 2019
1 parent 70808bc commit cc8d5bc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kamon-core/src/main/scala/kamon/metric/Histogram.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ object Histogram {
try {
recordValue(value)
} catch {
case _: ArrayIndexOutOfBoundsException =>
case e: ArrayIndexOutOfBoundsException =>
val highestTrackableValue = getHighestTrackableValue()
recordValue(highestTrackableValue)

_logger.warn (
s"Failed to record value [$value] on [${metric.name},${tags}] because the value is outside of the " +
s"configured range. The recorded value was adjusted to the highest trackable value [$highestTrackableValue]. " +
"You might need to change your dynamic range configuration for this metric"
"You might need to change your dynamic range configuration for this metric", e
)
}

Expand All @@ -81,14 +81,14 @@ object Histogram {
try {
recordValueWithCount(value, times)
} catch {
case _: ArrayIndexOutOfBoundsException =>
case e: ArrayIndexOutOfBoundsException =>
val highestTrackableValue = getHighestTrackableValue()
recordValueWithCount(highestTrackableValue, times)

_logger.warn (
s"Failed to record value [$value] on [${metric.name},${tags}] because the value is outside of the " +
s"configured range. The recorded value was adjusted to the highest trackable value [$highestTrackableValue]. " +
"You might need to change your dynamic range configuration for this metric"
"You might need to change your dynamic range configuration for this metric", e
)
}

Expand Down

0 comments on commit cc8d5bc

Please sign in to comment.