惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Vercel News
Vercel News
Recorded Future
Recorded Future
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Google DeepMind News
Google DeepMind News
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Microsoft Azure Blog
Microsoft Azure Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
M
MIT News - Artificial intelligence
云风的 BLOG
云风的 BLOG
Y
Y Combinator Blog
N
News | PayPal Newsroom
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Help Net Security
Help Net Security
博客园 - Franky
SecWiki News
SecWiki News
Recent Announcements
Recent Announcements
T
Troy Hunt's Blog
The Register - Security
The Register - Security
The Last Watchdog
The Last Watchdog
Webroot Blog
Webroot Blog
S
Security Affairs
博客园 - 司徒正美
S
Schneier on Security
I
InfoQ
博客园_首页
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Threat Research - Cisco Blogs
Forbes - Security
Forbes - Security
腾讯CDC
N
Netflix TechBlog - Medium
N
News and Events Feed by Topic
Cloudbric
Cloudbric
T
The Exploit Database - CXSecurity.com
P
Proofpoint News Feed
A
About on SuperTechFans
Engineering at Meta
Engineering at Meta
Recent Commits to openclaw:main
Recent Commits to openclaw:main
B
Blog
V
Vulnerabilities – Threatpost
C
Check Point Blog
Google DeepMind News
Google DeepMind News
Google Online Security Blog
Google Online Security Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Hacker News - Newest:
Hacker News - Newest: "LLM"
C
Cisco Blogs
Schneier on Security
Schneier on Security
O
OpenAI News
K
Kaspersky official blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Telegram alerts for any production app — a 5-minute setup (no SaaS, no signup, just curl)
Chalom Ellez · 2026-05-04 · via DEV Community

Disclosure: I'm a senior backend tech lead and I run HostingGuru, where Telegram alerts ship as a built-in feature. This tutorial works on any platform — it's the manual version of what HostingGuru does for you. Useful even if you never become a customer.


There's a hierarchy of where production alerts go, ranked by how likely you are to actually see them.

  1. Email → 14% open rate within an hour, less at 3am.
  2. Slack → muted in 6 of 10 teams I've seen, especially "alerts" channels.
  3. Phone-call paging (PagerDuty, Opsgenie) → works, but $20+/user/month and overkill for solo founders.
  4. Telegram → notification on lock screen, no setup cost, works on every phone, you'll see it.

For a solo founder or a small team, Telegram alerts hit a sweet spot: the notification is annoying enough that you'll see it, easy enough that you'll set it up, and free. After 8 years of trying every paging tool, this is what I default to for early-stage projects.

Here's how to wire it up in 5 minutes, plus what I learned about what to alert on.

Step 1: Create a Telegram bot (60 seconds)

  1. Open Telegram, search for @BotFather, start a chat.
  2. Send /newbot.
  3. Pick a name. Then a username (must end in bot, e.g. myapp_alerts_bot).
  4. BotFather replies with a token like 7234567890:AAFq.... Save it. This is your TELEGRAM_BOT_TOKEN.

That's it. The bot exists. Now we need somewhere to send messages.

Step 2: Get your chat ID (60 seconds)

You need the ID of the chat where alerts will land. Two options:

Option A — Personal alerts (just for you):

  1. Open a chat with your new bot. Send it any message ("hello").
  2. Visit https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates in your browser.
  3. Find the chat.id field in the JSON response. It's a number like 123456789. That's your chat ID.

Option B — Group alerts (for the team):

  1. Create a Telegram group (or use an existing one).
  2. Add your bot to the group.
  3. Send any message in the group.
  4. Visit the same getUpdates URL. The chat ID for groups is negative (e.g. -987654321).

Save the chat ID as TELEGRAM_CHAT_ID.

Step 3: Send your first alert (30 seconds)

The send API is one HTTP call. From a terminal:

curl -s -X POST \
  "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
  -d "chat_id=${TELEGRAM_CHAT_ID}" \
  -d "text=Hello from production"

Enter fullscreen mode Exit fullscreen mode

Your phone should buzz immediately. If it does, the wiring is done. Now we just need to call this from your app when something interesting happens.

Step 4: Wire it into your app (3 minutes)

Node.js / TypeScript

// alerts.ts
const TG_TOKEN = process.env.TELEGRAM_BOT_TOKEN!;
const TG_CHAT  = process.env.TELEGRAM_CHAT_ID!;

export async function alert(message: string) {
  if (!TG_TOKEN || !TG_CHAT) return; // disabled in dev
  try {
    await fetch(`https://api.telegram.org/bot${TG_TOKEN}/sendMessage`, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        chat_id: TG_CHAT,
        text: message.slice(0, 4000), // Telegram cap
        parse_mode: 'Markdown',
      }),
    });
  } catch (e) {
    // never let alerting crash your app
    console.error('alert failed', e);
  }
}

Enter fullscreen mode Exit fullscreen mode

Use it anywhere:

import { alert } from './alerts';

process.on('uncaughtException', (err) => {
  alert(`🚨 *Uncaught exception*\n\`${err.message}\`\n\nstack:\n\`\`\`\n${err.stack}\n\`\`\``);
});

// or in business logic
if (failed > THRESHOLD) {
  await alert(`⚠️ Stripe webhook retry rate at ${failed}/min — investigate`);
}

Enter fullscreen mode Exit fullscreen mode

Python

# alerts.py
import os
import requests

TG_TOKEN = os.environ.get('TELEGRAM_BOT_TOKEN')
TG_CHAT  = os.environ.get('TELEGRAM_CHAT_ID')

def alert(message: str) -> None:
    if not TG_TOKEN or not TG_CHAT:
        return
    try:
        requests.post(
            f'https://api.telegram.org/bot{TG_TOKEN}/sendMessage',
            json={
                'chat_id': TG_CHAT,
                'text': message[:4000],
                'parse_mode': 'Markdown',
            },
            timeout=5,
        )
    except Exception as e:
        # never let alerting crash your app
        print(f'alert failed: {e}')

Enter fullscreen mode Exit fullscreen mode

Wire it to the unhandled exception hook:

import sys
from alerts import alert

def excepthook(exc_type, exc_value, exc_traceback):
    alert(f'🚨 *Uncaught exception*\n`{exc_type.__name__}: {exc_value}`')
    sys.__excepthook__(exc_type, exc_value, exc_traceback)

sys.excepthook = excepthook

Enter fullscreen mode Exit fullscreen mode

Plain bash (great for cron jobs)

#!/usr/bin/env bash
# Save as /usr/local/bin/tg-alert
curl -s -X POST \
  "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
  --data-urlencode "chat_id=${TELEGRAM_CHAT_ID}" \
  --data-urlencode "text=$1" > /dev/null

Enter fullscreen mode Exit fullscreen mode

Then any cron job can do:

0 3 * * * /opt/myapp/nightly-backup.sh || tg-alert "❌ Nightly backup failed at $(hostname)"

Enter fullscreen mode Exit fullscreen mode

That's the whole infrastructure. You're done.

Step 5: The rate-limiting trick (the part most tutorials skip)

Here's the failure mode of every "I just wired alerts" project: a bug fires at 200/sec, your phone buzzes 200 times in 10 seconds, you mute the bot in frustration, you miss the next real alert two days later.

You need a rate limiter between your code and Telegram. The simplest one: deduplicate identical messages within a window.

Node.js — in-memory dedupe

const seen = new Map<string, number>();
const DEDUPE_WINDOW_MS = 5 * 60 * 1000; // 5 minutes

export async function alert(message: string) {
  const key = message.slice(0, 200); // use first 200 chars as dedupe key
  const last = seen.get(key);
  if (last && Date.now() - last < DEDUPE_WINDOW_MS) return; // skip
  seen.set(key, Date.now());

  // ... rest of the send logic
}

Enter fullscreen mode Exit fullscreen mode

This means the same alert won't fire more than once every 5 minutes, but different alerts still go through. A retry loop firing the same exception 800 times in 10 minutes will produce 3 Telegram messages, not 800. You'll still know it's happening.

Redis-backed (for multi-instance apps)

If your app runs on multiple servers, in-memory dedupe doesn't work. Use Redis:

import Redis from 'ioredis';
const redis = new Redis(process.env.REDIS_URL!);

export async function alert(message: string) {
  const key = `tg-dedupe:${hash(message.slice(0, 200))}`;
  const set = await redis.set(key, '1', 'EX', 300, 'NX');
  if (set !== 'OK') return; // already alerted in last 5 min

  // ... send to Telegram
}

Enter fullscreen mode Exit fullscreen mode

The EX 300 NX does the magic: set the key with a 5-minute TTL, but only if it doesn't already exist. If two servers try to send the same alert simultaneously, only one wins.

What to alert on (the harder question)

The tutorial above is the easy part. The hard part is what to alert on. Bad alerts → alert fatigue → muted bot → you miss the real ones.

Five things that are usually worth a Telegram ping:

  1. Uncaught exceptions in the main process — these usually mean a process is about to die or has died.
  2. Job queue depth above N — if Sidekiq/BullMQ/Celery has more than e.g. 1000 jobs queued, something is producing faster than consuming. Investigate.
  3. 5xx error rate above 1% — not every 500 needs a ping, but the rate exceeding a threshold does.
  4. Specific business events that mean money is leaking — failed payment retries, stale webhook signatures, expired refresh tokens.
  5. Cron jobs that didn't run — if your nightly backup didn't fire by 3:30am, you want to know at 3:30am, not at 9am when you check email.

Five things that are usually NOT worth a ping:

  1. Individual 4xx errors (these are mostly user error or scrapers).
  2. Slow queries (log them, don't page on them).
  3. Anything you can't act on in the next 30 minutes.
  4. Anything where the action is "do nothing, it'll resolve itself" (most CDN hiccups, most rate-limit blips).
  5. Anything informational ("user X signed up" — use a different channel for celebration).

The test I use: if I'm at dinner and my phone buzzes, will I be glad I knew, or annoyed? If the answer is "annoyed," it doesn't belong on Telegram.

A note on alert resolution

A subtle thing most tutorials skip: alerts should also tell you when something is fixed. If your job queue depth crossed 1000 and you got pinged, you also want a "now back to 0" ping when it normalizes. Otherwise you spend 20 minutes manually checking the dashboard.

The simplest pattern:

let inAlertState = false;

export async function checkQueueDepth(depth: number) {
  if (depth > 1000 && !inAlertState) {
    await alert(`🔴 Queue depth: ${depth}`);
    inAlertState = true;
  }
  if (depth < 100 && inAlertState) {
    await alert(`🟢 Queue back to ${depth}`);
    inAlertState = false;
  }
}

Enter fullscreen mode Exit fullscreen mode

Two messages per incident, not 200. Your bot stays usable.

When to stop building this and use a platform

Everything above takes about an evening to wire up properly. For a small team, that's a great trade.

There are three signs it's time to stop building this and use a platform that does it:

  1. You're spending more than 1 day a quarter maintaining your alerting setup.
  2. You realize you need pattern detection (retry loops, token spikes, anomalous response times) — those are much harder to write yourself than threshold alerts.
  3. You've muted your own bot more than once.

That's the gap HostingGuru fills. The platform tails your production logs, runs pattern detection automatically (retry loops, token spikes, hot fingerprints, anomalous latency, silent cron failures), and pings you on Telegram with a link to the relevant logs. No code in your app, no Redis dedupe to maintain — it's part of the hosting layer. €19/mo Hobby, €35/mo Pro.

If you're already deployed somewhere else, the homemade Telegram setup above is a fine start — and probably better than no alerts at all.

What to do after you finish reading this

Concretely, in the next 30 minutes:

  1. Create the bot via BotFather.
  2. Get your chat ID with getUpdates.
  3. Add TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID to your env vars on whatever platform you use.
  4. Drop the alert(message) helper into your codebase.
  5. Wire it to your top-level uncaught exception handler.
  6. Add the dedupe logic so a runaway loop doesn't spam you.

That's the minimum viable production alerting setup for any app. It costs $0, works in any country, lives on your phone, and survives every channel rotation in your team.

If you wire something interesting on top of this — anomaly detection, business event alerts, anything cool — drop it in the comments. I'm always looking for new patterns to steal.


Previous posts in this series:

1. Heroku just went into "sustaining engineering mode." Here are 5 alternatives whose free tier actually doesn't sleep

2. I built my MVP with Claude Code. Now I need to deploy it. Here's what nobody tells you.

3. Your AI app is silently burning $2,000/month and you don't know it. Here are the 5 patterns that bite founders.