Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .mdox.validator.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
version: 1
explicitLocalValidators: true

# Don't check external URLs, they can time-out a lot (rate limits).
# Don't check repo-local absolute URLs, they resolve to site routes rather than
# files on the local filesystem. Keep validating other local (relative) links.
validators:
- type: ignore
regex: http(s|)://.*
regex: http(s|)://.*
- type: ignore
regex: ^/.*
- type: local
regex: ^.*$
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MD_FILES_TO_FORMAT=docs/specs/om/open_metrics_spec_2_0.md

MDOX="mdox"
$(MDOX):
@go install github.com/bwplotka/mdox@v0.9.0
@go install github.com/bwplotka/mdox@e88e0a8655a0c91ef6a849edd29798e7e4809d75

.PHONY: help
help: ## Displays help.
Expand Down
19 changes: 11 additions & 8 deletions docs/guides/cadvisor.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Now we'll need to create a Docker Compose [configuration](https://docs.docker.co
In the same folder where you created the [`prometheus.yml`](#prometheus-configuration) file, create a `docker-compose.yml` file and populate it with this Docker Compose configuration:

### Using Bind Mounts

```yaml
version: '3.2'
services:
Expand Down Expand Up @@ -63,8 +64,8 @@ services:
This configuration instructs Docker Compose to run three services, each of which corresponds to a [Docker](https://docker.com) container:

1. The `prometheus` service uses the local `prometheus.yml` configuration file (imported into the container by the `volumes` parameter).
1. The `cadvisor` service exposes port 8080 (the default port for cAdvisor metrics) and relies on a variety of local volumes (`/`, `/var/run`, etc.).
1. The `redis` service is a standard Redis server. cAdvisor will gather container metrics from this container automatically, i.e. without any further configuration.
2. The `cadvisor` service exposes port 8080 (the default port for cAdvisor metrics) and relies on a variety of local volumes (`/`, `/var/run`, etc.).
3. The `redis` service is a standard Redis server. cAdvisor will gather container metrics from this container automatically, i.e. without any further configuration.

To run the installation:

Expand Down Expand Up @@ -93,6 +94,7 @@ cadvisor /usr/bin/cadvisor -logtostderr Up 8080/tcp
prometheus /bin/prometheus --config.f ... Up 0.0.0.0:9090->9090/tcp
redis docker-entrypoint.sh redis ... Up 0.0.0.0:6379->6379/tcp
```

### Alternative: Using Inline Docker Configs (Remote Deployments)

If you're managing a remote Docker host and prefer to keep all configuration within the docker-compose.yml file (avoiding the need to manage separate config files on the host), you can use Docker's configs feature:
Expand Down Expand Up @@ -155,6 +157,7 @@ services:
- `mode: 0400` - File permissions (read-only for owner)

Omitting these fields or using string values like `"nobody"` will cause the following error:

```
strconv.Atoi: parsing "nobody": invalid syntax
```
Expand All @@ -177,12 +180,12 @@ NOTE: A full listing of cAdvisor-gathered container metrics exposed to Prometheu

The table below lists some other example expressions

Expression | Description | For
:----------|:------------|:---
[`rate(container_cpu_usage_seconds_total{name="redis"}[1m])`](http://localhost:9090/graph?g0.range_input=1h&g0.expr=rate(container_cpu_usage_seconds_total%7Bname%3D%22redis%22%7D%5B1m%5D)&g0.tab=1) | The [cgroup](https://en.wikipedia.org/wiki/Cgroups)'s CPU usage in the last minute | The `redis` container
[`container_memory_usage_bytes{name="redis"}`](http://localhost:9090/graph?g0.range_input=1h&g0.expr=container_memory_usage_bytes%7Bname%3D%22redis%22%7D&g0.tab=1) | The cgroup's total memory usage (in bytes) | The `redis` container
[`rate(container_network_transmit_bytes_total[1m])`](http://localhost:9090/graph?g0.range_input=1h&g0.expr=rate(container_network_transmit_bytes_total%5B1m%5D)&g0.tab=1) | Bytes transmitted over the network by the container per second in the last minute | All containers
[`rate(container_network_receive_bytes_total[1m])`](http://localhost:9090/graph?g0.range_input=1h&g0.expr=rate(container_network_receive_bytes_total%5B1m%5D)&g0.tab=1) | Bytes received over the network by the container per second in the last minute | All containers
| Expression | Description | For |
|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:----------------------|
| [`rate(container_cpu_usage_seconds_total{name="redis"}[1m])`](http://localhost:9090/graph?g0.range_input=1h&g0.expr=rate(container_cpu_usage_seconds_total%7Bname%3D%22redis%22%7D%5B1m%5D)&g0.tab=1) | The [cgroup](https://en.wikipedia.org/wiki/Cgroups)'s CPU usage in the last minute | The `redis` container |
| [`container_memory_usage_bytes{name="redis"}`](http://localhost:9090/graph?g0.range_input=1h&g0.expr=container_memory_usage_bytes%7Bname%3D%22redis%22%7D&g0.tab=1) | The cgroup's total memory usage (in bytes) | The `redis` container |
| [`rate(container_network_transmit_bytes_total[1m])`](http://localhost:9090/graph?g0.range_input=1h&g0.expr=rate(container_network_transmit_bytes_total%5B1m%5D)&g0.tab=1) | Bytes transmitted over the network by the container per second in the last minute | All containers |
| [`rate(container_network_receive_bytes_total[1m])`](http://localhost:9090/graph?g0.range_input=1h&g0.expr=rate(container_network_receive_bytes_total%5B1m%5D)&g0.tab=1) | Bytes received over the network by the container per second in the last minute | All containers |

## Summary

Expand Down
Loading