Skip to content

Commit c1cfd8d

Browse files
authored
Merge pull request #89 from james-laing/streamline_arrays_uri
Split buckets and filesystems URI into endpoints
2 parents e02a79f + 5797343 commit c1cfd8d

File tree

4 files changed

+101
-31
lines changed

4 files changed

+101
-31
lines changed

README.md

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,17 @@ Authentication is used by the exporter as the mechanism to cross authenticate to
128128
The exporter understands the following requests:
129129

130130

131-
| URL | GET parameters | description |
132-
| ---------------------------------------------------| -------------- | --------------------------|
133-
| http://\<exporter-host\>:\<port\>/metrics | endpoint | Full array metrics |
134-
| http://\<exporter-host\>:\<port\>/metrics/array | endpoint | Array metrics |
135-
| http://\<exporter-host\>:\<port\>/metrics/clients | endpoint | Clients metrics |
136-
| http://\<exporter-host\>:\<port\>/metrics/usage | endpoint | Quotas usage metrics |
137-
| http://\<exporter-host\>:\<port\>/metrics/policies | endpoint | NFS policies info metrics |
131+
| URL | GET parameters | description |
132+
| ----------------------------------------------------- | -------------- | ------------------------- |
133+
| http://\<exporter-host\>:\<port\>/metrics | endpoint | Full array metrics |
134+
| http://\<exporter-host\>:\<port\>/metrics/array | endpoint | Array metrics |
135+
| http://\<exporter-host\>:\<port\>/metrics/clients | endpoint | Clients metrics |
136+
| http://\<exporter-host\>:\<port\>/metrics/filesystems | endpoint | File System metrics |
137+
| http://\<exporter-host\>:\<port\>/metrics/objectstore | endpoint | Object Store metrics |
138+
| http://\<exporter-host\>:\<port\>/metrics/policies | endpoint | NFS policies info metrics |
139+
| http://\<exporter-host\>:\<port\>/metrics/usage | endpoint | Quotas usage metrics |
138140

139141

140-
Depending on the target array, scraping for the whole set of metrics could result into timeout issues, in which case it is suggested either to increase the scraping timeout or to scrape each single endpoint instead.
141-
142142
### Usage examples
143143

144144
In a typical production scenario, it is recommended to use a visual frontend for your metrics, such as [Grafana](https://github.com/grafana/grafana). Grafana allows you to use your Prometheus instance as a datasource, and create Graphs and other visualizations from PromQL queries. Grafana, Prometheus, are all easy to run as docker containers.
@@ -158,10 +158,42 @@ Please have a look at the documentation of each image/application for adequate c
158158

159159
A simple but complete example to deploy a full monitoring stack on kubernetes can be found in the [examples](examples/config/k8s) directory
160160

161+
### Upgrade Information
162+
163+
v1.1.0 - New URIs `filesystem` and `objectstore` were added to split off these metric instruments to ensure metrics in the `array` URI remain quick to scrape in large environments to comply with the limitations recommendation set below in [Bugs and Limitations](#bugs-and-limitations).
164+
165+
If you require the following metrics for your dataset for your observability toolset, please add the new endpoint(s) as required.
166+
167+
168+
The following metrics have been moved from `array` to `filesystem`
169+
170+
* `purefb_file_systems_performance_average_bytes`
171+
* `purefb_file_systems_performance_bandwidth_bytes`
172+
* `purefb_file_systems_performance_latency_usec`
173+
* `purefb_file_systems_performance_throughput_iops`
174+
* `purefb_file_systems_space_bytes`
175+
* `purefb_file_systems_space_data_reduction_ratio`
176+
177+
The following metrics have been moved from `array` to `objectstore`
178+
179+
* `purefb_buckets_object_count`
180+
* `purefb_buckets_performance_average_bytes`
181+
* `purefb_buckets_performance_bandwidth_bytes`
182+
* `purefb_buckets_performance_latency_usec`
183+
* `purefb_buckets_performance_throughput_iops`
184+
* `purefb_buckets_quota_space_bytes`
185+
* `purefb_buckets_s3_specific_performance_latency_usec`
186+
* `purefb_buckets_s3_specific_performance_throughput_iops`
187+
* `purefb_buckets_space_bytes`
188+
* `purefb_buckets_space_data_reduction_ratio`
189+
* `purefb_object_store_accounts_data_reduction_ratio`
190+
* `purefb_object_store_accounts_object_count`
191+
* `purefb_object_store_accounts_space_bytes`
192+
161193

162194
### Bugs and Limitations
163195

164-
* Pure FlashBlade REST APIs are not designed for efficiently reporting on full clients and objects quota KPIs, therefrore it is suggested to scrape the "array" metrics preferably and use the "clients" and "usage" metrics individually and with a lower frequency than the other.. In any case, as a general rule, it is advisable to do not lower the scraping interval down to less than 30 sec. In case you experience timeout issues, you may want to increase the Prometheus scraping timeout and interval approriately.
196+
* Pure FlashBlade REST APIs are not designed for efficiently reporting on full clients and objects quota metrics. Therefore, it is suggested to scrape the `array` metrics most frequently and use the `clients`, `filesystem`, `objectstore`, `policies`, and `usage` endpoints individually and with a lower frequency. As a general rule, it is not advisable to lower the scraping interval to less than 30 seconds for for any endpoint. In case you experience timeout issues, you may want to increase the Prometheus scraping timeout and interval appropriately. It is very important to have the collection interval (frequency) safely higher than the scrape duration.
165197

166198
### Metrics Collected
167199

cmd/fb-om-exporter/main.go

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ func main() {
118118
w.Header().Add("Strict-Transport-Security", "max-age=63072000; includeSubDomains")
119119
metricsHandler(w, r)
120120
})
121+
http.HandleFunc("/metrics/filesystems", func(w http.ResponseWriter, r *http.Request) {
122+
w.Header().Add("Strict-Transport-Security", "max-age=63072000; includeSubDomains")
123+
metricsHandler(w, r)
124+
})
125+
http.HandleFunc("/metrics/objectstore", func(w http.ResponseWriter, r *http.Request) {
126+
w.Header().Add("Strict-Transport-Security", "max-age=63072000; includeSubDomains")
127+
metricsHandler(w, r)
128+
})
121129
http.HandleFunc("/metrics/usage", func(w http.ResponseWriter, r *http.Request) {
122130
w.Header().Add("Strict-Transport-Security", "max-age=63072000; includeSubDomains")
123131
metricsHandler(w, r)
@@ -139,6 +147,12 @@ func main() {
139147
http.HandleFunc("/metrics/clients", func(w http.ResponseWriter, r *http.Request) {
140148
metricsHandler(w, r)
141149
})
150+
http.HandleFunc("/metrics/filesystems", func(w http.ResponseWriter, r *http.Request) {
151+
metricsHandler(w, r)
152+
})
153+
http.HandleFunc("/metrics/objectstore", func(w http.ResponseWriter, r *http.Request) {
154+
metricsHandler(w, r)
155+
})
142156
http.HandleFunc("/metrics/usage", func(w http.ResponseWriter, r *http.Request) {
143157
metricsHandler(w, r)
144158
})
@@ -164,8 +178,10 @@ func metricsHandler(w http.ResponseWriter, r *http.Request) {
164178
} else {
165179
metrics = path[2]
166180
switch metrics {
167-
case "clients":
168181
case "array":
182+
case "buckets":
183+
case "clients":
184+
case "filesystems":
169185
case "usage":
170186
case "policies":
171187
default:
@@ -237,10 +253,22 @@ func index(w http.ResponseWriter, r *http.Request) {
237253
<td>Provides only array related metrics.</td>
238254
</tr>
239255
<tr>
256+
<td>Bucket metrics</td>
257+
<td><a href="/metrics/objectstore?endpoint=host">/metrics/objectstore</a></td>
258+
<td>endpoint</td>
259+
<td>Provides only object store related metrics.</td>
260+
</tr>
261+
<tr>
240262
<td>Client metrics</td>
241263
<td><a href="/metrics/clients?endpoint=host">/metrics/clients</a></td>
242264
<td>endpoint</td>
243-
<td>Provides only client related metrics. This is the most time expensive query</td>
265+
<td>Provides only client related metrics. This is the most time expensive query.</td>
266+
</tr>
267+
<tr>
268+
<td>File System metrics</td>
269+
<td><a href="/metrics/filesystems?endpoint=host">/metrics/filesystems</a></td>
270+
<td>endpoint</td>
271+
<td>Provides only file system related metrics.</td>
244272
</tr>
245273
<tr>
246274
<td>Quota metrics</td>

internal/openmetrics-exporter/collector.go

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,38 +23,46 @@ func Collector(ctx context.Context, metrics string, registry *prometheus.Registr
2323
httpPerfCollector := NewHttpPerfCollector(fbclient)
2424
nfsPerfCollector := NewNfsPerfCollector(fbclient)
2525
perfReplCollector := NewPerfReplicationCollector(fbclient)
26-
bucketsPerfCollector := NewBucketsPerfCollector(fbclient, buckets)
27-
buckestS3PerfCollector := NewBucketsS3PerfCollector(fbclient, buckets)
28-
filesystemsPerfCollector := NewFileSystemsPerfCollector(fbclient, filesystems)
29-
filesystemsSpaceCollector := NewFileSystemsSpaceCollector(filesystems)
3026
arraySpaceCollector := NewArraySpaceCollector(fbclient)
31-
bucketsSpaceCollector := NewBucketsSpaceCollector(buckets)
3227
alertsCollector := NewAlertsCollector(fbclient)
3328
hardwareCollector := NewHardwareCollector(fbclient)
3429
hwPerfConnectorsCollector := NewHwConnectorsPerfCollector(fbclient)
35-
objstoreacctsCollector := NewObjectStoreAccountsCollector(fbclient)
3630
registry.MustRegister(
3731
perfCollector,
3832
s3perfCollector,
3933
httpPerfCollector,
4034
nfsPerfCollector,
4135
perfReplCollector,
42-
bucketsPerfCollector,
43-
buckestS3PerfCollector,
44-
filesystemsPerfCollector,
4536
arraySpaceCollector,
46-
bucketsSpaceCollector,
47-
filesystemsSpaceCollector,
4837
alertsCollector,
4938
hardwareCollector,
5039
hwPerfConnectorsCollector,
51-
objstoreacctsCollector,
40+
)
41+
}
42+
if metrics == "all" || metrics == "filesystems" {
43+
filesystemsPerfCollector := NewFileSystemsPerfCollector(fbclient, filesystems)
44+
filesystemsSpaceCollector := NewFileSystemsSpaceCollector(filesystems)
45+
registry.MustRegister(
46+
filesystemsSpaceCollector,
47+
filesystemsPerfCollector,
5248
)
5349
}
5450
if metrics == "all" || metrics == "clients" {
5551
clientsPerfCollector := NewClientsPerfCollector(fbclient)
5652
registry.MustRegister(clientsPerfCollector)
5753
}
54+
if metrics == "all" || metrics == "objectstore" {
55+
bucketsPerfCollector := NewBucketsPerfCollector(fbclient, buckets)
56+
buckestS3PerfCollector := NewBucketsS3PerfCollector(fbclient, buckets)
57+
bucketsSpaceCollector := NewBucketsSpaceCollector(buckets)
58+
objstoreacctsCollector := NewObjectStoreAccountsCollector(fbclient)
59+
registry.MustRegister(
60+
bucketsPerfCollector,
61+
buckestS3PerfCollector,
62+
bucketsSpaceCollector,
63+
objstoreacctsCollector,
64+
)
65+
}
5866
if metrics == "all" || metrics == "usage" {
5967
usageCollector := NewUsageCollector(fbclient, filesystems)
6068
registry.MustRegister(usageCollector)

specification/metrics/purefb-metrics.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ This document describes the semantic conventions for Pure FlashBlade Metrics.
2323

2424
## Collections by Endpoint
2525

26-
| Endpoint | Description | Metrics Instruments collected |
27-
| ----------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
28-
| /metrics | Full array metrics | all |
29-
| /metrics/array | Array only metrics | `purefb_info`, `purefb_alerts`, `purefb_array`, `purefb_buckets`, `purefb_file_systems`, `purefb_hardware`, `purefb_object_store` |
30-
| /metrics/clients | Client only metrics | `purefb_info`, `purefb_clients` |
31-
| /metrics/usage | Quota only metrics | `purefb_info`, `purefb_file_system_usage` |
32-
| /metrics/policies | NFS policy related info | `purefb_info`, `purefb_nfs_export_rule` |
26+
| Endpoint | Description | Metrics Instruments collected |
27+
| -------------------- | ------------------------ | ----------------------------------------------------------------- |
28+
| /metrics | Full array metrics | all |
29+
| /metrics/array | Array metrics | `purefb_info`, `purefb_alerts`, `purefb_array`, `purefb_hardware` |
30+
| /metrics/clients | Client metrics | `purefb_info`, `purefb_clients` |
31+
| /metrics/filesystems | File System metrics | `purefb_info`, `purefb_file_systems` |
32+
| /metrics/objectstore | Object Store metrics | `purefb_info`, `purefb_buckets`, `purefb_object_store` |
33+
| /metrics/policies | NFS policy related info | `purefb_info`, `purefb_nfs_export_rule` |
34+
| /metrics/usage | Quota metrics | `purefb_info`, `purefb_file_system_usage` |
3335

3436
## Metric Statuses
3537

0 commit comments

Comments
 (0)