refactor web pagination and add partitioned events, flap/timeout showcase agents
This commit is contained in:
@@ -9,7 +9,7 @@ services:
|
||||
MONLET_STALE_AFTER_SEC: "20"
|
||||
MONLET_DEAD_AFTER_SEC: "40"
|
||||
MONLET_DETECTOR_TICK_SEC: "5"
|
||||
MONLET_EVENTS_RETENTION_MAX_ROWS: "5000"
|
||||
MONLET_EVENTS_RETENTION_MONTHS: "1"
|
||||
MONLET_OUTBOX_RETENTION_MAX_ROWS: "1000"
|
||||
MONLET_NOTIFIER_DEBUG_ENABLED: "true"
|
||||
MONLET_NOTIFIER_WEBHOOK_ENABLED: "true"
|
||||
@@ -56,6 +56,32 @@ services:
|
||||
agent-mixed:
|
||||
condition: service_started
|
||||
|
||||
agent-flap:
|
||||
image: monlet-showcase-agent
|
||||
environment:
|
||||
MONLET_CONFIG: /etc/monlet/agent.toml
|
||||
volumes:
|
||||
- ./showcase/agents/flap.toml:/etc/monlet/agent.toml:ro
|
||||
- ./showcase/checks:/opt/monlet/checks:ro
|
||||
depends_on:
|
||||
server:
|
||||
condition: service_healthy
|
||||
agent-mixed:
|
||||
condition: service_started
|
||||
|
||||
agent-timeout:
|
||||
image: monlet-showcase-agent
|
||||
environment:
|
||||
MONLET_CONFIG: /etc/monlet/agent.toml
|
||||
volumes:
|
||||
- ./showcase/agents/timeout.toml:/etc/monlet/agent.toml:ro
|
||||
- ./showcase/checks:/opt/monlet/checks:ro
|
||||
depends_on:
|
||||
server:
|
||||
condition: service_healthy
|
||||
agent-mixed:
|
||||
condition: service_started
|
||||
|
||||
agent-prometheus-owned:
|
||||
image: monlet-showcase-agent
|
||||
environment:
|
||||
|
||||
25
deploy/showcase/agents/flap.toml
Normal file
25
deploy/showcase/agents/flap.toml
Normal file
@@ -0,0 +1,25 @@
|
||||
hostname = "agent-flap"
|
||||
state_dir = "/var/lib/monlet-agent"
|
||||
|
||||
[labels]
|
||||
scenario = "flapping"
|
||||
role = "showcase"
|
||||
|
||||
[server]
|
||||
enabled = true
|
||||
url = "http://server:8000"
|
||||
token = "monlet-dev-token"
|
||||
heartbeat_interval = "5s"
|
||||
batch_interval = "3s"
|
||||
|
||||
[metrics]
|
||||
enabled = false
|
||||
listen = "127.0.0.1:9465"
|
||||
|
||||
[[checks]]
|
||||
id = "flap"
|
||||
name = "Flapping check (oscillates ok/critical)"
|
||||
command = "/opt/monlet/checks/flap.sh"
|
||||
interval = "10s"
|
||||
timeout = "3s"
|
||||
dedupe_key = "agent-flap:flap"
|
||||
33
deploy/showcase/agents/timeout.toml
Normal file
33
deploy/showcase/agents/timeout.toml
Normal file
@@ -0,0 +1,33 @@
|
||||
hostname = "agent-timeout"
|
||||
state_dir = "/var/lib/monlet-agent"
|
||||
|
||||
[labels]
|
||||
scenario = "timeout"
|
||||
role = "showcase"
|
||||
|
||||
[server]
|
||||
enabled = true
|
||||
url = "http://server:8000"
|
||||
token = "monlet-dev-token"
|
||||
heartbeat_interval = "5s"
|
||||
batch_interval = "3s"
|
||||
|
||||
[metrics]
|
||||
enabled = false
|
||||
listen = "127.0.0.1:9465"
|
||||
|
||||
[[checks]]
|
||||
id = "ok_probe"
|
||||
name = "Healthy probe"
|
||||
command = "/opt/monlet/checks/exit_0.sh"
|
||||
interval = "10s"
|
||||
timeout = "3s"
|
||||
dedupe_key = "agent-timeout:ok_probe"
|
||||
|
||||
[[checks]]
|
||||
id = "slow_probe"
|
||||
name = "Probe that exceeds the timeout"
|
||||
command = "/opt/monlet/checks/sleep_long.sh"
|
||||
interval = "10s"
|
||||
timeout = "2s"
|
||||
dedupe_key = "agent-timeout:slow_probe"
|
||||
9
deploy/showcase/checks/flap.sh
Executable file
9
deploy/showcase/checks/flap.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
# Alternates between ok and critical every ~30 seconds to demonstrate flapping.
|
||||
slot=$(( $(date +%s) / 30 % 2 ))
|
||||
if [ "$slot" -eq 0 ]; then
|
||||
echo "critical: flap window down"
|
||||
exit 2
|
||||
fi
|
||||
echo "ok: flap window up"
|
||||
exit 0
|
||||
5
deploy/showcase/checks/sleep_long.sh
Executable file
5
deploy/showcase/checks/sleep_long.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
# Sleeps longer than the configured timeout to demonstrate timeout handling.
|
||||
sleep 30
|
||||
echo "should never reach here"
|
||||
exit 0
|
||||
Reference in New Issue
Block a user