Added IP attribute when interface IP address is available#98
Added IP attribute when interface IP address is available#98MohammedSentry wants to merge 3 commits intomainfrom
Conversation
| sources: | ||
| # Name;PacketsOutboundDiscarded;PacketsReceivedDiscarded;PacketsSentPersec;PacketsReceivedPersec;PacketsOutboundErrors;PacketsReceivedErrors | ||
| networkInformation: | ||
| networkInterfacePrefs: |
There was a problem hiding this comment.
| networkInterfacePrefs: | |
| networkInterfacePerfs: |
| query: > | ||
| SELECT Description, | ||
| IPAddress | ||
| FROM Win32_NetworkAdapterConfiguration |
There was a problem hiding this comment.
Win32_NetworkAdapterConfiguration lists all network adapters (incl. many WAN and virtual network cards), while Win32_PerfRawData_Tcpip_NetworkInterface lists only network interfaces (Windows makes a slight difference between the 2 concepts).
So:
- you either join
Win32_NetworkAdapterConfigurationwithWin32_PerfRawData_Tcpip_NetworkAdapter, and provide performance information for all "adapters", including WAN miniports and virtual cards, - or join
Win32_PerfRawData_Tcpip_NetworkInterface(left) withWin32_NetworkAdapterConfiguration(right) to make sure only the physical interfaces are listed in the result of the join operation
Prometheus' windows_exporter seems to have chosen the 2nd option, so that's our preferred one to!
| script: 'BEGIN {FS=OFS=";"} {gsub(/[^a-zA-Z0-9]/, " ", $2); print $0}' | ||
| - type: duplicateColumn | ||
| column: 3 | ||
| - type: awk |
There was a problem hiding this comment.
This awk script can be replaced with a simple Replace compute step:
- replace: "|"
- replaceBy: " "
- column: 4(or you could combine all 4 compute steps into a single AWK script)
| attributes: | ||
| id: $1 | ||
| id: $2 | ||
| ip: $4 |
There was a problem hiding this comment.
In Otel semantic conventions, the IP addresses is to be represented with the network.local.address attribute.
See: https://opentelemetry.io/docs/specs/semconv/attributes-registry/network/
No description provided.