forked from coop-cloud/monitoring-ng
feat: send metrics to prometheus
This commit is contained in:
@@ -19,6 +19,7 @@ ENABLE_BACKUPS=true
|
||||
#
|
||||
## Prometheus
|
||||
# COMPOSE_FILE="$COMPOSE_FILE:compose.prometheus.yml"
|
||||
# PROMETHEUS_REMOTE_WRITE_URL=https://prometheus.$DOMAIN/api/v1/write
|
||||
# PROMETHEUS_RETENTION_TIME=1y
|
||||
#
|
||||
## Prometheus Pushgateway
|
||||
|
||||
@@ -12,7 +12,7 @@ export PROMETHEUS_YML_VERSION=v2
|
||||
export MATRIX_ALERTMANAGER_CONFIG_VERSION=e
|
||||
export MATRIX_ALERTMANAGER_ENTRYPOINT_VERSION=a
|
||||
export GRAFANA_ALERTS_NODE_VERSION=v1c
|
||||
export CONFIG_ALLOY_VERSION=v2
|
||||
export CONFIG_ALLOY_VERSION=v4
|
||||
|
||||
# creates a default prometheus scrape config for a given node
|
||||
add_node(){
|
||||
|
||||
@@ -16,6 +16,8 @@ services:
|
||||
- "/etc/alloy/config.alloy"
|
||||
networks:
|
||||
- internal
|
||||
secrets:
|
||||
- basic_auth
|
||||
deploy:
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
@@ -34,3 +36,7 @@ networks:
|
||||
internal:
|
||||
volumes:
|
||||
alloy-data:
|
||||
secrets:
|
||||
basic_auth:
|
||||
external: true
|
||||
name: ${STACK_NAME}_basic_auth_${SECRET_BASIC_AUTH_VERSION}
|
||||
|
||||
@@ -5,3 +5,26 @@ logging {
|
||||
|
||||
prometheus.exporter.cadvisor "docker" {
|
||||
}
|
||||
|
||||
prometheus.scrape "default" {
|
||||
targets = array.concat(
|
||||
[{
|
||||
job = "alloy",
|
||||
__address__ = "127.0.0.1:12345",
|
||||
}],
|
||||
prometheus.exporter.cadvisor.docker.targets,
|
||||
)
|
||||
|
||||
forward_to = [prometheus.remote_write.prometheus.receiver]
|
||||
}
|
||||
|
||||
prometheus.remote_write "prometheus" {
|
||||
endpoint {
|
||||
url = "{{ env "PROMETHEUS_REMOTE_WRITE_URL" }}"
|
||||
|
||||
basic_auth {
|
||||
username = "admin"
|
||||
password = "{{ secret "basic_auth" }}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user