Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compose monitoring profile #1589

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bwbroersma
Copy link
Collaborator

@bwbroersma bwbroersma commented Dec 9, 2024

@bwbroersma bwbroersma requested a review from aequitas December 9, 2024 22:25
@mxsasha
Copy link
Collaborator

mxsasha commented Dec 9, 2024

The number of profiles seems to be rapidly expanding. We've had a dev misconfiguration for them already. I think we need one place in the deployment docs where they are all listed, along with defaults and recommendations. Particularly as misconfiguration may not be immediately obvious.

@bwbroersma
Copy link
Collaborator Author

bwbroersma commented Dec 9, 2024

Agree, also wonder if all services with the monitoring profile should also have the alertmanager profile?

It seems after this addition there are these profiles defined in the compose files:

  • alertmanager
  • build
  • connectiontest
  • cron
  • monitoring
  • routinator
  • run-tests

I see batch used in 2 .env files:

COMPOSE_PROFILES=connectiontest,cron,routinator,batch,build

COMPOSE_PROFILES=batch,cron

However, its unused in all compose files.

Removing the unused batch profile from env.
Adding the alertmanager profile to all monitoring services.
docker/compose.yaml Outdated Show resolved Hide resolved
@@ -1,6 +1,6 @@
# Metrics

The Docker deployment includes a metrics collection system which is available on production as well as development/test environments. It consists of a Prometheus metrics server which scrapes metrics from various exporters. Grafana is provided as frontend to visualise metrics and create graphs/dashboards.
The Docker deployment includes a metrics collection system which is available on production as well as development/test environments. It consists of a Prometheus metrics server which scrapes metrics from various exporters. Grafana is provided as frontend to visualise metrics and create graphs/dashboards. The various exporters, Prometheus and Grafana containers can be disabled by not loading the `monitoring` profile, by overriding the default profiles with e.g. `COMPOSE_PROFILES=cron` in `local.env`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should refrain from giving these kinds of instructions for COMPOSE_PROFILES completely (for which I'm guilty of as well). And go with @mxsasha idea #1589 (comment) and have 1 place in the documentation to refer to with a table with all possible permutations of COMPOSE_PROFILES (that are sane at least) and have them copy pasteable so there is no ambiguity.

@bwbroersma bwbroersma marked this pull request as draft December 11, 2024 23:13
@bwbroersma
Copy link
Collaborator Author

@aequitas I think we discusses this also, and some compose profiles (batch) are indeed no longer used and can be deleted right? Is there still an use case to keep run-tests?

@bwbroersma
Copy link
Collaborator Author

bwbroersma commented Jan 21, 2025

Idea:

  • add more documentation to the compose file
  • generate container list (and which are crucial) from this
  • include in which profiles containers are

@bwbroersma
Copy link
Collaborator Author

bwbroersma commented Jan 28, 2025

$ yq -r '"container|profiles|description","-|-|-",.services|to_entries|map([.key,(.value.profiles //[]|join(", "),(.key|head_comment))]|join("|"))[]' compose.yaml|sed 's/$/|/'|column -ts\| -o' | '|sed 's/^/| /;s/ $//;2{s/ /-/g}'

using yq, sed and column (maybe also add -W3 -c120 to column call).
Alternatively markdown-table could be used:

$ yq -r '"container|profiles|description",.services|to_entries|map([.key,(.value.profiles //[]|join(", "),(.key|head_comment))]|join("|"))[]' compose.yaml|markdown-table -s\|
container profiles description
webserver nginx proxy container
app django container
db-migrate django DB migrations
worker worker for queue
worker-nassl worker for queue with potential memory leak
worker-slow worker for slow and long running tasks that could require a lot of memory (eg: hof update)
beat celery task queue
redis redis cache / state
rabbitmq rabbitmq message-broker
postgres PostgreSQL database
routinator routinator Routinator for RPKI
unbound connectiontest unbound DNS server used for connection test
resolver-permissive unbound resolver used for all DNS queries by app, worker, etc that needs to ignore DNSSEC errors and pass them on to the client
resolver-validating unbound resolver used for ldns-dane that require DNSSEC validation
cron cron cron with periodic tasks
cron-docker cron cron daemon with access to Docker socket but no networking
grafana monitoring grafana to visualize the monitoring
prometheus monitoring prometheus for monitoring
alertmanager alertmanager alertmanager for sending monitoring alerts (also requires monitoring profile)
postgresql-exporter monitoring provide PostgreSQL metrics for monitoring
redis-exporter monitoring provide redis metrics for monitoring
statsd-exporter monitoring provide statsd metrics for monitoring
celery-exporter monitoring provide celery metrics for monitoring
node-exporter monitoring provide node metrics for monitoring
docker_stats_exporter monitoring provide docker container metrics for monitoring
nginx_logs_exporter monitoring provide nginx metrics for monitoring

Questions:

  • Where/when to write this table?
  • Add table with profile description?
  • If so, where to make this ideally single profile comment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Options to only create main part of internet.nl Batch API (Django)
3 participants