68 lines
No EOL
1.9 KiB
Django/Jinja
68 lines
No EOL
1.9 KiB
Django/Jinja
logging {
|
|
level = "info"
|
|
format = "logfmt"
|
|
}
|
|
|
|
prometheus.remote_write "mimir" {
|
|
endpoint {
|
|
url = "https://{{ lgtm_stack_mimir_domain }}/api/v1/push"
|
|
}
|
|
}
|
|
|
|
prometheus.exporter.self "alloy" {}
|
|
prometheus.scrape "alloy" {
|
|
targets = prometheus.exporter.self.alloy.targets
|
|
forward_to = [prometheus.remote_write.mimir.receiver]
|
|
}
|
|
|
|
prometheus.exporter.postgres "default" {
|
|
data_source_names = ["postgresql://{{ svc.postgresql_collector.user }}:{{ svc.postgresql_collector.pass }}@{{ svc.postgresql_collector.host }}:{{ svc.postgresql_collector.port }}/{{ svc.postgresql_collector.database }}?sslmode=verify-full"]
|
|
|
|
autodiscovery {
|
|
enabled = true
|
|
}
|
|
}
|
|
prometheus.scrape "postgres" {
|
|
targets = prometheus.exporter.postgres.default.targets
|
|
forward_to = [prometheus.remote_write.mimir.receiver]
|
|
}
|
|
|
|
prometheus.scrape "node_exporter" {
|
|
targets = [
|
|
{% for host_data in opentofu.hosts.values() %}
|
|
{"__address__" = "{{ host_data.fqdn_vpn }}:9100", "instance" = "{{ host_data.hostname }}"},
|
|
{% endfor %}
|
|
]
|
|
forward_to = [prometheus.remote_write.mimir.receiver]
|
|
}
|
|
|
|
prometheus.scrape "caddy" {
|
|
targets = [
|
|
{% for host_data in opentofu.hosts.values() %}
|
|
{"__address__" = "{{ host_data.fqdn_vpn }}", "instance" = "{{ host_data.hostname }}"},
|
|
{% endfor %}
|
|
]
|
|
forward_to = [prometheus.remote_write.mimir.receiver]
|
|
}
|
|
|
|
|
|
{% for job in lgtm_stack_alloy_jobs %}
|
|
|
|
prometheus.scrape "{{ job.name }}" {
|
|
targets = [
|
|
{% for target in job.targets %}
|
|
{
|
|
"__address__" = "{{ target.address }}",
|
|
"__metrics_path__" = "{{ target.path }}",
|
|
"__scheme__" = "https",
|
|
{% if 'job' in target %}"job" = "{{ target.job }}",{% endif %}
|
|
{% if 'instance' in target %}"instance" = "{{ target.instance }}",{% endif %}
|
|
},
|
|
{% endfor %}
|
|
]
|
|
|
|
scrape_interval = "{{ job.scrape_interval }}"
|
|
forward_to = [prometheus.remote_write.mimir.receiver]
|
|
}
|
|
|
|
{% endfor %} |