loki is a log aggregation system designed to store and query logs from all your applications and infrastructure. This role helps you to set up loki:
- with everything run in Docker containers
- powered by the official loki container image
To configure and install loki on your own server(s), you should use a playbook like Mother of all self-hosting or write your own.
To enable this service, add the following configuration to your vars.yml
file and re-run the installation process:
########################################################################
# #
# loki #
# #
########################################################################
loki_enabled: true
########################################################################
# #
# /loki #
# #
########################################################################
By setting a hostname you will expose loki on this domain. Usually you should also set up basic_auth in this case, otherwise everyone will be able to access your metrics
loki_hostname: loki.example.org
# Uncomment following lines to add basic auth
#loki_container_labels_metrics_middleware_basic_auth_enabled: true
#loki_container_labels_metrics_middleware_basic_auth_users : '<user>:<hashed_password>'
After installing, refer to the official documentation to send logs throught loki's API without an agent. The Promtail agent is coming soon