docs: rewrite README with structured overview and quick start guide
Replaces the minimal project description with a comprehensive README including a component overview table, quick start instructions, common Ansible operations, and links to detailed documentation. Aligns with Red Panda Approval™ standards.
This commit is contained in:
196
ansible/alloy/puck/config.alloy.j2
Normal file
196
ansible/alloy/puck/config.alloy.j2
Normal file
@@ -0,0 +1,196 @@
|
||||
// Puck Alloy Configuration
|
||||
// Red Panda Approved 🐼
|
||||
// Services: Log collection, Process metrics, Docker/cAdvisor metrics
|
||||
|
||||
logging {
|
||||
level = "{{alloy_log_level}}"
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// LOG COLLECTION - Loki Forwarding
|
||||
// ============================================================================
|
||||
|
||||
loki.source.file "system_logs" {
|
||||
targets = [
|
||||
{__path__ = "/var/log/syslog", job = "syslog"},
|
||||
{__path__ = "/var/log/auth.log", job = "auth"},
|
||||
]
|
||||
forward_to = [loki.write.default.receiver]
|
||||
}
|
||||
|
||||
loki.source.journal "systemd_logs" {
|
||||
forward_to = [loki.write.default.receiver]
|
||||
labels = {
|
||||
job = "systemd",
|
||||
hostname = "{{inventory_hostname}}",
|
||||
environment = "{{deployment_environment}}",
|
||||
}
|
||||
}
|
||||
|
||||
loki.source.syslog "angelia_logs" {
|
||||
listener {
|
||||
address = "127.0.0.1:{{angelia_syslog_port}}"
|
||||
protocol = "tcp"
|
||||
syslog_format = "{{ syslog_format }}"
|
||||
labels = {
|
||||
job = "angelia",
|
||||
hostname = "{{inventory_hostname}}",
|
||||
environment = "{{deployment_environment}}",
|
||||
}
|
||||
}
|
||||
forward_to = [loki.write.default.receiver]
|
||||
}
|
||||
|
||||
loki.source.syslog "athena_logs" {
|
||||
listener {
|
||||
address = "127.0.0.1:{{athena_syslog_port}}"
|
||||
protocol = "tcp"
|
||||
syslog_format = "{{ syslog_format }}"
|
||||
labels = {
|
||||
job = "athena",
|
||||
hostname = "{{inventory_hostname}}",
|
||||
environment = "{{deployment_environment}}",
|
||||
}
|
||||
}
|
||||
forward_to = [loki.write.default.receiver]
|
||||
}
|
||||
|
||||
loki.source.syslog "kairos_logs" {
|
||||
listener {
|
||||
address = "127.0.0.1:{{kairos_syslog_port}}"
|
||||
protocol = "tcp"
|
||||
syslog_format = "{{ syslog_format }}"
|
||||
labels = {
|
||||
job = "kairos",
|
||||
hostname = "{{inventory_hostname}}",
|
||||
environment = "{{deployment_environment}}",
|
||||
}
|
||||
}
|
||||
forward_to = [loki.write.default.receiver]
|
||||
}
|
||||
|
||||
loki.source.syslog "sagittarius_logs" {
|
||||
listener {
|
||||
address = "127.0.0.1:{{sagittarius_syslog_port}}"
|
||||
protocol = "tcp"
|
||||
syslog_format = "{{ syslog_format }}"
|
||||
labels = {
|
||||
job = "sagittarius",
|
||||
hostname = "{{inventory_hostname}}",
|
||||
environment = "{{deployment_environment}}",
|
||||
}
|
||||
}
|
||||
forward_to = [loki.write.default.receiver]
|
||||
}
|
||||
|
||||
loki.source.syslog "spelunker_logs" {
|
||||
listener {
|
||||
address = "127.0.0.1:{{spelunker_syslog_port}}"
|
||||
protocol = "tcp"
|
||||
syslog_format = "{{ syslog_format }}"
|
||||
labels = {
|
||||
job = "spelunker",
|
||||
hostname = "{{inventory_hostname}}",
|
||||
environment = "{{deployment_environment}}",
|
||||
}
|
||||
}
|
||||
forward_to = [loki.write.default.receiver]
|
||||
}
|
||||
|
||||
loki.source.syslog "jupyterlab_logs" {
|
||||
listener {
|
||||
address = "127.0.0.1:{{jupyterlab_syslog_port}}"
|
||||
protocol = "tcp"
|
||||
syslog_format = "{{ syslog_format }}"
|
||||
labels = {
|
||||
job = "jupyterlab",
|
||||
hostname = "{{inventory_hostname}}",
|
||||
environment = "{{deployment_environment}}",
|
||||
}
|
||||
}
|
||||
forward_to = [loki.write.default.receiver]
|
||||
}
|
||||
|
||||
loki.write "default" {
|
||||
endpoint {
|
||||
url = "{{loki_url}}"
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// METRICS COLLECTION - Prometheus Remote Write
|
||||
// ============================================================================
|
||||
|
||||
// Unix/Node metrics - Incus-safe collectors only
|
||||
// Disabled collectors that don't work in containers: hwmon, thermal, mdadm, powersupplyclass, nvme
|
||||
prometheus.exporter.unix "default" {
|
||||
include_exporter_metrics = true
|
||||
disable_collectors = [
|
||||
"arp",
|
||||
"bcache",
|
||||
"bonding",
|
||||
"btrfs",
|
||||
"hwmon",
|
||||
"infiniband",
|
||||
"ipvs",
|
||||
"mdadm",
|
||||
"nfs",
|
||||
"nfsd",
|
||||
"nvme",
|
||||
"powersupplyclass",
|
||||
"rapl",
|
||||
"thermal_zone",
|
||||
"zfs",
|
||||
]
|
||||
}
|
||||
|
||||
// Process exporter - Track all processes by command name
|
||||
// Provides: namedprocess_namegroup_* metrics
|
||||
prometheus.exporter.process "default" {
|
||||
track_children = true
|
||||
track_threads = true
|
||||
gather_smaps = false
|
||||
recheck_on_scrape = true
|
||||
|
||||
matcher {
|
||||
name = "{% raw %}{{.Comm}}{% endraw %}"
|
||||
cmdline = [".+"]
|
||||
}
|
||||
}
|
||||
|
||||
// cAdvisor - Docker container metrics
|
||||
// Provides: container_* metrics for CPU, memory, network, disk
|
||||
prometheus.exporter.cadvisor "default" {
|
||||
docker_host = "unix:///var/run/docker.sock"
|
||||
storage_duration = "5m"
|
||||
docker_only = true
|
||||
}
|
||||
|
||||
// Scrape all local exporters
|
||||
prometheus.scrape "local_exporters" {
|
||||
targets = concat(
|
||||
prometheus.exporter.unix.default.targets,
|
||||
prometheus.exporter.process.default.targets,
|
||||
prometheus.exporter.cadvisor.default.targets,
|
||||
)
|
||||
forward_to = [prometheus.relabel.add_instance.receiver]
|
||||
scrape_interval = "15s"
|
||||
job_name = "puck"
|
||||
}
|
||||
|
||||
// Add instance label for Prometheus compatibility
|
||||
prometheus.relabel "add_instance" {
|
||||
forward_to = [prometheus.remote_write.default.receiver]
|
||||
|
||||
rule {
|
||||
target_label = "instance"
|
||||
replacement = "{{inventory_hostname}}"
|
||||
}
|
||||
}
|
||||
|
||||
// Remote write to Prospero Prometheus
|
||||
prometheus.remote_write "default" {
|
||||
endpoint {
|
||||
url = "{{prometheus_remote_write_url}}"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user