Skip to content

Commit 6180930

Browse files
authored
Merge branch 'PureStorage-OpenConnect:master' into add-deployment-options
2 parents 19cd389 + c8660c2 commit 6180930

File tree

21 files changed

+532
-257
lines changed

21 files changed

+532
-257
lines changed

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v3
13-
- uses: wangyoucao577/go-release-action@v1.32
13+
- uses: wangyoucao577/go-release-action@v1
1414
with:
1515
github_token: ${{ secrets.GITHUB_TOKEN }}
1616
goos: linux

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ GOTEST=$(GOCMD) test
44
GOVET=$(GOCMD) vet
55
BINARY_NAME=pure-fa-om-exporter
66
MODULE_NAME=purestorage/fa-openmetrics-exporter
7-
VERSION?=1.0.10
7+
VERSION?=1.0.11
88
SERVICE_PORT?=9490
99
DOCKER_REGISTRY?= quay.io/purestorage/
1010
EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true

build/docker/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM golang:alpine as build
2-
ARG VERSION=1.0.10
2+
ARG VERSION=1.0.11
33

44
WORKDIR /usr/src/app
55

@@ -13,6 +13,8 @@ RUN CGO_ENABLED=1 go build -a -tags 'netgo osusergo static_build' -ldflags="-X m
1313

1414
# alpine is used here as it seems to be the minimal image that passes quay.io vulnerability scan
1515
FROM alpine
16+
# update ssl packages for CVEs
17+
RUN apk update && apk upgrade --no-cache libcrypto3 libssl3
1618
COPY --from=build /usr/local/bin/pure-fa-om-exporter /pure-fa-om-exporter
1719

1820
# create an empty tokens file for use with volumes if required. You can use a mounted volume to /etc/pure-fa-om-exporter/ to pass the `tokens.yaml` file. File must be named `tokens.yaml`.

extra/grafana/README.md

Lines changed: 82 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ We have tested our dashboard with the following versions:
5555
The Grafana dashboards have been developed and tested using the following software versions:
5656
| OME | Prometheus | Grafana |
5757
| -------------- | ----------- |--------------- |
58+
| v1.0.9 | 2.45.1 | 9.3.2 & 10.1.15|
5859
| v1.0.9 | 2.45.0 | 9.3.2 & 10.0.1 |
5960
| v1.0.5.hotfix1 | 2.41.1 | 9.3.2 & 9.4.1 |
6061

@@ -65,71 +66,89 @@ Dashboards may have limited functionality with earlier versions and some modific
6566
1. Install Prometheus on your chosen OS platform ([prometheus-docs][2]).
6667

6768
2. Generate an API token from your chosen user account or create a new readonly user.
68-
```console
69-
pureuser@arrayname01> pureadmin create --role readonly svc-readonly
70-
Name Type Role
71-
svc-readonly local readonly
7269

73-
pureuser@arrayname01> pureadmin create --api-token svc-readonly
74-
Name Type API Token Created Expires
75-
svc-readonly local a12345bc6-d78e-901f-23a4-56b07b89012 2022-11-30 08:58:40 EST -
76-
```
70+
<details>
71+
<summary>Expand for CLI example</summary>
72+
73+
```console
74+
pureuser@arrayname01> pureadmin create --role readonly o11y-readonly
75+
Name Type Role
76+
o11y-readonly local readonly
77+
78+
pureuser@arrayname01> pureadmin create --api-token o11y-readonly
79+
Name Type API Token Created Expires
80+
o11y-readonly local 11111111-1111-1111-1111-111111111111 2022-11-30 08:58:40 EST -
81+
```
82+
83+
</details>
84+
85+
<details>
86+
<summary>Expand for GUI example</summary>
87+
88+
![Alt text](../images/purefa_create_api_token.png)
89+
</details>
7790

7891
3. Configure `/etc/prometheus/prometheus.yml` to point use the OpenMetrics exporter to query the device endpoint.
7992

80-
[This is an example of configuring the prometheus.yml](../prometheus/prometheus.yml)
81-
82-
Let's take a walkthrough an example of scraping the `/metrics/array` endpoint.
83-
84-
```yaml
85-
# Scrape job for one Pure Storage FlashArray scraping /metrics/array
86-
# Each Prometheus scrape requires a job name. In this example we have structures the name `exporter_endpoint_arrayname`
87-
- job_name: 'purefa_array_arrayname01'
88-
# Specify the array endpoint from /metrics/array
89-
metrics_path: /metrics/array
90-
# Provide FlashArray authorization API token
91-
authorization:
92-
credentials: a12345bc6-d78e-901f-23a4-56b07b89012
93-
# Provide parameters to pass the exporter the device to connect to. Provide FQDN or IP address
94-
params:
95-
endpoint: ['arrayname01.fqdn.com']
96-
97-
static_configs:
98-
# Tell Prometheus which exporter to make the request
99-
- targets:
100-
- 10.0.2.10:9490
101-
# Finally provide labels to the device.
102-
labels:
103-
# Instance should be the device name and is used to correlate metrics between different endpoints in Prometheus and Grafana. Ensure this is the same for each endpoint for the same device.
104-
instance: arrayname01
105-
# location, site and env are specific to your environment. Feel free to add more labels but maintain these three to minimize changes to Grafana which is expecting to use location, site and env as filter variables.
106-
location: uk
107-
site: London
108-
env: production
109-
110-
# Repeat for the above for end points:
111-
# /metrics/volumes
112-
# /metrics/hosts
113-
# /metrics/pods
114-
# /metrics/directories
115-
116-
# Repeat again for more Pure Storage FlashArrays
117-
```
93+
This is an example [prometheus.yml](../prometheus/prometheus.yml) file.
94+
95+
Let's take a walkthrough an example of scraping the `/metrics/array` endpoint.
96+
97+
```yaml
98+
# Scrape job for one Pure Storage FlashArray scraping /metrics/array
99+
# Each Prometheus scrape requires a job name. In this example we have structures the name `exporter_endpoint_arrayname`
100+
- job_name: 'purefa_array_arrayname01'
101+
# Specify the array endpoint from /metrics/array
102+
metrics_path: /metrics/array
103+
# Provide FlashArray authorization API token
104+
authorization:
105+
credentials: 11111111-1111-1111-1111-111111111111
106+
# Provide parameters to pass the exporter the device to connect to. Provide FQDN or IP address
107+
params:
108+
endpoint: ['arrayname01.fqdn.com']
109+
110+
static_configs:
111+
# Tell Prometheus which exporter to make the request
112+
- targets:
113+
- 10.0.2.10:9490
114+
# Finally provide labels to the device.
115+
labels:
116+
# Instance should be the device name and is used to correlate metrics between different endpoints in Prometheus and Grafana. Ensure this is the same for each endpoint for the same device.
117+
instance: arrayname01
118+
# location, site and env are specific to your environment. Feel free to add more labels but maintain these three to minimize changes to Grafana which is expecting to use location, site and env as filter variables.
119+
location: uk
120+
site: London
121+
env: production
122+
123+
# Repeat for the above for end points:
124+
# /metrics/volumes
125+
# /metrics/hosts
126+
# /metrics/pods
127+
# /metrics/directories
128+
# It is recommended to collect expensive queries less frequently such as /metrics/directories.
129+
scrape_interval: 15m # Set the scrape interval to every 15min. Default is every 1 minute. This overrides the global setting.
130+
scrape_timeout: 15m # Set the scrape timeout to shorter than or equal to scrape_interval. Default is every 1 minute.
131+
132+
# Repeat again for more Pure Storage FlashArrays
133+
```
134+
118135
4. Test the prometheus.yml file is valid
119-
```console
120-
> promtool check config /etc/prometheus/prometheus.yml
121-
Checking prometheus.yml
122-
SUCCESS: prometheus.yml is valid prometheus config file syntax
123-
```
136+
137+
```console
138+
> promtool check config /etc/prometheus/prometheus.yml
139+
Checking prometheus.yml
140+
SUCCESS: prometheus.yml is valid prometheus config file syntax
141+
```
142+
124143
5. Restart Prometheus to ensure changes take effect
125144

126145
6. Navigate to your Prometheus instance via web browser http://prometheus:9090
127146
- Type `purefa_info` in the query box and hit return
128147
129148
7. All going well, you will see your device listed:
130-
```
131-
purefa_info{array_name="ARRAYNAME01", env="production", instance="arrayname01", job="purefa_array_arrayname01", location="uk", os="Purity//FA", site="London", system_id="a1234bc5-a111-b222-c333-123456abcdef", version="6.3.3"}
132-
```
149+
```
150+
purefa_info{array_name="ARRAYNAME01", env="production", instance="arrayname01", job="purefa_array_arrayname01", location="uk", os="Purity//FA", site="London", system_id="11111111-1111-1111-1111-111111111111", version="6.5.0"}
151+
```
133152

134153
## Grafana
135154

@@ -160,9 +179,9 @@ Check the data is accessible to each component in the stack. If at any on these
160179

161180
### Check Pure OpenMetrics Exporter
162181
1. Run cURL against the exporter and pass is the bearer token and endpoint.
163-
```
164-
curl -H 'Authorization: Bearer a12345bc6-d78e-901f-23a4-56b07b89012' -X GET 'http://<exporter_ip>:9490/metrics/array?endpoint=arrayname01.fqdn.com'
165-
```
182+
```
183+
curl -H 'Authorization: Bearer 11111111-1111-1111-1111-111111111111' -X GET 'http://<exporter_ip>:9490/metrics/array?endpoint=arrayname01.fqdn.com'
184+
```
166185

167186
### Check Prometheus
168187
2. Using the Prometheus UI, run a simple query to see if any results are returned.
@@ -174,12 +193,13 @@ curl -H 'Authorization: Bearer a12345bc6-d78e-901f-23a4-56b07b89012' -X GET 'htt
174193
<br>
175194
<img src="./images/prometheus_purefa_target_status.png" width="40%" height="40%">
176195
<br>
196+
177197
4. Run prometheus.yml through the yaml checker. Check the configuration is correct and restart Prometheus.
178-
```console
179-
> promtool check config /etc/prometheus/prometheus.yml
180-
Checking prometheus.yml
181-
SUCCESS: prometheus.yml is valid prometheus config file syntax
182-
```
198+
```console
199+
> promtool check config /etc/prometheus/prometheus.yml
200+
Checking prometheus.yml
201+
SUCCESS: prometheus.yml is valid prometheus config file syntax
202+
```
183203

184204
5. Check messages log for Prometheus errors.
185205

0 commit comments

Comments
 (0)