Skip to content
Closed
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
143 changes: 143 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ chrono = "0.4.34"
clap = { version = "4.2", features = ["derive"] }
lazy_static = "1.5.0"
tokio = { version = "1.41", features = ["full"] }
tokio-tungstenite = "0.24"
tokio-tungstenite = { version = "0.24", features = ["native-tls"] }
futures-util = "0.3"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down
10 changes: 10 additions & 0 deletions monitoring/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# WebSocket Backend URL (ws:// or wss:// format)
BACKEND_URL=ws://localhost:3000

# Slack Configuration
SLACK_TOKEN=xoxb-your-bot-token-here
SLACK_CHANNEL="#eng-alerts"

# Optional: Override default thresholds
# SILENCE_THRESHOLD_MS=10000 # Default: 10 seconds
# COOLDOWN_MS=300000 # Default: 5 minutes
Comment on lines +9 to +10

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 COOLDOWN_MS default documented incorrectly + missing CONNECTION_MAX_LIFETIME_MIN

Two documentation gaps in the env example:

  1. The comment says the default for COOLDOWN_MS is 5 minutes (300000 ms), but the source code sets it to 300_000 * 3 = 900_000 ms (15 minutes). Operators relying on this file to understand defaults will be misled.

  2. The CONNECTION_MAX_LIFETIME_MIN variable (used on line 14 of main.ts, defaulting to 5 minutes) is not listed here at all. It should be documented so it can be tuned.

Suggested addition:

Suggested change
# SILENCE_THRESHOLD_MS=10000 # Default: 10 seconds
# COOLDOWN_MS=300000 # Default: 5 minutes
# Optional: Override default thresholds
# SILENCE_THRESHOLD_MS=10000 # Default: 10 seconds
# COOLDOWN_MS=900000 # Default: 15 minutes
# CONNECTION_MAX_LIFETIME_MIN=5 # Default: 5 minutes

4 changes: 4 additions & 0 deletions monitoring/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"root": false,
"extends": "//"
}
26 changes: 26 additions & 0 deletions monitoring/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "monapp-monitoring",
"version": "1.0.0",
"main": "dist/main.js",
"scripts": {
"build": "tsc",
"start": "node dist/main.js",
"dev": "tsx src/main.ts",
"lint": "biome check src --write"
},
"dependencies": {
"@slack/web-api": "^7.10.0",
"dotenv": "^16.3.1",
"ws": "^8.18.0"
},
"devDependencies": {
"@biomejs/biome": "2.1.2",
"@types/node": "^20.10.6",
"@types/ws": "^8.5.10",
"tsx": "^4.7.0",
"typescript": "^5.3.3"
},
"engines": {
"node": ">=22.0.0"
}
}
Loading
Loading