Skip to content

Commit e4e3d07

Browse files
authored
Merge pull request #7 from chrroberts-pure/add-array-metrics
Add array metrics, Documentation, and Examples corrections
2 parents 4cb1cc3 + 7b4a95a commit e4e3d07

File tree

5 files changed

+19
-11
lines changed

5 files changed

+19
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ The exporter uses a RESTful API schema to provide Prometheus scraping endpoints.
8080

8181

8282
URL | GET parameters | Description
83-
---|---
83+
---|---|---
8484
http://\<exporter-host\>:\<port\>/metrics | endpoint | Full array metrics
8585
http://\<exporter-host\>:\<port\>/metrics/array | endpoint | Array only metrics
8686
http://\<exporter-host\>:\<port\>/metrics/volumes | endpoint | Volumes only metrics

build/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ RUN go mod download && go mod verify
99
COPY . .
1010
RUN go build -v -o /usr/local/bin/pure-fa-om-exporter cmd/fa-om-exporter/main.go
1111

12-
EXPOSE 9491
12+
EXPOSE 9490
1313
ENTRYPOINT ["/usr/local/bin/pure-fa-om-exporter"]
1414
CMD ["--host", "0.0.0.0", "--port", "9490"]

cmd/fa-om-exporter/main.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@ import (
44
"context"
55
"flag"
66
"fmt"
7+
"log"
8+
"net/http"
9+
collectors "purestorage/fa-openmetrics-exporter/internal/openmetrics-exporter"
10+
client "purestorage/fa-openmetrics-exporter/internal/rest-client"
711
"strings"
12+
813
"github.com/prometheus/client_golang/prometheus"
914
"github.com/prometheus/client_golang/prometheus/promhttp"
10-
"log"
11-
"net/http"
12-
"purestorage/fa-openmetrics-exporter/internal/openmetrics-exporter"
13-
"purestorage/fa-openmetrics-exporter/internal/rest-client"
1415
)
1516

16-
var version string = "0.2.0"
17+
var version string = "0.2.1"
1718
var debug bool = false
1819

1920
func main() {
@@ -57,6 +58,7 @@ func metricsHandler(w http.ResponseWriter, r *http.Request) {
5758
} else {
5859
metrics = path[2]
5960
switch metrics {
61+
case "array":
6062
case "volumes":
6163
case "hosts":
6264
case "pods":
@@ -94,7 +96,7 @@ func metricsHandler(w http.ResponseWriter, r *http.Request) {
9496
func index(w http.ResponseWriter, r *http.Request) {
9597
msg := `<html>
9698
<body>
97-
<h1>Pure Storage Flashblade OpenMetrics Exporter</h1>
99+
<h1>Pure Storage FlashArray OpenMetrics Exporter</h1>
98100
<table>
99101
<thead>
100102
<tr>
@@ -111,6 +113,12 @@ func index(w http.ResponseWriter, r *http.Request) {
111113
<td>endpoint</td>
112114
<td>All array metrics. Expect slow response time.</td>
113115
</tr>
116+
<tr>
117+
<td>Array metrics</td>
118+
<td><a href="/metrics/array?endpoint=host">/metrics/array</a></td>
119+
<td>endpoint</td>
120+
<td>Provides only array related metrics.</td>
121+
</tr>
114122
<tr>
115123
<td>Volumes metrics</td>
116124
<td><a href="/metrics/volumes?endpoint=host">/metrics/volumes</a></td>

examples/config/docker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ Launch the exporter using the docker command according to the following:
44

55
```shell
66

7-
docker run -d -p 9491:9491 --rm --name pure-fa-om-exporter quai.io/purestorage/pure-fa-om-exporter:<version>
7+
docker run -d -p 9490:9490 --rm --name pure-fa-om-exporter quay.io/purestorage/pure-fa-om-exporter:<version>
88
```

examples/config/k8s/prometheus-configmap.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ data:
2525
2626
# A scrape configuration containing exactly one endpoint to scrape:
2727
scrape_configs:
28-
- job_name: 'purestorage-fb'
28+
- job_name: 'purestorage-fa'
2929
metrics_path: /metrics/array
3030
authorization:
3131
credentials: T-2b74f9eb-a35f-40d9-a6a6-33c13775a53c
3232
params:
3333
endpoint: ['10.11.112.6']
3434
static_configs:
3535
- targets:
36-
- pure-fb-exporter.monitoring.svc:9491
36+
- pure-fa-exporter.monitoring.svc:9490
3737
labels:
3838
location: uk
3939
site: London

0 commit comments

Comments
 (0)