Skip to content

Commit f9920e1

Browse files
committed
[deploy] fix container labels for prometheus
1 parent e9eb289 commit f9920e1

File tree

1 file changed

+17
-1
lines changed
  • deployments/docker-swarm-terraform

1 file changed

+17
-1
lines changed

deployments/docker-swarm-terraform/main.tf

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,21 @@ resource "docker_service" "app" {
3838
file_uid = 405
3939
file_gid = 100
4040
}
41+
42+
#region Prometheus support
43+
labels {
44+
label = "prometheus.io/scrape"
45+
value = "true"
46+
}
47+
labels {
48+
label = "prometheus.io/port"
49+
value = "3000"
50+
}
51+
labels {
52+
label = "prometheus.io/job"
53+
value = "backend"
54+
}
55+
#endregion
4156
}
4257

4358
networks_advanced {
@@ -190,7 +205,7 @@ resource "docker_service" "app" {
190205
value = 3000
191206
}
192207

193-
# Prometheus support
208+
#region Prometheus support
194209
labels {
195210
label = "prometheus.enabled"
196211
value = true
@@ -208,6 +223,7 @@ resource "docker_service" "app" {
208223
label = "prometheus.io/job"
209224
value = "backend"
210225
}
226+
#endregion
211227

212228
rollback_config {
213229
order = "start-first"

0 commit comments

Comments
 (0)