-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -190,7 +190,7 @@ monitors: | |
simple: | ||
sources: | ||
# Name;PacketsOutboundDiscarded;PacketsReceivedDiscarded;PacketsSentPersec;PacketsReceivedPersec;PacketsOutboundErrors;PacketsReceivedErrors | ||
networkInformation: | ||
networkInterfacePrefs: | ||
type: wmi | ||
namespace: root\CIMv2 | ||
query: > | ||
|
@@ -204,19 +204,49 @@ monitors: | |
BytesSentPerSec, | ||
BytesReceivedPerSec | ||
FROM Win32_PerfRawData_Tcpip_NetworkInterface | ||
computes: | ||
- type: duplicateColumn | ||
column: 1 | ||
- type: awk | ||
script: 'BEGIN {FS=OFS=";"} {gsub(/[^a-zA-Z0-9]/, " ", $2); print $0}' | ||
# Name;IpAddress | ||
networkAdapters: | ||
type: wmi | ||
namespace: root\CIMv2 | ||
query: > | ||
SELECT Description, | ||
IPAddress | ||
FROM Win32_NetworkAdapterConfiguration | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
So:
Prometheus' |
||
computes: | ||
- type: duplicateColumn | ||
column: 1 | ||
- type: awk | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. This awk script can be replaced with a simple - replace: "|"
- replaceBy: " "
- column: 4 (or you could combine all 4 compute steps into a single AWK script) |
||
script: 'BEGIN {FS=OFS=";"} {gsub(/\|/, " ", $4); print $0}' | ||
networkInformation: | ||
type: tableJoin | ||
leftTable: ${source::networkAdapters} | ||
rightTable: ${source::networkInterfacePrefs} | ||
leftKeyColumn: 2 | ||
rightKeyColumn: 2 | ||
defaultRightLine: ;;;;;;;; | ||
mapping: | ||
source: ${source::networkInformation} | ||
attributes: | ||
id: $1 | ||
id: $2 | ||
ip: $4 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 See: https://opentelemetry.io/docs/specs/semconv/attributes-registry/network/ |
||
metrics: | ||
system.network.dropped{network.io.direction="transmit"}: $2 | ||
system.network.dropped{network.io.direction="receive"}: $3 | ||
system.network.packets{network.io.direction="transmit"}: $4 | ||
system.network.packets{network.io.direction="receive"}: $5 | ||
system.network.errors{network.io.direction="transmit"}: $6 | ||
system.network.errors{network.io.direction="receive"}: $7 | ||
system.network.io{network.io.direction="transmit"}: $8 | ||
system.network.io{network.io.direction="receive"}: $9 | ||
system.network.dropped{network.io.direction="transmit"}: $7 | ||
system.network.dropped{network.io.direction="receive"}: $8 | ||
system.network.packets{network.io.direction="transmit"}: $9 | ||
system.network.packets{network.io.direction="receive"}: $10 | ||
system.network.errors{network.io.direction="transmit"}: $11 | ||
system.network.errors{network.io.direction="receive"}: $12 | ||
system.network.io{network.io.direction="transmit"}: $13 | ||
system.network.io{network.io.direction="receive"}: $14 | ||
physical_disk: | ||
simple: | ||
sources: | ||
|
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.