The product catalog fills automatically via a parser, but one morning you discover prices haven't updated for two days. The parser failed in the first hour, and notifications didn't arrive — the standard Bitrix mail queue is clogged, alerts not configured. Revenue loss over two days — hundreds of about $9–13 in savings. Sound familiar? We've solved this on 30+ projects.
Experts agree: "A parser without alerts is a ticking time bomb." Our clients typically achieve savings of $500–1k per month after implementation.
Without an alert system, any parser is a ticking time bomb. We've encountered this dozens of times: the client loses revenue because the parser silently crashes, and notifications don't come. The solution is to configure alerts so you learn of a problem the minute it fails, not after the fact.
Why Standard Bitrix Notifications Don't Solve the Problem
Standard Bitrix mail events (CEvent::Send) are often unsuitable for parsers: an email can take several minutes due to the b_event queue, and with mass errors the mailbox fills to capacity. There is no deduplication, no routing by urgency. A custom wrapper is needed that considers error type, source, and frequency. Idempotent notification handling ensures no duplicate alerts, and exponential backoff for network retries prevents notification floods.
Types of Errors to Catch
Before configuring notifications, classify errors:
- Network — connection timeout, HTTP 403/429/503, connection reset. Source is unavailable or blocking. In 30% of cases the problem is temporary, but 5+ in a row is systemic.
- Parsing DOM — source markup changed: CSS selectors or XPath return empty. Most common type (60% of incidents).
- Data validation — price = 0, name empty, SKU not in format. Parser received garbage.
- Catalog import —
CIBlockElement::Add()error, memory limit, missing properties. Apply circuit breaker pattern to temporarily disable notifications for non-critical errors.
Each type requires its own urgency. Network — 5-minute delay and retry; selector breakage — developer intervention.
Notification Architecture
Create a mail event PARSER_ERROR_NOTIFY with macros #ERROR_TYPE#, #SOURCE_URL#, #ERROR_MESSAGE#, #TIMESTAMP#. Register the template in admin section. Send from parser code:
CEvent::SendImmediate('PARSER_ERROR_NOTIFY', SITE_ID, [ 'ERROR_TYPE' => 'DOM_CHANGED', 'SOURCE_URL' => $url, 'ERROR_MESSAGE' => 'Selector .price-block returned empty result', 'TIMESTAMP' => date('Y-m-d H:i:s'), ]); SendImmediate sends mail immediately, bypassing the queue — correct for critical errors. Add deduplication: before sending, check in Redis (or b_option) if the same notification was sent in the last N minutes. For network errors — 30-60 minute suppression, for validation — no suppression. Our Bitrix parser monitoring ensures real-time alerts, and for 1C exchange error handling we prioritize timely notifications.
How to Deduplicate Notifications?
Deduplication is key to avoid spamming channels. We use Redis on each node: key — hash of ERROR_TYPE + SOURCE_URL, value — timestamp. If such hash exists and hasn't expired, notification is not sent. For network errors TTL 30 minutes; for DOM parsing errors — no suppression (each failure unique). Alternative: b_option table with serialized array, but Redis is faster and doesn't load the database.
Channels Besides Email
Email is slow (delivery 2-5 minutes). For critical errors we integrate Telegram Bot API or Bitrix24 webhooks. Telegram sends in 1-2 seconds, Bitrix24 chat — instantly to mobile app. Configure routing table by urgency:
| Error Type | Telegram | Bitrix24 Chat | |
|---|---|---|---|
| Single network error | — | — | — |
| Network (>5 in a row) | + | + | — |
| DOM change | + | + | + |
| Invalid data (>10%) | + | + | — |
| Import error | + | + | + |
Telegram is 10x faster than email for delivery — comparison not in favor of standard mail.
| Channel | Typical Latency | Drawbacks |
|---|---|---|
| Email (CEvent::Send) | 2-5 min | Depends on queue |
| Telegram Bot API | 1-2 sec | Requires bot |
| Bitrix24 webhook | 0.5-1 sec | On-premise only |
Logging as Foundation for Notifications
Notifications are an overlay on logs. Write each error to b_event_log via CEventLog::Add() with AUDIT_TYPE_ID='PARSER_ERROR'. This provides history in the standard log, filtering, and rotation. An agent counts errors hourly and sends a digest if threshold exceeded. This parser control automation reduces manual oversight.
Example fault emulation for testing
To test alerts, we simulate a parsing error: send a POST request with deliberately wrong data to the parser. For example, specify a non-existent URL or feed HTML without required selectors. Catch the exception, and the system sends a notification. If it arrives within 5 seconds — everything works.
How to Set Up Alerts in 1 Day?
The process takes one working day:
- Create mail event PARSER_ERROR_NOTIFY and template with macros.
- Write
ParserNotifier::send()class with deduplication and channel selection. - Integrate Telegram Bot API or Bitrix24 webhook.
- Configure error logging to
b_event_log. - Emulate a fault and verify alert delivery.
Our error alert system is proven across 30+ projects, leading to significant parsing cost savings.
What's Included in the Setup
- Mail event type and template creation
- Notification wrapper with deduplication logic
- Telegram Bot API or Bitrix24 webhook integration
- Error logging to b_event_log with rotation
- Fault emulation test to verify delivery
- Operation manual for maintenance
After setup, you get a ready-made notification system with an operation manual. Order setup — we'll analyze your parser and configure alerts in 1 day. Get a consultation: our engineers will help determine optimal channels and thresholds.

