Skip to content

Integration monitoring: how to detect that messages have stopped flowing

B2Bnetwork team · · 6 min

Integrations, data and cloud

In brief

You monitor an integration by its flow, not by its servers. For each interface, measure how many messages arrived, how many were processed, how many got stuck with an error and how old the oldest waiting message is. An alert must also fire when messages are missing but should be there: silence during business hours. A correlation ID in every message lets you trace one lost invoice across several systems, and a daily count reconciliation confirms nothing went missing.

Why green servers are not enough

Typical infrastructure monitoring checks whether a server responds, how much memory is free and whether the process is running. Meanwhile the integration may have been stuck since the morning. Examples that happen in every larger company:

  • a partner changed the file format, the parser sends every record to the error queue, and the integration process is healthy and "running";
  • a certificate on the partner's side expired and every connection fails with an error that the application logs and moves past;
  • a Kafka topic consumer stopped on one corrupt message and has not read anything else for hours;
  • a nightly job picked up an empty file from the SFTP server because the partner generated it too early;
  • someone changed the technical account's permissions in the ERP, and order writes are being refused.

In each case the first signal comes from a customer or a department that did not get its data. Flow monitoring is there so the team knows first.

Five metrics for every flow

MetricHow to measure itWhat a bad result means
volumemessages in a time window, compared with what is typical for that hour and weekdaya drop: something stopped sending; a spike: a loop or a resend
errorscount and share of messages rejected, in the dead letter queue (DLQ), retrieda change in format, permissions or reference data
age of the oldest messagehow long the oldest unprocessed message has been waitingthe consumer is stuck or cannot keep up
end-to-end latencytime from the event in the source to the write in the targetthe flow works, but too slowly for the process
reconciliationrecord count and checksum in source and target for the daysomething was lost on the way without an error

The age of the oldest message is often a better signal than queue length. A queue of a thousand messages that keep moving is healthy. A queue with one message from four hours ago is an outage. Derive alert thresholds from process requirements: if the warehouse needs orders within 15 minutes, an alert at 10 minutes leaves time to react. How to turn requirements into targets is covered in SLOs and error budgets.

Silence is an outage too

The hardest integration failure to detect is the absence of messages. No log entry, no error, simply nothing. Three techniques catch it:

  1. Expected volume by calendar. For each flow, record how many messages usually arrive in a given hour on a working day, at weekends and on public holidays. The alert fires when the count falls below the threshold in a window that normally has traffic.
  2. Heartbeat. The sender emits a control message or updates a timestamp every few minutes. A missing heartbeat means the sender or the connection is down, even if no business events happened in that time.
  3. File delivery deadline. For file and EDI exchanges, record the time by which the file must appear and its minimum number of records. An empty file on time is an alert as well.

One case across several systems

When a customer asks about an order the warehouse cannot see, the team has to walk the same path as the message: the online store, the integration layer, the ERP, the warehouse system. Without a shared ID, that means searching four logs by date and customer name.

  • A correlation ID assigned at the first event and passed on in every message and call. For HTTP, the standard is the `traceparent` header defined by W3C Trace Context, supported by the OpenTelemetry libraries.
  • A business key in the logs: order number, invoice number, tracking number as a separate field in structured logs, not a fragment of free text.
  • Distributed traces for synchronous flows, showing where the time went. Logs, metrics and traces are covered in more depth in Observability.

Reconciliation and ownership

Technical monitoring tells you messages are flowing. Reconciliation tells you all of them arrived. Once a day, compare the number of records and the sum of their values in source and target: 1,243 invoices in the ERP and 1,243 in the data warehouse, with net totals matching to the cent. A difference with no error in the logs usually means a filter quietly skipping records, or a change in the source that the change capture mechanism does not see, as described in Change Data Capture. Differences in ERP reports have similar causes, covered in Why ERP reports do not match.

An alert without an owner does not work. Every flow in the interface catalog has a responsible team, a runbook (what to check, how to replay messages from the error queue, whom to notify at the partner) and a note on whether the alert wakes someone at night or waits until morning. With partner webhooks, add the number of messages rejected because of a bad signature, as described in Reliable webhooks.

At B2Bnetwork, flow monitoring and resilience tests are part of every integration we build under our System integration service. In the integration of an online store with marketplaces and a warehouse system and the EDI and API integration platform for a logistics operator, one of the goals was zero lost or duplicated messages in resilience tests.

Questions and answers

What tools do we need to monitor integrations?

Usually what the company already has for metrics, logs and alerts is enough, extended with metrics from the integration itself: message counters, the age of the oldest message, the error queue. What is most often missing is not a tool but defined metrics for each flow, thresholds and an alert owner. For new services, use OpenTelemetry from the start so you are not tied to one vendor.

Aren't application logs enough?

Logs help find the cause, but they are poor at detecting the problem. Nobody reads logs in real time, and missing messages leave no trace in them. Metrics with thresholds and an alert on silence tell you something is wrong; logs with a correlation ID tell you where.

How do we set thresholds without false alarms?

Derive them from process requirements and history: how many messages arrive in a given hour and weekday, and how quickly the consumer needs them. Start with a few alerts on the most important flows and review monthly which alerts were false and which outages passed without an alert. Remove or fix any alert nobody acts on.

How do we monitor an integration with a partner whose system we do not control?

Measure what you can see on your side: whether files and messages arrive at the expected time and in the expected number, how many you reject, how long the partner's API takes to respond. Add a periodic reconciliation against the partner's data, such as the list of orders from their API compared with yours. Agree an incident contact with the partner before you need it.

What it looks like in a project

Connecting systems or moving them to the cloud? Talk to an architect.

Let's talk

Read more: Integrations, data and cloud

All in Integrations, data and cloud →