Skip to content

Commit a8b24d8

Browse files
jypmaivantopo
authored andcommitted
Fix reporting of network activity on Linux
The current Kamon release doesn't seem to report network activity on Linux, in docker or outside. This may be related with the "updateAttributes()" method in OSHI not being invoked. A local experiment confirmed that OSHI will indeed report an unchanging value for e.g. `getBytesRecv()`, unless `updateAttributes()` is invoked first. Hence, this should probably get things working again.
1 parent 0e050fd commit a8b24d8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

instrumentation/kamon-system-metrics/src/main/scala/kamon/instrumentation/system/host/HostMetricsCollector.scala

+1
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ class HostMetricsCollector(ec: ExecutionContext) extends ScheduledAction {
221221

222222
interfaces.asScala.foreach(interface => {
223223
if (_settings.trackedInterfaces.accept(interface.getName)) {
224+
interface.updateAttributes()
224225
val interfaceInstruments = _networkActivityInstruments.interfaceInstruments(interface.getName)
225226
interfaceInstruments.receivedBytes.diff(interface.getBytesRecv)
226227
interfaceInstruments.sentBytes.diff(interface.getBytesSent)

0 commit comments

Comments
 (0)