Skip to content

Commit

Permalink
- Update configs to use deployed AM endpoint
Browse files Browse the repository at this point in the history
- Added nginx route for AM in cloud.gov
  • Loading branch information
elipe17 committed Nov 15, 2024
1 parent 6b2760e commit 81895ab
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
1 change: 1 addition & 0 deletions tdrs-backend/plg/prometheus/alerts.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ groups:
rules:
- alert: UpTime
expr: avg_over_time(up[1m]) < 0.95
for: 30m
labels:
severity: WARNING
annotations:
Expand Down
2 changes: 1 addition & 1 deletion tdrs-backend/plg/prometheus/prometheus.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ alerting:
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
- "django-rules.yml"
- "alerts.yml"
- "alerts.local.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
Expand Down
7 changes: 4 additions & 3 deletions tdrs-backend/plg/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ alerting:
- path_prefix: /alerts
static_configs:
- targets:
# - alertmanager.apps.internal:8080
- alertmanager.apps.internal:8080

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
- "django-rules.yml"
- "alert.yml"

scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
Expand Down Expand Up @@ -84,15 +85,15 @@ scrape_configs:

- job_name: loki
static_configs:
- targets: ["loki.apps.internal:3100"]
- targets: ["loki.apps.internal:8080"]
labels:
service: "loki"
env: "production"

- job_name: grafana
metrics_path: /grafana/metrics
static_configs:
- targets: ["grafana.app.cloud.gov:9400"]
- targets: ["grafana.app.cloud.gov:8080"]
labels:
service: "grafana"
env: "production"
24 changes: 21 additions & 3 deletions tdrs-frontend/nginx/cloud.gov/locations.conf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ location = /kibana_auth_check {
}

location /grafana/ {
auth_request /grafana_auth_check;
auth_request /plg_auth_check;
auth_request_set $auth_status $upstream_status;

set $grafana http://grafana.apps.internal:8080$request_uri;
Expand All @@ -78,9 +78,27 @@ location /grafana/ {
proxy_buffer_size 4k;
}

location = /grafana_auth_check {
location /alerts/ {
auth_request /plg_auth_check;
auth_request_set $auth_status $upstream_status;

set $alerts http://alertmanager.apps.internal:8080$request_uri;
proxy_pass $alerts;
proxy_set_header Host $host:3000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;

proxy_connect_timeout 300;
proxy_read_timeout 300;
proxy_send_timeout 300;
send_timeout 900;
proxy_buffer_size 4k;
}

location = /plg_auth_check {
internal;
set $endpoint http://{{env "BACKEND_HOST"}}.apps.internal:8080/grafana_auth_check/;
set $endpoint http://{{env "BACKEND_HOST"}}.apps.internal:8080/plg_auth_check/;
proxy_pass $endpoint$1$is_args$args;
proxy_set_header Host $host:3000;
proxy_set_header X-Real-IP $remote_addr;
Expand Down

0 comments on commit 81895ab

Please sign in to comment.