Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1bfa31acc0 | |||
| 2ab41bdce5 | |||
| 01f842323e | |||
| d6ea94f20d | |||
| 6d65f29674 | |||
| 4c098708f4 | |||
| 3301e2463e | |||
| ae289072ed | |||
| 696b328a7d |
@@ -0,0 +1,21 @@
|
||||
services:
|
||||
jenkins:
|
||||
build: .
|
||||
image: custom-jenkins:lts-jdk21-python3
|
||||
container_name: jenkins
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
JAVA_OPTS: "-Xms256m -Xmx512m"
|
||||
volumes:
|
||||
- jenkins-home:/var/jenkins_home
|
||||
networks:
|
||||
- gitea-net
|
||||
|
||||
volumes:
|
||||
jenkins-home:
|
||||
name: jenkins_home
|
||||
|
||||
networks:
|
||||
gitea-net:
|
||||
external: true
|
||||
name: gitea-net
|
||||
@@ -0,0 +1,5 @@
|
||||
# Pinned image versions only. No passwords in this file.
|
||||
PROMETHEUS_TAG=v3.13.5
|
||||
GRAFANA_TAG=13.2.5
|
||||
NODE_EXPORTER_TAG=v1.12.1
|
||||
BLACKBOX_TAG=v0.29.0
|
||||
@@ -0,0 +1,2 @@
|
||||
# Secrets stay on the Droplet only
|
||||
grafana.secrets.env
|
||||
@@ -0,0 +1,65 @@
|
||||
# SSW 590 Monitoring Runbook
|
||||
|
||||
Dashboard: https://metrics.ssw590-08.me/d/ssw590-sre
|
||||
Contact point: `team-alerts` (email). Times are America/New_York.
|
||||
|
||||
---
|
||||
|
||||
## ServiceUnavailable – Gitea or Jenkins HTTPS probe failing
|
||||
|
||||
**Owner:** samahk13 (primary), kholmes (backup)
|
||||
**Severity:** critical
|
||||
**Fires when:** `probe_success{job="https"}` is 0 for an instance for at least 1 minute,
|
||||
or the probe series is missing (no data) / the query errors.
|
||||
|
||||
### 1. Acknowledge
|
||||
Reply to the alert email (or post in the team chat) with "ack" and your name, and
|
||||
note the time. This is the acknowledgement time in the incident timeline.
|
||||
|
||||
### 2. Is it the service or the monitoring?
|
||||
- Open the dashboard. Check the **Scrape health (up)** row.
|
||||
- `blackbox` or `https` shows DOWN / no data → the **monitoring** is broken,
|
||||
not necessarily the service. Go to step 5.
|
||||
- `up` is 1 but panel 4 or 5 shows DOWN → the probed request failed. Continue.
|
||||
- Open the URL in a browser:
|
||||
- Gitea: https://git.ssw590-08.me/user/login
|
||||
- Jenkins: https://ci.ssw590-08.me/login
|
||||
|
||||
### 3. Check the container (SSH to the Droplet as root)
|
||||
```
|
||||
docker ps -a --format 'table {{.Names}}\t{{.Status}}'
|
||||
docker logs --tail=50 jenkins # or: gitea
|
||||
docker logs --tail=50 caddy # proxy / TLS problems
|
||||
```
|
||||
|
||||
### 4. Restore
|
||||
- Container stopped/exited:
|
||||
```
|
||||
docker start jenkins # or: docker start gitea
|
||||
```
|
||||
- Container running but unhealthy: `docker restart jenkins`
|
||||
- Certificate/proxy error: check `docker logs caddy`; validate with
|
||||
`docker exec caddy caddy validate --config /etc/caddy/Caddyfile`.
|
||||
- **Never** use `docker compose down -v` (deletes data volumes).
|
||||
|
||||
Wait for the next probes (~30–60 s). The alert resolves when `probe_success` is 1
|
||||
again; confirm the "Resolved" email arrives.
|
||||
|
||||
### 5. Monitoring itself is failing (no data / error)
|
||||
```
|
||||
cd /root/Scrap-Web/monitoring
|
||||
docker compose ps
|
||||
docker compose logs --tail=50 prometheus blackbox-exporter
|
||||
docker compose start prometheus blackbox-exporter
|
||||
```
|
||||
|
||||
### 6. After recovery
|
||||
- Jenkins: run **Build Now** on `main` and confirm it passes.
|
||||
- Gitea: confirm the web login and that Jenkins can still post commit statuses.
|
||||
- Record the timeline in the incident issue.
|
||||
|
||||
---
|
||||
|
||||
## HostDiskLow – root filesystem below 15 % free
|
||||
|
||||
**Owner:** kholmes — *(partner to complete)*
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
# Step 1 baseline - run on the Droplet BEFORE starting the monitoring stack.
|
||||
# Output contains no secrets; paste it into the Gitea issue.
|
||||
echo "== date"; date -Is
|
||||
echo "== OS"; cat /etc/os-release | head -4; uname -r
|
||||
echo "== CPU"; nproc; grep -m1 "model name" /proc/cpuinfo; uname -m
|
||||
echo "== memory (bytes)"; free -b
|
||||
echo "== root disk"; df -B1 /; df -h /
|
||||
echo "== docker"; docker version --format '{{.Server.Version}}'; docker compose version
|
||||
echo "== containers"; docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Status}}'
|
||||
echo "== container usage"; docker stats --no-stream --format 'table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}'
|
||||
echo "== load"; uptime
|
||||
@@ -0,0 +1,12 @@
|
||||
modules:
|
||||
http_2xx:
|
||||
prober: http
|
||||
timeout: 10s
|
||||
http:
|
||||
method: GET
|
||||
preferred_ip_protocol: ip4
|
||||
valid_status_codes: [] # empty = any 2xx is success
|
||||
follow_redirects: true
|
||||
fail_if_not_ssl: true
|
||||
tls_config:
|
||||
insecure_skip_verify: false
|
||||
@@ -0,0 +1,67 @@
|
||||
# SSW 590 - Monitoring stack (Prometheus, Grafana OSS, Node Exporter, Blackbox Exporter)
|
||||
# Only Grafana joins gitea-net so the existing Caddy container can proxy it.
|
||||
# No host ports are published; Prometheus and the exporters stay on the private network.
|
||||
services:
|
||||
prometheus:
|
||||
image: prom/prometheus:${PROMETHEUS_TAG:?choose a release}
|
||||
container_name: prometheus
|
||||
restart: unless-stopped
|
||||
command:
|
||||
- --config.file=/etc/prometheus/prometheus.yml
|
||||
- --storage.tsdb.path=/prometheus
|
||||
- --storage.tsdb.retention.time=7d
|
||||
- --storage.tsdb.retention.size=5GB
|
||||
volumes:
|
||||
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
||||
- prometheus_data:/prometheus
|
||||
networks: [monitoring]
|
||||
|
||||
grafana:
|
||||
image: grafana/grafana:${GRAFANA_TAG:?choose a release}
|
||||
container_name: grafana
|
||||
restart: unless-stopped
|
||||
depends_on: [prometheus]
|
||||
env_file: [grafana.secrets.env]
|
||||
environment:
|
||||
GF_SERVER_ROOT_URL: "https://metrics.ssw590-08.me/"
|
||||
GF_SERVER_DOMAIN: "metrics.ssw590-08.me"
|
||||
GF_AUTH_ANONYMOUS_ENABLED: "false"
|
||||
GF_USERS_ALLOW_SIGN_UP: "false"
|
||||
GF_DATE_FORMATS_DEFAULT_TIMEZONE: "America/New_York"
|
||||
volumes:
|
||||
- grafana_data:/var/lib/grafana
|
||||
- ./grafana/provisioning:/etc/grafana/provisioning:ro
|
||||
- ./grafana/dashboards:/var/lib/grafana/dashboards:ro
|
||||
networks: [monitoring, gitea-net]
|
||||
|
||||
node-exporter:
|
||||
image: quay.io/prometheus/node-exporter:${NODE_EXPORTER_TAG:?choose a release}
|
||||
container_name: node-exporter
|
||||
restart: unless-stopped
|
||||
pid: host
|
||||
command:
|
||||
- --path.rootfs=/host
|
||||
- --path.procfs=/host/proc
|
||||
- --path.sysfs=/host/sys
|
||||
volumes:
|
||||
- /:/host:ro,rslave
|
||||
networks: [monitoring]
|
||||
|
||||
blackbox-exporter:
|
||||
image: quay.io/prometheus/blackbox-exporter:${BLACKBOX_TAG:?choose a release}
|
||||
container_name: blackbox-exporter
|
||||
restart: unless-stopped
|
||||
command: ["--config.file=/config/blackbox.yml"]
|
||||
volumes:
|
||||
- ./blackbox/blackbox.yml:/config/blackbox.yml:ro
|
||||
networks: [monitoring]
|
||||
|
||||
networks:
|
||||
monitoring:
|
||||
gitea-net:
|
||||
external: true
|
||||
name: gitea-net
|
||||
|
||||
volumes:
|
||||
prometheus_data:
|
||||
grafana_data:
|
||||
@@ -0,0 +1,2 @@
|
||||
# Copy to grafana.secrets.env on the Droplet and fill in. Never commit the real file.
|
||||
GF_SECURITY_ADMIN_PASSWORD=CHANGE_ME
|
||||
@@ -0,0 +1,64 @@
|
||||
apiVersion: 1
|
||||
groups:
|
||||
- orgId: 1
|
||||
name: availability
|
||||
folder: SSW 590
|
||||
interval: 30s
|
||||
rules:
|
||||
- uid: fg2n29o6c9a80d
|
||||
title: ServiceUnavailable
|
||||
condition: C
|
||||
data:
|
||||
- refId: A
|
||||
relativeTimeRange:
|
||||
from: 600
|
||||
to: 0
|
||||
datasourceUid: prometheus
|
||||
model:
|
||||
editorMode: code
|
||||
expr: probe_success{job="https"}
|
||||
instant: true
|
||||
intervalMs: 1000
|
||||
legendFormat: __auto
|
||||
maxDataPoints: 43200
|
||||
range: false
|
||||
refId: A
|
||||
- refId: C
|
||||
queryType: expression
|
||||
datasourceUid: __expr__
|
||||
model:
|
||||
conditions:
|
||||
- evaluator:
|
||||
params:
|
||||
- 1
|
||||
type: lt
|
||||
operator:
|
||||
type: and
|
||||
query:
|
||||
params:
|
||||
- C
|
||||
reducer:
|
||||
params: []
|
||||
type: last
|
||||
type: query
|
||||
datasource:
|
||||
type: __expr__
|
||||
uid: __expr__
|
||||
expression: A
|
||||
intervalMs: 1000
|
||||
maxDataPoints: 43200
|
||||
refId: C
|
||||
type: threshold
|
||||
noDataState: Alerting
|
||||
execErrState: Alerting
|
||||
for: 1m
|
||||
annotations:
|
||||
runbook_url: https://git.ssw590-08.me/SSW-590-08/Scrap-Web/src/branch/main/monitoring/RUNBOOK.md
|
||||
summary: '{{ $labels.instance }} HTTPS probe failing for 1m'
|
||||
labels:
|
||||
owner: samahk13
|
||||
severity: critical
|
||||
team: ssw590
|
||||
isPaused: false
|
||||
notification_settings:
|
||||
receiver: team-alerts
|
||||
@@ -0,0 +1,547 @@
|
||||
{
|
||||
"uid": "ssw590-sre",
|
||||
"title": "SSW 590 \u2013 Gitea & Jenkins Reliability",
|
||||
"tags": [
|
||||
"ssw590",
|
||||
"sre"
|
||||
],
|
||||
"timezone": "America/New_York",
|
||||
"time": {
|
||||
"from": "now-6h",
|
||||
"to": "now"
|
||||
},
|
||||
"refresh": "30s",
|
||||
"schemaVersion": 39,
|
||||
"version": 1,
|
||||
"editable": true,
|
||||
"graphTooltip": 1,
|
||||
"panels": [
|
||||
{
|
||||
"id": 1,
|
||||
"type": "timeseries",
|
||||
"title": "1. Droplet CPU utilization (all CPUs)",
|
||||
"description": "Percent of CPU time not idle, averaged across all CPUs over a 2-minute rate window. Whole-droplet: includes Gitea, Jenkins, Caddy and monitoring; does not attribute CPU to a container.",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"expr": "100 * (1 - avg(rate(node_cpu_seconds_total{job=\"node\",mode=\"idle\"}[2m])))",
|
||||
"legendFormat": "CPU busy %",
|
||||
"range": true
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "percent",
|
||||
"min": 0,
|
||||
"max": 100,
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "orange",
|
||||
"value": 70
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 90
|
||||
}
|
||||
]
|
||||
},
|
||||
"custom": {
|
||||
"thresholdsStyle": {
|
||||
"mode": "line"
|
||||
},
|
||||
"lineWidth": 2,
|
||||
"fillOpacity": 10
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"legend": {
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "multi"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"type": "timeseries",
|
||||
"title": "2. Available host memory",
|
||||
"description": "MemAvailable: the kernel's estimate of memory available to start new applications without swapping (bytes, IEC). Not the same as unused RAM.",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 0,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"expr": "node_memory_MemAvailable_bytes{job=\"node\"}",
|
||||
"legendFormat": "MemAvailable",
|
||||
"range": true
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "bytes",
|
||||
"min": 0,
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "red",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "orange",
|
||||
"value": 209715200
|
||||
},
|
||||
{
|
||||
"color": "green",
|
||||
"value": 419430400
|
||||
}
|
||||
]
|
||||
},
|
||||
"custom": {
|
||||
"thresholdsStyle": {
|
||||
"mode": "line"
|
||||
},
|
||||
"lineWidth": 2,
|
||||
"fillOpacity": 10
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"legend": {
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "multi"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"type": "timeseries",
|
||||
"title": "3. Root filesystem available space (/dev/vda1)",
|
||||
"description": "Available bytes divided by size bytes for the host root filesystem only (device /dev/vda1, mounted at /). Alert threshold is 15%.",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 8,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"expr": "100 * node_filesystem_avail_bytes{job=\"node\",mountpoint=\"/\",device=\"/dev/vda1\"} / node_filesystem_size_bytes{job=\"node\",mountpoint=\"/\",device=\"/dev/vda1\"}",
|
||||
"legendFormat": "root available %",
|
||||
"range": true
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "percent",
|
||||
"min": 0,
|
||||
"max": 100,
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "red",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "orange",
|
||||
"value": 15
|
||||
},
|
||||
{
|
||||
"color": "green",
|
||||
"value": 25
|
||||
}
|
||||
]
|
||||
},
|
||||
"custom": {
|
||||
"thresholdsStyle": {
|
||||
"mode": "line"
|
||||
},
|
||||
"lineWidth": 2,
|
||||
"fillOpacity": 10
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"legend": {
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "multi"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"type": "timeseries",
|
||||
"title": "6. HTTPS probe duration",
|
||||
"description": "Total time for each Blackbox HTTPS probe (DNS + connect + TLS + request, following redirects), one line per service.",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 8,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"expr": "probe_duration_seconds{job=\"https\"}",
|
||||
"legendFormat": "{{instance}}",
|
||||
"range": true
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "s",
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"custom": {
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
},
|
||||
"lineWidth": 2,
|
||||
"fillOpacity": 10
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"legend": {
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "multi"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"type": "timeseries",
|
||||
"title": "4. Gitea HTTPS availability",
|
||||
"description": "1 = Blackbox Exporter's HTTPS probe of https://git.ssw590-08.me/user/login succeeded (DNS, valid TLS, 2xx after redirects); 0 = failed. Sampled every 30 s.",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 16,
|
||||
"w": 12,
|
||||
"h": 7
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"expr": "probe_success{job=\"https\",instance=\"https://git.ssw590-08.me/user/login\"}",
|
||||
"legendFormat": "{{instance}}",
|
||||
"range": true
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "none",
|
||||
"min": 0,
|
||||
"max": 1,
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "red",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "green",
|
||||
"value": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"custom": {
|
||||
"thresholdsStyle": {
|
||||
"mode": "line"
|
||||
},
|
||||
"lineWidth": 2,
|
||||
"fillOpacity": 10,
|
||||
"drawStyle": "line",
|
||||
"lineInterpolation": "stepAfter"
|
||||
},
|
||||
"mappings": [
|
||||
{
|
||||
"type": "value",
|
||||
"options": {
|
||||
"0": {
|
||||
"text": "DOWN",
|
||||
"color": "red"
|
||||
},
|
||||
"1": {
|
||||
"text": "UP",
|
||||
"color": "green"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"decimals": 0
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"legend": {
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "multi"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"type": "timeseries",
|
||||
"title": "5. Jenkins HTTPS availability",
|
||||
"description": "1 = Blackbox Exporter's HTTPS probe of https://ci.ssw590-08.me/login succeeded (DNS, valid TLS, 2xx after redirects); 0 = failed. Sampled every 30 s.",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 16,
|
||||
"w": 12,
|
||||
"h": 7
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"expr": "probe_success{job=\"https\",instance=\"https://ci.ssw590-08.me/login\"}",
|
||||
"legendFormat": "{{instance}}",
|
||||
"range": true
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "none",
|
||||
"min": 0,
|
||||
"max": 1,
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "red",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "green",
|
||||
"value": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"custom": {
|
||||
"thresholdsStyle": {
|
||||
"mode": "line"
|
||||
},
|
||||
"lineWidth": 2,
|
||||
"fillOpacity": 10,
|
||||
"drawStyle": "line",
|
||||
"lineInterpolation": "stepAfter"
|
||||
},
|
||||
"mappings": [
|
||||
{
|
||||
"type": "value",
|
||||
"options": {
|
||||
"0": {
|
||||
"text": "DOWN",
|
||||
"color": "red"
|
||||
},
|
||||
"1": {
|
||||
"text": "UP",
|
||||
"color": "green"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"decimals": 0
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"legend": {
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "multi"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"type": "stat",
|
||||
"title": "Scrape health (up)",
|
||||
"description": "1 = Prometheus scraped the target successfully. A target can be up while its probe_success is 0.",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 23,
|
||||
"w": 24,
|
||||
"h": 5
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"expr": "up",
|
||||
"legendFormat": "{{job}} {{instance}}",
|
||||
"instant": true
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"mappings": [
|
||||
{
|
||||
"type": "value",
|
||||
"options": {
|
||||
"0": {
|
||||
"text": "DOWN",
|
||||
"color": "red"
|
||||
},
|
||||
"1": {
|
||||
"text": "UP",
|
||||
"color": "green"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "red",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "green",
|
||||
"value": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"unit": "none"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"colorMode": "background",
|
||||
"graphMode": "none",
|
||||
"textMode": "value_and_name",
|
||||
"reduceOptions": {
|
||||
"calcs": [
|
||||
"lastNotNull"
|
||||
],
|
||||
"fields": "",
|
||||
"values": false
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": {
|
||||
"type": "grafana",
|
||||
"uid": "-- Grafana --"
|
||||
},
|
||||
"enable": true,
|
||||
"hide": true,
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations & Alerts",
|
||||
"type": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
apiVersion: 1
|
||||
providers:
|
||||
- name: ssw590
|
||||
folder: SSW 590
|
||||
type: file
|
||||
allowUiUpdates: true
|
||||
options:
|
||||
path: /var/lib/grafana/dashboards
|
||||
@@ -0,0 +1,9 @@
|
||||
apiVersion: 1
|
||||
datasources:
|
||||
- name: Prometheus
|
||||
uid: prometheus
|
||||
type: prometheus
|
||||
access: proxy
|
||||
url: http://prometheus:9090
|
||||
isDefault: true
|
||||
editable: false
|
||||
@@ -0,0 +1,32 @@
|
||||
global:
|
||||
scrape_interval: 30s
|
||||
evaluation_interval: 30s
|
||||
|
||||
scrape_configs:
|
||||
- job_name: prometheus
|
||||
static_configs:
|
||||
- targets: ["prometheus:9090"]
|
||||
|
||||
- job_name: node
|
||||
static_configs:
|
||||
- targets: ["node-exporter:9100"]
|
||||
|
||||
- job_name: blackbox
|
||||
static_configs:
|
||||
- targets: ["blackbox-exporter:9115"]
|
||||
|
||||
- job_name: https
|
||||
metrics_path: /probe
|
||||
params:
|
||||
module: [http_2xx]
|
||||
static_configs:
|
||||
- targets:
|
||||
- https://git.ssw590-08.me/user/login
|
||||
- https://ci.ssw590-08.me/login
|
||||
relabel_configs:
|
||||
- source_labels: [__address__]
|
||||
target_label: __param_target
|
||||
- source_labels: [__param_target]
|
||||
target_label: instance
|
||||
- target_label: __address__
|
||||
replacement: blackbox-exporter:9115
|
||||
Reference in New Issue
Block a user