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
Periodically, the source code is recompiled and the resulting image is pushed to [prom/prometheus](https://hub.docker.com/r/prom/prometheus) on *DockerHub*.
89
89
90
-
### IOTstack menu
90
+
### <aname="iotstackMenu"></a>IOTstack menu
91
91
92
92
When you select *Prometheus* in the IOTstack menu, the *template service definition* is copied into the *Compose* file.
93
93
94
94
> Under old menu, it is also copied to the *working service definition* and then not really used.
95
95
96
-
### IOTstack first run
96
+
### <aname="iotstackFirstRun"></a>IOTstack first run
97
97
98
98
On a first install of IOTstack, you run the menu, choose *Prometheus* as one of your containers, and are told to do this:
99
99
@@ -124,7 +124,7 @@ The *Dockerfile* begins with:
124
124
FROM prom/prometheus:latest
125
125
```
126
126
127
-
> If you need to pin to a particular version of *Prometheus*, the *Dockerfile* is the place to do it. See [*Prometheus* version pinning](#prometheus-version-pinning).
127
+
> If you need to pin to a particular version of *Prometheus*, the *Dockerfile* is the place to do it. See [*Prometheus* version pinning](#versionPinning).
128
128
129
129
The `FROM` statement tells the build process to pull down the ***base image*** from [*DockerHub*](https://hub.docker.com).
130
130
@@ -158,15 +158,15 @@ You *may* see the same pattern in Portainer, which reports the *base image* as "
158
158
159
159
> Whether you see one or two rows depends on the version of `docker-compose` you are using and how your version of `docker-compose` builds local images.
160
160
161
-
### Dependencies: *CAdvisor* and *Node Exporter*
161
+
### <aname="dependencies"></a>Dependencies: *CAdvisor* and *Node Exporter*
162
162
163
163
The *CAdvisor* and *Node Exporter* are included in the *Prometheus* service definition as dependent containers. What that means is that each time you start *Prometheus*, `docker-compose` ensures that *CAdvisor* and *Node Exporter* are already running, and keeps them running.
164
164
165
-
The [default configuration](#active-configuration-file) for *Prometheus* assumes *CAdvisor* and *Node Exporter* are running and starts scraping information from those targets as soon as it launches.
165
+
The [default configuration](#activeConfig) for *Prometheus* assumes *CAdvisor* and *Node Exporter* are running and starts scraping information from those targets as soon as it launches.
The configuration directory for the IOTstack implementation of *Prometheus* is at the path:
172
172
@@ -181,9 +181,9 @@ That directory contains two files:
181
181
182
182
If you delete either file, *Prometheus* will replace it with a default the next time the container starts. This "self-repair" function is intended to provide reasonable assurance that *Prometheus* will at least **start** instead of going into a restart loop.
183
183
184
-
Unless you [decide to change it](#environment-variables), the `config` folder and its contents are owned by "pi:pi". This means you can edit the files in the configuration directory without needing the `sudo` command. Ownership is enforced each time the container restarts.
184
+
Unless you [decide to change it](#environmentVars), the `config` folder and its contents are owned by "pi:pi". This means you can edit the files in the configuration directory without needing the `sudo` command. Ownership is enforced each time the container restarts.
The file named `config.yml` is the active configuration. This is the file you should edit if you want to make changes. The default structure of the file is:
189
189
@@ -213,7 +213,7 @@ Note:
213
213
214
214
* The YAML parser used by *Prometheus* seems to be ***exceptionally*** sensitive to syntax errors (far less tolerant than `docker-compose`). For this reason, you should **always** check the *Prometheus* log after any configuration change.
The file named `prometheus.yml` is a reference configuration. It is a **copy** of the original configuration file that ships inside the *Prometheus* container at the path:
The IOTstack implementation of *Prometheus* supports two environment variables:
237
237
@@ -241,11 +241,11 @@ environment:
241
241
- IOTSTACK_GID=1000
242
242
```
243
243
244
-
Those variables control ownership of the [Configuration directory](#configuration-directory) and its contents. Those environment variables are present in the standard IOTstack service definition for *Prometheus* and have the effect of assigning ownership to "pi:pi".
244
+
Those variables control ownership of the [Configuration directory](#configDir) and its contents. Those environment variables are present in the standard IOTstack service definition for *Prometheus* and have the effect of assigning ownership to "pi:pi".
245
245
246
-
If you delete those environment variables from your *Compose* file, the [Configuration directory](#configuration-directory) will be owned by "nobody:nobody"; otherwise the directory and its contents will be owned by whatever values you pass for those variables.
246
+
If you delete those environment variables from your *Compose* file, the [Configuration directory](#configDir) will be owned by "nobody:nobody"; otherwise the directory and its contents will be owned by whatever values you pass for those variables.
Under the original IOTstack implementation of *Prometheus* (just "as it comes" from *DockerHub*), the service definition expected the configuration file to be at:
251
251
@@ -276,7 +276,7 @@ Note:
276
276
277
277
* The YAML parser used by *Prometheus* is very sensitive to syntax errors. Always check the *Prometheus* log after any configuration change.
You can update `cadvisor` and `nodeexporter` like this:
282
282
@@ -320,7 +320,7 @@ The `prune` is the simplest way of cleaning up. The first call removes the old *
320
320
321
321
> Whether an old *base image* exists depends on the version of `docker-compose` you are using and how your version of `docker-compose` builds local images.
322
322
323
-
### *Prometheus* version pinning
323
+
### <aname="versionPinning"></a>*Prometheus* version pinning
324
324
325
325
If you need to pin *Prometheus* to a particular version:
0 commit comments