Skip to content

Commit

Permalink
Add packages for Prometheus metrics (#3)
Browse files Browse the repository at this point in the history
* Add packages for prometheus and node-exporter

* Update `CHANGELOG.md`

* Add missing volume spec for the prometheus service

* Try to fix prometheus reverse-proxying

* Fix issues with prometheus deployment

* Add package for grafana

* Fix syntax error in grafana package definition

* Fix anonymous grana login

* Expose prometheus server on host port 9090

* Try to fix host port conflict between prometheus and cockpit

* Try again to fix prometheus deployment problems

* Don't expose prometheus on host port, since reverse-proxying works for grafana

* Try to support prometheus docker service discovery

* Try fixing prometheus access to docker socket

* Set up prometheus service discovery with docker labels

* Fix prometheus scrape intervals

* Remove TODO notes for links to add to device-portal

* Fix scrape timeout for node-exporter

* Provide prometheus config as part of the forklift package

* Suppress unnamed volumes from filebrowser instances

* Suppress unnamed volumes from the mosquitto instance

* Change underscores to hyphens in Docker volume names

* Try to make grafana automatically provision the prometheus datasource

* Try to make grafana automatically provision the host summary dashboard

* Bump device-portal to add links to prometheus & grafana

* Upgrade container images to their latest versions

* Troubleshoot incorrect scrape intervals

* Fix grafana dashboard behavior when system time is incorrect, remove CPU usage gauge
  • Loading branch information
ethanjli authored Jan 12, 2024
1 parent 10a3cce commit 07ef1cc
Show file tree
Hide file tree
Showing 28 changed files with 2,719 additions and 29 deletions.
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ All dates in this file are given in the [UTC time zone](https://en.wikipedia.org
### Added

- Added a new `core/apps/dozzle` package for viewing Docker container logs.
- Added a new `core/infra/prometheus` package for handling all Prometheus metrics.
- Added a new `core/apps/node-exporter` package for generating Prometheus metrics about the state of the host system.
- Added a new `core/apps/grafana` package for visualizing Prometheus metrics, including a dashboard summarizing the state of the host system.

### Changed

- Upgraded `core/apps/planktoscope/device-portal`'s container image from v0.1.12 to v0.1.14.
- Upgraded all packages which use the `alpine` container image from 3.18.3 to 3.19.0.
- Upgraded all packages which use the `filebrowser/filebrowser` container image from v2.24.2 to v2.27.0.
- Upgraded `core/apps/portainer`'s container image from 2.18.4 to 2.19.4.
- Upgraded `core/infra/caddy-ingress`'s container image from 2.8.6 to 2.8.10.
- Upgraded `core/infra/mosquitto`'s container image from 2.0.17 to 2.0.18.

### Fixed

- Removed unnamed volumes created by the packages for filebrowser instances and for mosquitto.
- Changed underscores to hyphens in Docker volume names, for consistency with Docker network names.

## v2023.9.0 - 2023-12-30

Expand Down Expand Up @@ -40,7 +57,7 @@ All dates in this file are given in the [UTC time zone](https://en.wikipedia.org

### Changed

- Upgraded core/apps/planktoscope/device-backend's container image from v0.1.10 to v0.1.11
- Upgraded core/apps/planktoscope/device-portal's container image from v0.1.10 to v0.1.11
- Upgraded core/apps/planktoscope/project-docs's container image from v2023.9.0-alpha.2 to v2023.9.0-beta.1

## v2023.9.0-beta.0 - 2023-09-02
Expand Down
2 changes: 1 addition & 1 deletion core/apps/cockpit/compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
reverse-proxy-config:
image: alpine:3.18.3
image: alpine:3.19.0
command: sh -c 'while sleep 3600; do :; done'

networks:
Expand Down
7 changes: 4 additions & 3 deletions core/apps/filebrowser-root/compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
services:
server:
image: filebrowser/filebrowser:v2.24.2
image: filebrowser/filebrowser:v2.27.0
volumes:
- /:/root
- server_data:/database
- /:/srv # this prevents filebrowser from making an unnamed volume
- server-data:/database
environment:
- FB_DATABASE=/database/filebrowser.db
- FB_ROOT=/root
Expand All @@ -14,4 +15,4 @@ networks:
external: true

volumes:
server_data: {}
server-data: {}
17 changes: 17 additions & 0 deletions core/apps/grafana/compose-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
services:
server:
networks:
- caddy-ingress
environment:
- GF_SERVER_ROOT_URL=/admin/grafana
- GF_SERVER_SERVE_FROM_SUB_PATH=true
- GF_SECURITY_ALLOW_EMBEDDING=true
labels:
caddy: :80
caddy.redir: /admin/grafana /admin/grafana/
caddy.handle: /admin/grafana/*
caddy.handle.reverse_proxy: "{{upstreams 3000}}"

networks:
caddy-ingress:
external: true
9 changes: 9 additions & 0 deletions core/apps/grafana/compose-no-login.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
server:
environment:
- GF_AUTH_DISABLE_LOGIN_FORM=true
- GF_AUTH_ANONYMOUS_ENABLED=true
# `Main Org.` is the default organization, needed for anonymous login:
- GF_AUTH_ANONYMOUS_ORG_NAME=Main Org.
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_BASIC=false
20 changes: 20 additions & 0 deletions core/apps/grafana/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
services:
server:
image: grafana/grafana-oss:10.1.6
volumes:
- server-data:/var/lib/grafana
- ./provisioning:/provisioning
- ./dashboards:/provisioned-dashboards
extra_hosts:
- host.docker.internal:host-gateway
environment:
- GF_PATHS_PROVISIONING=/provisioning
- GF_SECURITY_ANGULAR_SUPPORT_ENABLED=false

networks:
default:
name: none
external: true

volumes:
server-data: {}
Loading

0 comments on commit 07ef1cc

Please sign in to comment.