Skip to content

Commit

Permalink
Use consul token for scraping metrics (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentaTomas authored Mar 25, 2024
2 parents 8cc19fb + f75baaf commit 9fa7bb2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/nomad/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ resource "nomad_job" "otel-collector" {

grafana_api_key = data.google_secret_manager_secret_version.grafana_api_key.secret_data

consul_token = var.consul_acl_token_secret

gcp_zone = var.gcp_zone
}
}
Expand Down
5 changes: 5 additions & 0 deletions packages/nomad/otel-collector.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ variable "grafana_metrics_endpoint" {
type = string
}

variable "consul_token" {
type = string
}

variables {
otel_image = "otel/opentelemetry-collector-contrib:0.90.1"
}
Expand Down Expand Up @@ -122,6 +126,7 @@ receivers:
format: ['prometheus']
consul_sd_configs:
- services: ['nomad-client', 'nomad', 'api', 'client-proxy', 'session-proxy', 'otel-collector', 'logs-collector', 'docker-reverse-proxy']
token: "${var.consul_token}"
relabel_configs:
- source_labels: ['__meta_consul_tags']
Expand Down

0 comments on commit 9fa7bb2

Please sign in to comment.