Skip to content

Commit

Permalink
Add grafana stack
Browse files Browse the repository at this point in the history
  • Loading branch information
jawadqur committed May 14, 2024
1 parent 4b386fb commit 0826414
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 55 deletions.
2 changes: 1 addition & 1 deletion doc/prometheus.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TL;DR

We deploy [prometheus](https://prometheus.io) onto a kubernetes cluster with `kube-setup-prometheus`.
We deploy [prometheus](https://prometheus.io) like database called mimir onto a kubernetes cluster with `kube-setup-monitoring`.

## Overview

Expand Down
2 changes: 1 addition & 1 deletion gen3/bin/kube-roll-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ gen3 kube-setup-revproxy

if [[ "$GEN3_ROLL_FAST" != "true" ]]; then
if g3k_manifest_lookup .global.argocd 2> /dev/null; then
gen3 kube-setup-prometheus
gen3 kube-setup-monitoring
fi
# Internal k8s systems
gen3 kube-setup-fluentd &
Expand Down
4 changes: 2 additions & 2 deletions gen3/bin/kube-setup-ambassador.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ case "$command" in
;;
"hatchery")
deploy_hatchery_proxy "$@"
gen3 kube-setup-prometheus prometheus
gen3 kube-setup-monitoring
;;
*)
deploy_hatchery_proxy "$@"
deploy_api_gateway "$@"
gen3 kube-setup-prometheus prometheus
gen3 kube-setup-monitoring
;;
esac
3 changes: 1 addition & 2 deletions gen3/bin/prometheus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ source "${GEN3_HOME}/gen3/lib/utils.sh"
gen3_load "gen3/gen3setup"


#export GEN3_PROMHOST="${GEN3_PROMHOST:-"http://prometheus-server.prometheus.svc.cluster.local"}"
export GEN3_PROMHOST="${GEN3_PROMHOST:-"http://prometheus-operated.monitoring.svc.cluster.local:9090"}"
export GEN3_PROMHOST="${GEN3_PROMHOST:-"http://monitoring-mimir-nginx.monitoring.svc.cluster.local"}"

gen3_prom_help() {
gen3 help prometheus
Expand Down
55 changes: 6 additions & 49 deletions kube/services/revproxy/gen3.nginx.conf/prometheus-server.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
location /prometheus/ {
location /prometheus/ {
error_page 403 @errorworkspace;
set $authz_resource "/prometheus";
set $authz_method "access";
Expand All @@ -7,13 +7,13 @@
auth_request /gen3-authz;

set $proxy_service "prometheus";
set $upstream http://prometheus-kube-prometheus-prometheus.monitoring.svc.cluster.local:9090;
set $upstream http://monitoring-mimir-nginx.monitoring.svc.cluster.local;

rewrite ^/prometheus/(.*) /$1 break;

proxy_pass $upstream;
}
location /grafana/ {
}
location /grafana/ {
error_page 403 @errorworkspace;
set $authz_resource "/prometheus";
set $authz_method "access";
Expand All @@ -24,52 +24,9 @@
proxy_set_header Host $http_host;

set $proxy_service "grafana";
set $upstream http://prometheus-grafana.monitoring.svc.cluster.local;
set $upstream http://monitoring-grafana.monitoring.svc.cluster.local;

rewrite ^/grafana/(.*) /$1 break;

proxy_pass $upstream;
}
location /alertmanager/ {
error_page 403 @errorworkspace;
set $authz_resource "/prometheus";
set $authz_method "access";
set $authz_service "prometheus";
# be careful - sub-request runs in same context as this request
auth_request /gen3-authz;

set $proxy_service "alertmanager";
set $upstream http://alertmanager-operated.monitoring.svc.cluster.local:9093;

#rewrite ^/alertmanager/(.*) /$1 break;

proxy_pass $upstream;
}
location /thanos-query/ {
error_page 403 @errorworkspace;
set $authz_resource "/prometheus";
set $authz_method "access";
set $authz_service "prometheus";
# be careful - sub-request runs in same context as this request
auth_request /gen3-authz;

set $proxy_service "thanos-query";
set $upstream http://thanos-query.monitoring.svc.cluster.local:9090;

proxy_pass $upstream;
}
location /thanos-compactor/ {
error_page 403 @errorworkspace;
set $authz_resource "/prometheus";
set $authz_method "access";
set $authz_service "prometheus";
# be careful - sub-request runs in same context as this request
auth_request /gen3-authz;

set $proxy_service "thanos-compactor";
set $upstream http://thanos-compactor.monitoring.svc.cluster.local:10902;

rewrite ^/thanos-compactor/(.*) /$1 break;

proxy_pass $upstream;
}
}

0 comments on commit 0826414

Please sign in to comment.