Skip to content
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

Update procfs to 0.15.1 and fix compilation errors #3045

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 28 additions & 18 deletions collector/fibrechannel_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ func (c *fibrechannelCollector) pushMetric(ch chan<- prometheus.Metric, name str
ch <- prometheus.MustNewConstMetric(c.metricDescs[name], valueType, float64(value), host)
}

func (c *fibrechannelCollector) pushCounter(ch chan<- prometheus.Metric, name string, value uint64, host string) {
func (c *fibrechannelCollector) pushCounter(ch chan<- prometheus.Metric, name string, value *uint64, host string) {
// Don't push counters that aren't implemented (a counter equal to maxUint64 is unimplemented by the HBA firmware)
if value != maxUint64 {
c.pushMetric(ch, name, value, host, prometheus.CounterValue)
if value != nil && *value != maxUint64 {
c.pushMetric(ch, name, *value, host, prometheus.CounterValue)
}
}

Expand All @@ -114,24 +114,34 @@ func (c *fibrechannelCollector) Update(ch chan<- prometheus.Metric) error {
infoValue := 1.0

// First push the Host values
ch <- prometheus.MustNewConstMetric(infoDesc, prometheus.GaugeValue, infoValue, host.Name, host.Speed, host.PortState, host.PortType, host.PortID, host.PortName, host.FabricName, host.SymbolicName, host.SupportedClasses, host.SupportedSpeeds, host.DevLossTMO)
ch <- prometheus.MustNewConstMetric(infoDesc, prometheus.GaugeValue, infoValue,
nilToEmpty(host.Name), nilToEmpty(host.Speed), nilToEmpty(host.PortState), nilToEmpty(host.PortType),
nilToEmpty(host.PortID), nilToEmpty(host.PortName), nilToEmpty(host.FabricName), nilToEmpty(host.SymbolicName),
nilToEmpty(host.SupportedClasses), nilToEmpty(host.SupportedSpeeds), nilToEmpty(host.DevLossTMO))

// Then the counters
c.pushCounter(ch, "dumped_frames_total", host.Counters.DumpedFrames, host.Name)
c.pushCounter(ch, "error_frames_total", host.Counters.ErrorFrames, host.Name)
c.pushCounter(ch, "invalid_crc_total", host.Counters.InvalidCRCCount, host.Name)
c.pushCounter(ch, "rx_frames_total", host.Counters.RXFrames, host.Name)
c.pushCounter(ch, "rx_words_total", host.Counters.RXWords, host.Name)
c.pushCounter(ch, "tx_frames_total", host.Counters.TXFrames, host.Name)
c.pushCounter(ch, "tx_words_total", host.Counters.TXWords, host.Name)
c.pushCounter(ch, "seconds_since_last_reset_total", host.Counters.SecondsSinceLastReset, host.Name)
c.pushCounter(ch, "invalid_tx_words_total", host.Counters.InvalidTXWordCount, host.Name)
c.pushCounter(ch, "link_failure_total", host.Counters.LinkFailureCount, host.Name)
c.pushCounter(ch, "loss_of_sync_total", host.Counters.LossOfSyncCount, host.Name)
c.pushCounter(ch, "loss_of_signal_total", host.Counters.LossOfSignalCount, host.Name)
c.pushCounter(ch, "nos_total", host.Counters.NosCount, host.Name)
c.pushCounter(ch, "fcp_packet_aborts_total", host.Counters.FCPPacketAborts, host.Name)
c.pushCounter(ch, "dumped_frames_total", host.Counters.DumpedFrames, nilToEmpty(host.Name))
c.pushCounter(ch, "error_frames_total", host.Counters.ErrorFrames, nilToEmpty(host.Name))
c.pushCounter(ch, "invalid_crc_total", host.Counters.InvalidCRCCount, nilToEmpty(host.Name))
c.pushCounter(ch, "rx_frames_total", host.Counters.RXFrames, nilToEmpty(host.Name))
c.pushCounter(ch, "rx_words_total", host.Counters.RXWords, nilToEmpty(host.Name))
c.pushCounter(ch, "tx_frames_total", host.Counters.TXFrames, nilToEmpty(host.Name))
c.pushCounter(ch, "tx_words_total", host.Counters.TXWords, nilToEmpty(host.Name))
c.pushCounter(ch, "seconds_since_last_reset_total", host.Counters.SecondsSinceLastReset, nilToEmpty(host.Name))
c.pushCounter(ch, "invalid_tx_words_total", host.Counters.InvalidTXWordCount, nilToEmpty(host.Name))
c.pushCounter(ch, "link_failure_total", host.Counters.LinkFailureCount, nilToEmpty(host.Name))
c.pushCounter(ch, "loss_of_sync_total", host.Counters.LossOfSyncCount, nilToEmpty(host.Name))
c.pushCounter(ch, "loss_of_signal_total", host.Counters.LossOfSignalCount, nilToEmpty(host.Name))
c.pushCounter(ch, "nos_total", host.Counters.NosCount, nilToEmpty(host.Name))
c.pushCounter(ch, "fcp_packet_aborts_total", host.Counters.FCPPacketAborts, nilToEmpty(host.Name))
}

return nil
}

func nilToEmpty(s *string) string {
if s == nil {
return ""
}
return *s
}
50 changes: 30 additions & 20 deletions collector/fixtures/e2e-64k-page-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2225,44 +2225,54 @@ node_mountstats_nfs_total_write_bytes_total{export="192.168.1.1:/srv/test",mount
node_mountstats_nfs_total_write_bytes_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="udp"} 0
# HELP node_mountstats_nfs_transport_backlog_queue_total Total number of items added to the RPC backlog queue.
# TYPE node_mountstats_nfs_transport_backlog_queue_total counter
node_mountstats_nfs_transport_backlog_queue_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="tcp"} 0
node_mountstats_nfs_transport_backlog_queue_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="udp"} 0
node_mountstats_nfs_transport_backlog_queue_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="689",protocol="tcp"} 0
node_mountstats_nfs_transport_backlog_queue_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="tcp"} 0
node_mountstats_nfs_transport_backlog_queue_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="udp"} 0
# HELP node_mountstats_nfs_transport_bad_transaction_ids_total Number of times the NFS server sent a response with a transaction ID unknown to this client.
# TYPE node_mountstats_nfs_transport_bad_transaction_ids_total counter
node_mountstats_nfs_transport_bad_transaction_ids_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="tcp"} 0
node_mountstats_nfs_transport_bad_transaction_ids_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="udp"} 0
node_mountstats_nfs_transport_bad_transaction_ids_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="689",protocol="tcp"} 0
node_mountstats_nfs_transport_bad_transaction_ids_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="tcp"} 0
node_mountstats_nfs_transport_bad_transaction_ids_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="udp"} 0
# HELP node_mountstats_nfs_transport_bind_total Number of times the client has had to establish a connection from scratch to the NFS server.
# TYPE node_mountstats_nfs_transport_bind_total counter
node_mountstats_nfs_transport_bind_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="tcp"} 0
node_mountstats_nfs_transport_bind_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="udp"} 0
node_mountstats_nfs_transport_bind_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="689",protocol="tcp"} 1
node_mountstats_nfs_transport_bind_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="tcp"} 0
node_mountstats_nfs_transport_bind_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="udp"} 0
# HELP node_mountstats_nfs_transport_connect_total Number of times the client has made a TCP connection to the NFS server.
# TYPE node_mountstats_nfs_transport_connect_total counter
node_mountstats_nfs_transport_connect_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="tcp"} 1
node_mountstats_nfs_transport_connect_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="udp"} 0
node_mountstats_nfs_transport_connect_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="689",protocol="tcp"} 2
node_mountstats_nfs_transport_connect_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="tcp"} 1
node_mountstats_nfs_transport_connect_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="udp"} 0
# HELP node_mountstats_nfs_transport_idle_time_seconds Duration since the NFS mount last saw any RPC traffic, in seconds.
# TYPE node_mountstats_nfs_transport_idle_time_seconds gauge
node_mountstats_nfs_transport_idle_time_seconds{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="tcp"} 11
node_mountstats_nfs_transport_idle_time_seconds{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="udp"} 0
node_mountstats_nfs_transport_idle_time_seconds{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="689",protocol="tcp"} 0
node_mountstats_nfs_transport_idle_time_seconds{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="tcp"} 11
node_mountstats_nfs_transport_idle_time_seconds{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="udp"} 0
# HELP node_mountstats_nfs_transport_maximum_rpc_slots Maximum number of simultaneously active RPC requests ever used.
# TYPE node_mountstats_nfs_transport_maximum_rpc_slots gauge
node_mountstats_nfs_transport_maximum_rpc_slots{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="tcp"} 24
node_mountstats_nfs_transport_maximum_rpc_slots{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="udp"} 24
node_mountstats_nfs_transport_maximum_rpc_slots{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="689",protocol="tcp"} 10
node_mountstats_nfs_transport_maximum_rpc_slots{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="tcp"} 24
node_mountstats_nfs_transport_maximum_rpc_slots{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="udp"} 24
# HELP node_mountstats_nfs_transport_pending_queue_total Total number of items added to the RPC transmission pending queue.
# TYPE node_mountstats_nfs_transport_pending_queue_total counter
node_mountstats_nfs_transport_pending_queue_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="tcp"} 5726
node_mountstats_nfs_transport_pending_queue_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="udp"} 5726
node_mountstats_nfs_transport_pending_queue_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="689",protocol="tcp"} 22129
node_mountstats_nfs_transport_pending_queue_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="tcp"} 5726
node_mountstats_nfs_transport_pending_queue_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="udp"} 5726
# HELP node_mountstats_nfs_transport_receives_total Number of RPC responses for this mount received from the NFS server.
# TYPE node_mountstats_nfs_transport_receives_total counter
node_mountstats_nfs_transport_receives_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="tcp"} 6428
node_mountstats_nfs_transport_receives_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="udp"} 6428
node_mountstats_nfs_transport_receives_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="689",protocol="tcp"} 2818
node_mountstats_nfs_transport_receives_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="tcp"} 6428
node_mountstats_nfs_transport_receives_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="udp"} 6428
# HELP node_mountstats_nfs_transport_sending_queue_total Total number of items added to the RPC transmission sending queue.
# TYPE node_mountstats_nfs_transport_sending_queue_total counter
node_mountstats_nfs_transport_sending_queue_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="tcp"} 26
node_mountstats_nfs_transport_sending_queue_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="udp"} 26
node_mountstats_nfs_transport_sending_queue_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="689",protocol="tcp"} 0
node_mountstats_nfs_transport_sending_queue_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="tcp"} 26
node_mountstats_nfs_transport_sending_queue_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="udp"} 26
# HELP node_mountstats_nfs_transport_sends_total Number of RPC requests for this mount sent to the NFS server.
# TYPE node_mountstats_nfs_transport_sends_total counter
node_mountstats_nfs_transport_sends_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="tcp"} 6428
node_mountstats_nfs_transport_sends_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="udp"} 6428
node_mountstats_nfs_transport_sends_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="689",protocol="tcp"} 2826
node_mountstats_nfs_transport_sends_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="tcp"} 6428
node_mountstats_nfs_transport_sends_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",port="832",protocol="udp"} 6428
# HELP node_mountstats_nfs_write_bytes_total Number of bytes written using the write() syscall.
# TYPE node_mountstats_nfs_write_bytes_total counter
node_mountstats_nfs_write_bytes_total{export="192.168.1.1:/srv/test",mountaddr="192.168.1.1",protocol="tcp"} 0
Expand Down
Loading