influxdata / helm-charts

Official Helm Chart Repository for InfluxData Applications
MIT License
233 stars 330 forks source link

[telegraf-ds] inputs.net provides no data #636

Open yellowpattern opened 7 months ago

yellowpattern commented 7 months ago

After getting telegraf to start providing data as a daemon set, I then tried to get some network information (it isn't included in the default set of metrics) by adding this to the configMap:

[[inputs.net]]
  ignore_protocol_stats = true
  interfaces = [ "ens*"]

But there's nothing. No output anywhere.

yellowpattern commented 7 months ago

Sorry, I lie, I get statistics for "eth0" but not the physical interfaces.

yellowpattern commented 7 months ago

If I add:

...
      volumeMounts:
        - name: procnet
          mountPath: /tmp/net
...
      volumes:
        - name: procnet
          hostPath:
            path: /proc/net
            type: ''

Then I can see the real devices in /tmp/net/dev but I can't mount that in /proc/net.

yellowpattern commented 7 months ago

The config sets HOST_PROC to be /hostfs/proc BUT /hostfs/proc/net/dev is the same as /proc/net/dev. Problem: /proc can't be ounted under /proc. Fixing this requires something like https://github.com/shirou/gopsutil/issues/1625

yellowpattern commented 7 months ago

I found a way...

spec:
...
  template:
...
    spec:
...
      volumeMounts:
        - name: procnet
          mountPath: /hostfs/proc/net
...
      volumes:
        - name: procnet
          hostPath:
            path: /proc/net
            type: ''