Skip to content

Commit 6b0156e

Browse files
metrics docu
1 parent a219f70 commit 6b0156e

File tree

4 files changed

+26
-90
lines changed

4 files changed

+26
-90
lines changed

internal/openmetrics-exporter/drives_collector.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package collectors
22

3-
43
import (
4+
client "purestorage/fa-openmetrics-exporter/internal/rest-client"
5+
56
"github.com/prometheus/client_golang/prometheus"
6-
"purestorage/fa-openmetrics-exporter/internal/rest-client"
77
)
88

99
type DriveCollector struct {
10-
CapacityDesc *prometheus.Desc
11-
Client *client.FAClient
10+
CapacityDesc *prometheus.Desc
11+
Client *client.FAClient
1212
}
1313

1414
func (c *DriveCollector) Describe(ch chan<- *prometheus.Desc) {
@@ -27,7 +27,7 @@ func (c *DriveCollector) Collect(ch chan<- prometheus.Metric) {
2727
d.Capacity,
2828
d.Name, d.Type, d.Status, d.Protocol,
2929
)
30-
}
30+
}
3131
}
3232

3333
func NewDriveCollector(fa *client.FAClient) *DriveCollector {

internal/openmetrics-exporter/network_interfaces_collector.go

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ import (
99
)
1010

1111
type NetworkInterfacesCollector struct {
12-
NetworkInterfaceEthInfoDesc *prometheus.Desc
13-
NetworkInterfaceFcInfoDesc *prometheus.Desc
14-
Client *client.FAClient
12+
NetworkInterfaceInfoDesc *prometheus.Desc
13+
Client *client.FAClient
1514
}
1615

1716
func (c *NetworkInterfacesCollector) Describe(ch chan<- *prometheus.Desc) {
@@ -24,40 +23,23 @@ func (c *NetworkInterfacesCollector) Collect(ch chan<- prometheus.Metric) {
2423
return
2524
}
2625
for _, h := range nwl.Items {
27-
// if h.InterfaceType == "eth" {
2826
ch <- prometheus.MustNewConstMetric(
29-
c.NetworkInterfaceEthInfoDesc,
27+
c.NetworkInterfaceInfoDesc,
3028
prometheus.GaugeValue,
31-
1,
29+
float64(h.Speed),
3230
h.Name, strconv.FormatBool(h.Enabled), strings.Join(h.Services, ", "), h.InterfaceType, h.Eth.Subtype,
3331
)
34-
// }
35-
// if h.InterfaceType == "fc" {
36-
// ch <- prometheus.MustNewConstMetric(
37-
// c.NetworkInterfaceFcInfoDesc,
38-
// prometheus.GaugeValue,
39-
// 1,
40-
// h.Name, strconv.FormatBool(h.Enabled), strings.Join(h.Services, ", "), h.InterfaceType,
41-
// )
42-
// }
4332
}
4433
}
4534

4635
func NewNetworkInterfacesCollector(fa *client.FAClient) *NetworkInterfacesCollector {
4736
return &NetworkInterfacesCollector{
48-
NetworkInterfaceEthInfoDesc: prometheus.NewDesc(
49-
// "purefa_network_interface_eth_info",
50-
"purefa_network_interface_info",
51-
"FlashArray network interface ethernet info",
52-
[]string{"name", "enabled", "services", "interfacetype", "ethernetinterfacesubtype"},
37+
NetworkInterfaceInfoDesc: prometheus.NewDesc(
38+
"purefa_network_interface_speed_bandwidth_bytes",
39+
"FlashArray network interface speed in bytes per second",
40+
[]string{"name", "enabled", "services", "type", "ethsubtype"},
5341
prometheus.Labels{},
5442
),
55-
// NetworkInterfaceFcInfoDesc: prometheus.NewDesc(
56-
// "purefa_network_interface_fc_info",
57-
// "FlashArray network interface fc info",
58-
// []string{"name", "enabled", "services", "interfacetype"},
59-
// prometheus.Labels{},
60-
// ),
6143
Client: fa,
6244
}
6345
}

internal/openmetrics-exporter/ports_collector.go

Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ import (
88

99
type PortsCollector struct {
1010
PortInfoDesc *prometheus.Desc
11-
// PortiSCSIInfoDesc *prometheus.Desc
12-
// PortNVMeTCPInfoDesc *prometheus.Desc
13-
// PortNVMeFCInfoDesc *prometheus.Desc
14-
// PortFCInfoDesc *prometheus.Desc
15-
Client *client.FAClient
11+
Client *client.FAClient
1612
}
1713

1814
func (c *PortsCollector) Describe(ch chan<- *prometheus.Desc) {
@@ -25,73 +21,23 @@ func (c *PortsCollector) Collect(ch chan<- prometheus.Metric) {
2521
return
2622
}
2723
for _, h := range hwl.Items {
28-
// if h.Iqn != "" {
2924
ch <- prometheus.MustNewConstMetric(
3025
c.PortInfoDesc,
3126
prometheus.GaugeValue,
3227
1,
3328
h.Iqn, h.Name, h.Nqn, h.Portal, h.Wwn,
3429
)
35-
// }
36-
// if h.Nqn != "" && h.Portal != "" {
37-
// ch <- prometheus.MustNewConstMetric(
38-
// c.PortNVMeTCPInfoDesc,
39-
// prometheus.GaugeValue,
40-
// 1,
41-
// h.Name, h.Nqn, h.Portal,
42-
// )
43-
// }
44-
// if h.Nqn != "" && h.Wwn != "" {
45-
// ch <- prometheus.MustNewConstMetric(
46-
// c.PortNVMeFCInfoDesc,
47-
// prometheus.GaugeValue,
48-
// 1,
49-
// h.Name, h.Nqn, h.Wwn,
50-
// )
51-
// }
52-
// if h.Wwn != "" {
53-
// ch <- prometheus.MustNewConstMetric(
54-
// c.PortFCInfoDesc,
55-
// prometheus.GaugeValue,
56-
// 1,
57-
// h.Name, h.Wwn,
58-
// )
59-
// }
6030
}
6131
}
6232

6333
func NewPortsCollector(fa *client.FAClient) *PortsCollector {
6434
return &PortsCollector{
6535
PortInfoDesc: prometheus.NewDesc(
66-
"purefa_port_info",
67-
"FlashArray port info",
36+
"purefa_network_port_info",
37+
"FlashArray network port info",
6838
[]string{"iqn", "name", "nqn", "portal", "wwn"},
6939
prometheus.Labels{},
7040
),
71-
//PortiSCSIInfoDesc: prometheus.NewDesc(
72-
// "purefa_ports_iscsi_info",
73-
// "FlashArray port iscsi info",
74-
// []string{"name", "iqn", "portal"},
75-
// prometheus.Labels{},
76-
//),
77-
// PortNVMeTCPInfoDesc: prometheus.NewDesc(
78-
// "purefa_ports_nvmetcp_info",
79-
// "FlashArray ports NVMe/TCP info",
80-
// []string{"name", "nqn", "portal"},
81-
// prometheus.Labels{},
82-
//),
83-
//PortNVMeFCInfoDesc: prometheus.NewDesc(
84-
// "purefa_ports_nvmefc_info",
85-
// "FlashArray ports NVMe/FC info",
86-
// []string{"name", "nqn", "wwn"},
87-
// prometheus.Labels{},
88-
//),
89-
//PortFCInfoDesc: prometheus.NewDesc(
90-
// "purefa_ports_fc_info",
91-
// "FlashArray ports fc info",
92-
// []string{"name", "wwn"},
93-
// prometheus.Labels{},
94-
//),
9541
Client: fa,
9642
}
9743
}

specification/metrics/purefa-metrics.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ This document describes the semantic conventions for Pure FlashArray Metrics.
7272
| | | The category of the alert. | | | | `category` | `array`, `hardware`, `software` |
7373
| | | | | | | `severity` | `info`, `warning`, `critical`, `hidden` |
7474
| | | A summary of the alert | | | | `summary` | (summary) |
75-
| |
76-
7775

7876
### `purefa_array` - FlashArray metrics
7977

@@ -167,6 +165,16 @@ This document describes the semantic conventions for Pure FlashArray Metrics.
167165
| Available | purefa_network_interface_performance_errors | FlashArray network interface errors in errors per second | error/second | Gauge | Double | `name` | (interface name) |
168166
| | | | | | | `type` | `eth`, `fc` |
169167
| | | | | | | `dimension` | `other_errors_per_sec`, `received_crc_errors_per_sec`, `received_frame_errors_per_sec`, `received_link_failures_per_sec`, `received_loss_of_signal_per_sec`, `received_loss_of_sync_per_sec`, `total_errors_per_sec`, `transmitted_carrier_errors_per_sec`, `transmitted_dropped_errors_per_sec`, `transmitted_invalid_words_per_sec` |
168+
| Available | purefa_network_interface_speed_bandwidth_bytes | FlashArray network interface speed in bytes per second | bytes/second | Gauge | Double | `name` | (interface name) |
169+
| | | | | | | `enabled` | `true`, `false` |
170+
| | | | | | | `ethsubtype` | `bond`, `physical`, `vif` |
171+
| | | | | | | `services` | (service name) |
172+
| | | | | | | `type` | `eth`, `fc` |
173+
| Available | purefa_network_port_info | FlashArray network port info | | Gauge | Double | `name` | (interface name) |
174+
| | | | | | | `iqn` | (iqn) |
175+
| | | | | | | `nqn` | (nqn) |
176+
| | | | | | | `portal` | (portal) |
177+
| | | | | | | `wwn` | (wwn) |
170178

171179
### `purefa_pod` - Pod metrics
172180

0 commit comments

Comments
 (0)