Skip to content

Commit 13d1ffd

Browse files
authored
Merge pull request #35 from genegr/master
New configuration example for the K8s Prometheus Operator
2 parents 7642b13 + 63ebaa8 commit 13d1ffd

14 files changed

+138
-2
lines changed

README.md

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ We will address these as soon as we can, but there are no specific SLAs.
1313

1414
This application aims to help monitor Pure Storage FlashArrays by providing an "exporter", which means it extracts data from the Purity API and converts it to the OpenMetrics format, which is for instance consumable by Prometheus, or other observability platforms.
1515

16-
The stateless design of the exporter allows for easy configuration management as well as scalability for a whole fleet of Pure Storage arrays. Each time the OpenMetrics client scrapes metrics for a specific system, it should provide the hostname via GET parameter and the API token as Authorization token to this exporter.
16+
The stateless design of the exporter allows for easy configuration management as well as scalability for a whole fleet of Pure Storage arrays. The design follows almost completely the [multi-target-exporter](https://prometheus.io/docs/guides/multi-target-exporter/) pattern described in the Prometheus documentation, so the tool can be used to scrape multiple FlashArrays from a single instance or just act the front-end for a single FlashArray.
1717

1818
To monitor your Pure Storage appliances, you will need to create a new dedicated user on your array, and assign read-only permissions to it. Afterwards, you also have to create a new API key.
1919

@@ -67,7 +67,7 @@ docker build -t pure-fa-ome:$VERSION .
6767
```
6868

6969

70-
**Authentication**
70+
### Authentication
7171

7272
Authentication is used by the exporter as the mechanism to cross authenticate to the scraped appliance, therefore for each array it is required to provide the REST API token for an account that has a 'readonly' role. The api-token can be provided in two ways
7373

@@ -125,6 +125,63 @@ The exporter uses a RESTful API schema to provide Prometheus scraping endpoints.
125125

126126
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.
127127

128+
### Prometheus configuration
129+
130+
A sample of a basic configuration file for Prometheus is as follows.
131+
132+
```shell
133+
134+
global:
135+
scrape_interval: 30s
136+
scrape_timeout: 10s
137+
evaluation_interval: 30s
138+
scrape_configs:
139+
- job_name: monitoring/pure-fa-probe
140+
honor_timestamps: true
141+
scrape_interval: 30s
142+
scrape_timeout: 10s
143+
metrics_path: /metrics/pods
144+
scheme: http
145+
follow_redirects: true
146+
enable_http2: true
147+
relabel_configs:
148+
- source_labels: [job]
149+
separator: ;
150+
regex: (.*)
151+
target_label: __tmp_prometheus_job_name
152+
replacement: $1
153+
action: replace
154+
- separator: ;
155+
regex: (.*)
156+
target_label: job
157+
replacement: pure-fa-probe
158+
action: replace
159+
- source_labels: [__address__]
160+
separator: ;
161+
regex: (.*)
162+
target_label: __param_target
163+
replacement: $1
164+
action: replace
165+
- source_labels: [__param_target]
166+
separator: ;
167+
regex: (.*)
168+
target_label: instance
169+
replacement: $1
170+
action: replace
171+
- separator: ;
172+
regex: (.*)
173+
target_label: __address__
174+
replacement: pure-fa-exporter.your.domain:9490 # <== your exporter address and port goes here
175+
action: replace
176+
static_configs:
177+
- targets: # <== the list of your flasharrays goes here
178+
- 10.11.12.80
179+
- 10.11.12.82
180+
- 10.11.12.90
181+
182+
```
183+
184+
See the kubernetes [examples](examples/config/k8s) for a similar configuration that uses a the additional config for a simple Prometheus kubernets deploymemt or the more interesting Prometheus operator.
128185

129186
### Usage examples
130187

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Deploying with the Prometheus Operator
2+
3+
Install Prometheus using the [Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator), then deploy
4+
the Pure FlashArray Prometheus exporter using the deployment file [pure-fa-exporter-deployment.yaml](./pure-fa-exporter-deployment.yaml). Configure Prometheus using the Probe custom resouce defined in the [pure-fa-probe.yaml](./pure-fa-probe.yaml).
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: pure-fa-om-exporter
5+
namespace: monitoring
6+
labels:
7+
app: pure-fa-exporter
8+
spec:
9+
replicas: 1
10+
strategy:
11+
rollingUpdate:
12+
maxSurge: 1
13+
maxUnavailable: 1
14+
type: RollingUpdate
15+
selector:
16+
matchLabels:
17+
app: pure-fa-exporter
18+
template:
19+
metadata:
20+
labels:
21+
app: pure-fa-exporter
22+
spec:
23+
containers:
24+
- name: pure-fa-om-exporter
25+
image: quay.io/purestorage/pure-fa-om-exporter/pure-fa-om-exporter:1.0.4
26+
command: ["/pure-fa-om-exporter"]
27+
imagePullPolicy: "Always"
28+
args:
29+
- '-t'
30+
- '/var/pure-fa-om-exporter/api-tokens.yaml'
31+
volumeMounts:
32+
- mountPath: "/var/pure-fa-om-exporter"
33+
name: pure-fa-secret
34+
readOnly: true
35+
ports:
36+
- name: web
37+
containerPort: 9490
38+
restartPolicy: Always
39+
volumes:
40+
- name: pure-fa-secret
41+
secret:
42+
secretName: pure-fa-secret
43+
44+
---
45+
46+
apiVersion: v1
47+
kind: Service
48+
metadata:
49+
name: pure-fa-exporter-svc
50+
namespace: monitoring
51+
spec:
52+
ports:
53+
- port: 9490
54+
protocol: TCP
55+
targetPort: 9490
56+
selector:
57+
app: pure-fa-exporter
58+
type: ClusterIP
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: monitoring.coreos.com/v1
2+
kind: Probe
3+
metadata:
4+
name: pure-fa-probe
5+
namespace: monitoring
6+
spec:
7+
jobName: pure-fa-probe
8+
prober:
9+
url: pure-fa-exporter-svc:9490
10+
path: /metrics/pods
11+
interval: 15s
12+
targets:
13+
staticConfig:
14+
static:
15+
- 10.11.12.80
16+
- 10.11.12.82
17+
- 10.11.12.90

0 commit comments

Comments
 (0)