-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added IP attribute when interface IP address is available #98
base: main
Are you sure you want to change the base?
Conversation
@@ -190,7 +190,7 @@ monitors: | |||
simple: | |||
sources: | |||
# Name;PacketsOutboundDiscarded;PacketsReceivedDiscarded;PacketsSentPersec;PacketsReceivedPersec;PacketsOutboundErrors;PacketsReceivedErrors | |||
networkInformation: | |||
networkInterfacePrefs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
networkInterfacePrefs: | |
networkInterfacePerfs: |
query: > | ||
SELECT Description, | ||
IPAddress | ||
FROM Win32_NetworkAdapterConfiguration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_NetworkAdapterConfiguration
withWin32_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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
mapping: | ||
source: ${source::networkInformation} | ||
attributes: | ||
id: $1 | ||
id: $2 | ||
ip: $4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.