You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prometheus uses file watches and all changes to the json file are applied immediately.
115
+
116
+
39
117
40
118
### Run via Docker:
41
119
@@ -44,7 +122,6 @@ The latest release is automatically published to the [Docker registry](https://h
44
122
You can run it like this:
45
123
46
124
```sh
47
-
$ docker pull oliver006/redis_exporter
48
125
$ docker run -d --name redis_exporter -p 9121:9121 oliver006/redis_exporter
49
126
```
50
127
@@ -55,96 +132,47 @@ in an image that has a shell, etc then you can run the `alpine` image:
55
132
$ docker run -d --name redis_exporter -p 9121:9121 oliver006/redis_exporter:alpine
56
133
```
57
134
58
-
If you try to access a redis instance running on the host node, you'll need to add `--network host` so the
135
+
If you try to access a Redis instance running on the host node, you'll need to add `--network host` so the
59
136
redis_exporter container can access it:
60
137
61
138
```sh
62
139
$ docker run -d --name redis_exporter --network host oliver006/redis_exporter
63
140
```
64
141
65
-
### Run on Kubernetes
66
-
67
-
[Here](contrib/k8s-redis-and-exporter-deployment.yaml) is an example Kubernetes deployment configuration for how to deploy the redis_exporter as a sidecar with a Redis instance.
68
-
69
-
70
-
### Run on Openshift
71
-
72
-
In order to deploy the exporter on Openshift environment.
73
142
74
-
```sh
75
-
oc project <myproject>
76
-
77
-
oc process -f https://raw.githubusercontent.com/oliver006/redis_exporter/master/contrib/openshift-template.yaml \
78
-
-p REDIS_ADDR=<redis-service>:<redis-port> \
79
-
-p REDIS_PASSWORD=<redis-pass> \
80
-
-p REDIS_ALIAS=<redis-alias> \
81
-
-p REDIS_FILE=<redis-file> \
82
-
| oc create -f -
83
-
```
84
-
85
-
*NOTE*: Some of the parameters can be omitted if no authentication is used or the default redis config is applied.
86
-
87
-
```sh
88
-
oc process -f https://raw.githubusercontent.com/oliver006/redis_exporter/master/contrib/openshift-template.yaml \
89
-
-p REDIS_ADDR=<redis-service>:<redis-port> \
90
-
| oc create -f -
91
-
```
92
143
93
-
If you are running Prometheus on Openshift on the same cluster, **target** in `prometheus.yml` should point to the correct service name of the exporter
94
-
95
-
```yaml
96
-
scrape_configs:
144
+
### Run on Kubernetes
97
145
98
-
...
146
+
[Here](contrib/k8s-redis-and-exporter-deployment.yaml) is an example Kubernetes deployment configuration for how to deploy the redis_exporter as a sidecar to a Redis instance.
redis.addr | REDIS_ADDR | Address of the Redis instance, defaults to `redis://localhost:6379`.
155
+
redis.password | REDIS_PASSWORD | Password of the Redis instance, defaults to `""` (no password).
156
+
check-keys | REDIS_EXPORTER_CHECK_KEYS | Comma separated list of key patterns to export value and length/size, eg: `db3=user_count`will export key `user_count` from db `3`. db defaults to `0` if omitted. The key patterns specified with this flag will be found using [SCAN](https://redis.io/commands/scan). Use this option if you need glob pattern matching; `check-single-keys` is faster for non-pattern keys.
157
+
check-single-keys | REDIS_EXPORTER_CHECK_SINGLE_KEYS | Comma separated list of keys to export value and length/size, eg: `db3=user_count`will export key `user_count` from db `3`. db defaults to `0` if omitted. The keys specified with this flag will be looked up directly without any glob pattern matching. Use this option if you don't need glob pattern matching; it is faster than `check-keys`.
158
+
script | REDIS_EXPORTER_SCRIPT | Path to Redis Lua script for gathering extra metrics.
log-format | REDIS_EXPORTER_LOG_FORMAT | Log format, valid options are `txt` (default) and `json`.
161
+
namespace | REDIS_EXPORTER_NAMESPACE | Namespace for the metrics, defaults to `redis`.
162
+
connection-timeout | REDIS_EXPORTER_CONNECTION_TIMEOUT | Timeout for connection to Redis instance, defaults to "15s" (in Golang duration format)
163
+
web.listen-address | REDIS_EXPORTER_WEB_LISTEN_ADDRESS | Address to listen on for web interface and telemetry, defaults to `0.0.0.0:9121`.
164
+
web.telemetry-path | REDIS_EXPORTER_WEB_TELEMETRY_PATH | Path under which to expose metrics, defaults to `/metrics`.
165
+
redis-only-metrics | REDIS_EXPORTER_REDIS_ONLY_METRICS | Whether to also export go runtime metrics, defaults to false.
166
+
include-system-metrics | REDIS_EXPORTER_IS_TILE38 | Whether to include system metrics like `total_system_memory_bytes`, defaults to false.
167
+
is-tile38 | REDIS_EXPORTER_IS_TILE38 | Whether to scrape Tile38 specific metrics, defaults to false.
112
168
169
+
Redis instance addresses can be tcp addresses: `redis://localhost:6379`, `redis.example.com:6379` or e.g. unix sockets: `unix:///tmp/redis.sock`.\
170
+
SSL is supported by using the `rediss://` schema, for example: `rediss://azure-ssl-enabled-host.redis.cache.windows.net:6380`(note that the port is required when connecting to a non-standard 6379 port, e.g. with Azure Redis instances).\
171
+
Password-protected instances can be accessed by using the URI format including a password: `redis://h:<<PASSWORD>>@<<HOSTNAME>>:<<PORT>>`
113
172
173
+
Command line settings take precedence over any configurations provided by the environment variables.
114
174
115
-
### Flags
116
175
117
-
Name | Description
118
-
--------------------|------------
119
-
debug | Verbose debug output
120
-
log-format | Log format, valid options are `txt` (default) and `json`.
121
-
check-keys | Comma separated list of key patterns to export value and length/size, eg: `db3=user_count` will export key `user_count` from db `3`. db defaults to `0` if omitted. The key patterns specified with this flag will be found using [SCAN](https://redis.io/commands/scan). Use this option if you need glob pattern matching; `check-single-keys` is faster for non-pattern keys.
122
-
check-single-keys | Comma separated list of keys to export value and length/size, eg: `db3=user_count` will export key `user_count` from db `3`. db defaults to `0` if omitted. The keys specified with this flag will be looked up directly without any glob pattern matching. Use this option if you don't need glob pattern matching; it is faster than `check-keys`.
123
-
script | Path to Redis Lua script for gathering extra metrics.
124
-
redis.addr | Address of one or more redis nodes, comma separated, defaults to `redis://localhost:6379`.
125
-
redis.password | Password to use when authenticating to Redis
126
-
redis.password-file | Path to a file containing the password to use when authenticating to Redis (note: this is mutually exclusive with `redis.password`)
127
-
redis.alias | Alias for redis node addr, comma separated.
128
-
redis.file | Path to file containing one or more redis nodes, separated by newline. This option is mutually exclusive with redis.addr. Each line can optionally be comma-separated with the fields `<addr>,<password>,<alias>`. See [here](./contrib/sample_redis_hosts_file.txt) for an example file.
129
-
namespace | Namespace for the metrics, defaults to `redis`.
130
-
web.listen-address | Address to listen on for web interface and telemetry, defaults to `0.0.0.0:9121`.
131
-
web.telemetry-path | Path under which to expose metrics, defaults to `metrics`.
132
-
use-cf-bindings | Enable usage of Cloud Foundry service bindings. Defaults to `false`
133
-
separator | Separator used to split redis.addr, redis.password and redis.alias into several elements. Defaults to `,`
134
-
135
-
Redis node addresses can be tcp addresses like `redis://localhost:6379`, `redis.example.com:6379` or unix socket addresses like `unix:///tmp/redis.sock`.\
136
-
SSL is supported by using the `rediss://` schema, for example: `rediss://azure-ssl-enabled-host.redis.cache.windows.net:6380` (note that the port is required when connecting to a non-standard 6379 port, e.g. with Azure Redis instances).
137
-
138
-
These settings take precedence over any configurations provided by [environment variables](#environment-variables).
139
-
140
-
### Environment Variables
141
-
142
-
Name | Description
143
-
-------------------|------------
144
-
REDIS_ADDR | Address of Redis node(s)
145
-
REDIS_PASSWORD | Password to use when authenticating to Redis
146
-
REDIS_ALIAS | Alias name of Redis node(s)
147
-
REDIS_FILE | Path to file containing Redis node(s)
148
176
149
177
### What's exported?
150
178
@@ -155,6 +183,8 @@ You can also export values of keys if they're in numeric format by using the `-c
155
183
156
184
If you require custom metric collection, you can provide a [Redis Lua script](https://redis.io/commands/eval) using the `-script` flag. An example can be found [in the contrib folder](./contrib/sample_collect_script.lua).
157
185
186
+
187
+
158
188
### What does it look like?
159
189
160
190
Example [Grafana](http://grafana.org/) screenshots:\
@@ -163,8 +193,8 @@ Example [Grafana](http://grafana.org/) screenshots:\
163
193
164
194
Grafana dashboard is available on [grafana.net](https://grafana.net/dashboards/763) and/or [github.com](contrib/grafana_prometheus_redis_dashboard.json).
165
195
166
-
Grafana dashboard with host & alias selector is available on [github.com](contrib/grafana_prometheus_redis_dashboard_alias.json).
196
+
167
197
168
198
### What else?
169
199
170
-
Open an issue or PR if you have more suggestions or ideas about what to add.
200
+
Open an issue or PR if you have more suggestions, questions or ideas about what to add.
0 commit comments