Skip to content

Commit 6c4edc6

Browse files
committed
Improve alloy docker image. Cleanup folders
1 parent 87924a8 commit 6c4edc6

File tree

13 files changed

+58
-198
lines changed

13 files changed

+58
-198
lines changed

observability/examples/alloy/docker-compose.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

observability/examples/alloy/prometheus/scrape-configs/probers/probe-internal.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

observability/examples/alloy/prometheus/scrape-configs/recording-rules/slo.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

observability/examples/full/alloy/probers/probe-internal.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- targets:
2+
- cogstack-observability-traefik-1/grafana/api/health
3+
labels:
4+
name: grafana
5+
job: probe-observability-stack
6+
host: localhost
7+
- targets:
8+
- cogstack-observability-traefik-1/prometheus/-/healthy
9+
labels:
10+
name: prometheus
11+
job: probe-observability-stack
12+
host: localhost

observability/examples/full/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ services:
66
image: cogstacksystems/cogstack-observability-alloy:latest
77
ports:
88
- "12345:12345"
9+
networks:
10+
- observability
911
volumes:
1012
- ${BASE_DIR-.}/alloy/probers:/etc/alloy/probers
1113
# CAdvisor

observability/examples/full/exporters.elastic.docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ services:
1515
- PROMETHEUS_URL=http://cogstack-observability-prometheus-1:9090/prometheus
1616
- ALLOY_HOSTNAME=${ALLOY_HOSTNAME-localhost} # Used to add a label to metrics
1717
- ALLOY_IP_ADDRESS=${ALLOY_IP_ADDRESS-localhost} # Used to add a label to metrics
18-
- ELASTICSEARCH_URL=${ELASTICSEARCH_URL-https://elassticsearch-1:9200}
18+
- ELASTICSEARCH_URL=${ELASTICSEARCH_URL-https://elasticsearch-1:9200}
1919
- ELASTICSEARCH_USERNAME=${ELASTICSEARCH_USERNAME-user} # Used to get metrics from Elasticsearch
2020
- ELASTICSEARCH_PASSWORD=${ELASTICSEARCH_PASSWORD-pass} # Used to get metrics from Elasticsearch
2121
networks:
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- targets:
2+
- cogstack-observability-traefik-1/grafana/api/health
3+
labels:
4+
name: grafana
5+
job: probe-observability-stack
6+
host: localhost
7+
- targets:
8+
- cogstack-observability-traefik-1/prometheus/-/healthy
9+
labels:
10+
name: prometheus
11+
job: probe-observability-stack
12+
host: localhost

observability/grafana-alloy/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ FROM grafana/alloy:latest
33
LABEL traefik.enable="true" \
44
traefik.http.routers.alloy.rule="PathPrefix(`/alloy`)"
55

6+
RUN mkdir -p /etc/alloy/probers
7+
68
COPY ./defaults /etc/alloy
79

810
CMD [ \

observability/grafana-alloy/defaults/config.alloy

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,7 @@ prometheus.remote_write "default" {
88
url = sys.env("PROMETHEUS_URL") + "/api/v1/write"
99
}
1010
external_labels = {
11-
host = sys.env("ALLOY_HOSTNAME"),
12-
ip_address = sys.env("ALLOY_IP_ADDRESS"),
11+
alloy_hostname = sys.env("ALLOY_HOSTNAME"),
12+
alloy_ip_address = sys.env("ALLOY_IP_ADDRESS"),
1313
}
14-
}
15-
16-
prometheus.scrape "exporter" {
17-
scrape_interval = "15s"
18-
targets = array.concat(
19-
prometheus.exporter.self.alloy.targets,
20-
prometheus.exporter.cadvisor.local_cadvisor.targets,
21-
prometheus.exporter.unix.local_node_exporter.targets,
22-
)
23-
forward_to = [prometheus.remote_write.default.receiver]
24-
}
25-
26-
// Alloys internal metrics
27-
prometheus.exporter.self "alloy" {
28-
}
29-
30-
// CAdvisor
31-
prometheus.exporter.cadvisor "local_cadvisor" {
32-
docker_host = "unix:///var/run/docker.sock"
33-
storage_duration = "5m"
34-
}
35-
36-
// Node exporter
37-
prometheus.exporter.unix "local_node_exporter" {
38-
}
14+
}

0 commit comments

Comments
 (0)