ZeroMQ Integration
Monitor socket metrics, message throughput, and high-water mark behavior across your ZeroMQ messaging topology. Detect silent message drops and slow subscribers before they impact your applications.
How It Works
Instrument Your ZMQ Sockets
Add the TigerOps ZeroMQ SDK to your application. Wrap your ZMQ context creation and the SDK instruments all socket types (PUB/SUB, PUSH/PULL, REQ/REP, DEALER/ROUTER) automatically via ZMQ socket options.
Enable Socket Statistics
The SDK enables ZMQ_STATISTICS on each monitored socket and reads counters via a ZMQ_PAIR monitoring socket. Message counts, byte rates, and drop events are collected without modifying your application logic.
Set High-Water Mark Alerts
Configure per-socket HWM thresholds. TigerOps alerts when the send or receive queue approaches its high-water mark, giving you time to scale consumers or reduce producer rates before messages are silently dropped.
Correlate Across Topology
TigerOps maps your ZMQ socket topology and correlates send-side drop events on PUB sockets with receive-side lag on SUB sockets — so you know which subscribers are slow, not just that drops are occurring.
What You Get Out of the Box
Socket Throughput Monitoring
Per-socket message send/receive rates and byte throughput. Track throughput trends across PUB/SUB, PUSH/PULL, and DEALER/ROUTER topologies with per-endpoint breakdowns for multi-peer sockets.
High-Water Mark Detection
Monitor send and receive queue depths relative to configured HWM values. Alert before queues saturate and ZeroMQ begins silently dropping messages or applying backpressure to producers.
Message Drop Tracking
Count dropped messages on PUB sockets when slow SUB subscribers cause HWM saturation. Track drop rates over time to quantify subscriber lag impact and tune your HWM configuration.
Connection & Bind Event Monitoring
Track socket connect, disconnect, bind, and accept events via ZMQ monitor sockets. Detect unexpected peer disconnections and connection churn that can indicate network instability.
Latency Percentile Tracking
Measure round-trip latency for REQ/REP and DEALER/ROUTER patterns. Track p50/p95/p99 latency to identify slow responders in your ZMQ service mesh without modifying message frames.
AI Root Cause Analysis
When message drops or latency spikes occur, TigerOps AI correlates socket HWM events with CPU saturation, network bandwidth exhaustion, and slow consumer process metrics to surface the root cause.
Instrumenting ZeroMQ in Python
Add TigerOps socket monitoring to your ZeroMQ application with the pyzmq SDK wrapper.
# Install the TigerOps ZeroMQ SDK
pip install tigerops-zmq
import zmq
from tigerops_zmq import instrument_context, SocketConfig
# Initialize TigerOps monitoring on your ZMQ context
ctx = instrument_context(
zmq.Context(),
api_key=os.environ["TIGEROPS_API_KEY"],
service_name="market-data-publisher",
# High-water mark alert thresholds (% of HWM)
hwm_warning_pct=70,
hwm_critical_pct=90,
# Named socket configs for better metric labeling
socket_configs={
"market_data_pub": SocketConfig(
hwm=10000,
alert_on_drops=True,
),
"control_rep": SocketConfig(
latency_tracking=True,
p95_warning_ms=10,
),
},
)
# Use sockets normally — TigerOps monitors automatically
pub = ctx.socket(zmq.PUB, name="market_data_pub")
pub.bind("tcp://*:5555")
rep = ctx.socket(zmq.REP, name="control_rep")
rep.bind("tcp://*:5556")
# TigerOps tracks:
# - Messages sent/received per second
# - Bytes in/out per socket
# - Queue depth vs HWM
# - Drop count on PUB when SUBs are slow
# - Connect/disconnect eventsCommon Questions
How does TigerOps collect metrics from ZeroMQ applications?
TigerOps uses the ZMQ_EVENT_ALL monitoring API, which creates a secondary ZMQ_PAIR socket that receives event notifications for connect, disconnect, message send, and error events. The SDK collects these events in a background thread with negligible impact on your application.
Which ZeroMQ language bindings does TigerOps support?
TigerOps provides SDKs for C/C++ (libzmq + czmq), Python (pyzmq), Node.js (zeromq.js), Go (go-zeromq), and Java (JeroMQ). The OTLP metrics exporter in each SDK sends data to TigerOps regardless of which binding you use.
Can TigerOps detect when ZeroMQ drops messages due to HWM limits?
Yes. ZeroMQ surfaces drop events via the ZMQ_EVENT_CLOSED and ZMQ_EVENT_DISCONNECTED monitoring events combined with the DROPS socket stat counter (ZMQ 4.3+). TigerOps tracks this counter per socket and fires an alert when the drop rate exceeds your configured threshold.
How do I monitor a ZeroMQ application deployed across multiple hosts?
Each application instance runs the TigerOps SDK and pushes metrics independently. TigerOps aggregates metrics by socket name and endpoint pattern so you get a unified topology view. Use the service name label to group metrics from processes that share the same logical role.
Does TigerOps support ZeroMQ over CURVE or GSSAPI security?
Yes. The TigerOps SDK monitors socket-level events regardless of the security mechanism in use. For CURVE-secured sockets, you can also monitor authentication failure events (ZMQ_EVENT_HANDSHAKE_FAILED_AUTH) to detect unauthorized connection attempts.
Stop Losing Messages to Silent HWM Drops
HWM saturation alerts, message drop tracking, and slow subscriber detection. Instrument in minutes.