cfg/app
Dustin 45c35c065a promtail: Deploy Loki Promtail Agent
[Promtail][0] is the log collection agent for Grafana Loki.  It reads
logs from various locations, including local files and the _systemd_
journal and sends them to Loki via HTTP.

Loki configuration is a highly-structured YAML document.  Thus, instead
of using Tera template syntax for loops, conditionals, etc., we can use
the full power of CUE to construct the configuration.  Using the
`Marshal` function from the built-in `encoding/yaml` package, we
serialize the final configuration structure as a string and write it
verbatim to the configuration file.

I have modeled most of the Promtail configuration schema in the
`du5t1n.me/cfg/app/promtail/schema` package.  Having the schema modeled
will ensure the generated configuration is valid during development
(i.e. `cue export` will fail if it is not), which will save time pushing
changes to machines and having Loki complain.

The `#promtail` "function" in `du5t1n.me/cfg/env/prod` makes it easy to
build our desired configuration.  It accepts an optional `#scrape`
field, which can be used to provide specific log scraping definitions.
If it is unspecified, the default configuration is to scrape the systemd
journal.  Hosts with additional needs can supply their own list,
probably including the `promtail.scrape.journal` object in it to get the
default journal scrape job.

[0]: https://grafana.com/docs/loki/latest/send-data/promtail/
2024-02-18 11:35:13 -06:00
..
collectd collectd: Deploy collectd in a container 2024-01-17 17:35:21 -06:00
containerudev Restructure CUE packages 2024-01-17 17:35:18 -06:00
fetchcert fetchcert: Deploy tool to get cert from k8s Secret 2024-02-18 10:48:01 -06:00
loki loki: Run Grafana Loki in a container 2024-02-13 19:54:48 -06:00
nut nut: Fix upsmon reload hook 2024-01-19 18:01:42 -06:00
promtail promtail: Deploy Loki Promtail Agent 2024-02-18 11:35:13 -06:00
ssh app/ssh: Configure sshd trusted user CA keys 2024-02-03 11:16:52 -06:00
sudo sudo: Configure pam_ssh_agent_auth 2024-01-29 09:10:42 -06:00