Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating Monitoring guide to use newest helm charts and add config required by the version bump #258

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions guides/monitoring-setup/loki-monitoring-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
loki:
storage:
type: filesystem
storage_config:
filesystem:
directory: /tmp/loki/
commonConfig:
replication_factor: 1
schemaConfig:
configs:
- from: "2024-04-01"
store: tsdb
object_store: filesystem
schema: v13
index:
prefix: loki_index_
period: 24h
ruler:
enable_api: true

chunksCache:
enabled: false

monitoring:
serviceMonitor:
enabled: true

deploymentMode: SingleBinary

singleBinary:
replicas: 1

# Zero out replica counts of other deployment modes
backend:
replicas: 0
read:
replicas: 0
write:
replicas: 0

ingester:
replicas: 0
querier:
replicas: 0
queryFrontend:
replicas: 0
queryScheduler:
replicas: 0
distributor:
replicas: 0
compactor:
replicas: 0
indexGateway:
replicas: 0
bloomCompactor:
replicas: 0
bloomGateway:
replicas: 0
10 changes: 7 additions & 3 deletions guides/monitoring-setup/monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ echo "Installing prometheus-operator"
wget https://raw.githubusercontent.com/juice-shop/multi-juicer/main/guides/monitoring-setup/prometheus-operator-config.yaml

echo "Installing Prometheus Operator & Grafana"
helm --namespace monitoring upgrade --install monitoring prometheus-community/kube-prometheus-stack --version 13.3.0 --values prometheus-operator-config.yaml
helm --namespace monitoring upgrade --install monitoring prometheus-community/kube-prometheus-stack --version 65.5.1 --values prometheus-operator-config.yaml

echo "Getting loki configuration"
# The default loki config is set to monolithic single replica. If more redundancy is needed you can reconfigure it to your liking. https://grafana.com/docs/loki/latest/setup/install/helm/concepts/
wget https://raw.githubusercontent.com/juice-shop/multi-juicer/main/guides/monitoring-setup/loki-monitoring-config.yaml

echo "Installing loki"
helm --namespace monitoring upgrade --install loki grafana/loki --version 2.3.0 --set="serviceMonitor.enabled=true"
helm --namespace monitoring upgrade --install loki grafana/loki --version 6.18.0 --values loki-monitoring-config.yaml

echo "Installing loki/promtail"
helm --namespace monitoring upgrade --install promtail grafana/promtail --version 3.0.4 --set "config.lokiAddress=http://loki:3100/loki/api/v1/push" --set="serviceMonitor.enabled=true"
helm --namespace monitoring upgrade --install promtail grafana/promtail --version 6.16.6 --set="serviceMonitor.enabled=true" --set="config.clients[0].url=http://loki-gateway/loki/api/v1/push,config.clients[0].tenant_id=multijuicer" --set="config.snippets.extraRelabelConfigs[0].action=labelmap,config.snippets.extraRelabelConfigs[0].regex=__meta_kubernetes_pod_label_(team)"

echo "Installing MultiJuicer"
helm install multi-juicer oci://ghcr.io/juice-shop/multi-juicer/helm/multi-juicer --set="balancer.metrics.enabled=true" --set="balancer.metrics.dashboards.enabled=true" --set="balancer.metrics.serviceMonitor.enabled=true"
Expand Down
4 changes: 4 additions & 0 deletions guides/monitoring-setup/prometheus-operator-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ grafana:
type: loki
access: proxy
url: "http://loki:3100"
jsonData:
httpHeaderName1: 'X-Scope-OrgID'
secureJsonData:
httpHeaderValue1: 'multijuicer'
4 changes: 2 additions & 2 deletions helm/multi-juicer/dashboards/instances.json
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@
"steppedLine": false,
"targets": [
{
"expr": "increase(http_requests_count{app.kubernetes.io/name=\"juiceshop\", team=\"$team\"}[1m])",
"expr": "increase(http_requests_count{app=\"juiceshop\", team=\"$team\"}[1m])",
"interval": "1m",
"legendFormat": "{{status_code}}",
"refId": "A"
Expand Down Expand Up @@ -1921,7 +1921,7 @@
},
"targets": [
{
"expr": "{app.kubernetes.io/name=\"juice-shop\", team=\"$team\"}",
"expr": "{app=\"juice-shop\", team=\"$team\"}",
"refId": "A"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2209,7 +2209,7 @@ full values render out correctly:
"steppedLine": false,
"targets": [
{
"expr": "increase(http_requests_count{app.kubernetes.io/name=\"juiceshop\", team=\"$team\"}[1m])",
"expr": "increase(http_requests_count{app=\"juiceshop\", team=\"$team\"}[1m])",
"interval": "1m",
"legendFormat": "{{status_code}}",
"refId": "A"
Expand Down Expand Up @@ -2895,7 +2895,7 @@ full values render out correctly:
},
"targets": [
{
"expr": "{app.kubernetes.io/name=\"juice-shop\", team=\"$team\"}",
"expr": "{app=\"juice-shop\", team=\"$team\"}",
"refId": "A"
}
],
Expand Down