Skip to content

Commit

Permalink
Merge pull request #4 from telia-oss/prometheus-support
Browse files Browse the repository at this point in the history
Add support for prometheus metrics
  • Loading branch information
mikael-lindstrom authored Aug 3, 2018
2 parents 20c7064 + 90bbe12 commit 71db3be
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/atc/cloud-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ write_files:
Environment="CONCOURSE_SESSION_SIGNING_KEY=/concourse/keys/web/session_signing_key"
Environment="CONCOURSE_ENCRYPTION_KEY=${encryption_key}"
Environment="CONCOURSE_OLD_ENCRYPTION_KEY=${old_encryption_key}"
${prometheus_bind_ip}
${prometheus_bind_port}
ExecStartPre=/bin/bash -c "/bin/systemctl set-environment CONCOURSE_PEER_URL=http://$(curl -L http://169.254.169.254/latest/meta-data/local-ipv4):${atc_port}"
ExecStart=/usr/local/bin/concourse web --aws-secretsmanager-region=${region}
Expand Down
2 changes: 2 additions & 0 deletions modules/atc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ data "template_file" "atc" {
github_client_secret = "${var.github_client_secret}"
github_users = "${length(var.github_users) > 0 ? "Environment=\"CONCOURSE_GITHUB_AUTH_USER=${join(",", var.github_users)}\"" : ""}"
github_teams = "${length(var.github_teams) > 0 ? "Environment=\"CONCOURSE_GITHUB_AUTH_TEAM=${join(",", var.github_teams)}\"" : ""}"
prometheus_bind_ip = "${var.prometheus_enabled == "true" ? "Environment=\"CONCOURSE_PROMETHEUS_BIND_IP=0.0.0.0\"" : ""}"
prometheus_bind_port = "${var.prometheus_enabled == "true" ? "Environment=\"CONCOURSE_PROMETHEUS_BIND_PORT=${var.prometheus_port}\"" : ""}"
concourse_web_host = "${lower(var.web_protocol)}://${var.domain != "" ? var.domain : module.external_lb.dns_name}:${var.web_port}"
concourse_postgres_source = "${var.postgres_connection}"
log_group_name = "${aws_cloudwatch_log_group.atc.name}"
Expand Down
10 changes: 10 additions & 0 deletions modules/atc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ variable "tsa_port" {
default = "2222"
}

variable "prometheus_enabled" {
description = "Enable exporting of prometheus metrics."
default = "false"
}

variable "prometheus_port" {
description = "Port where prometheus metrics can be scraped."
default = "9391"
}

variable "encryption_key" {
description = "A 16 or 32 length key used to encrypt sensitive information before storing it in the database."
}
Expand Down

0 comments on commit 71db3be

Please sign in to comment.