Skip to content

Commit

Permalink
Fix reporting of network activity on Linux
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jypma authored and ivantopo committed May 12, 2022
1 parent 0e050fd commit a8b24d8
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ class HostMetricsCollector(ec: ExecutionContext) extends ScheduledAction {

interfaces.asScala.foreach(interface => {
if (_settings.trackedInterfaces.accept(interface.getName)) {
interface.updateAttributes()
val interfaceInstruments = _networkActivityInstruments.interfaceInstruments(interface.getName)
interfaceInstruments.receivedBytes.diff(interface.getBytesRecv)
interfaceInstruments.sentBytes.diff(interface.getBytesSent)
Expand Down

0 comments on commit a8b24d8

Please sign in to comment.