> For the complete documentation index, see [llms.txt](https://docs.pharos.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pharos.ai/open-telemetry/hermes/argus/rtem.md).

# Real-Time Event Monitoring

RTEM delivers Salesforce Event Monitoring as near-real-time Platform Events over the Pub/Sub API, scaled by manual partitioning rather than auto-scaling.

RTEM (`argus-rtem`) delivers near-real-time Salesforce security and activity events as **Platform Events** over the Pub/Sub API. Payloads are Avro-decoded. Salesforce allows only a **single active subscriber per (org, channel)**, and Pub/Sub replay is bounded by a **72-hour replay window** — a gap beyond that window is unrecoverable and can't be backfilled from RTEM itself.

***

## Channel Coverage

RTEM ships **16 dedicated channel mappings plus a `*` catch-all**. Channels are enabled per org through `hermes.rtem.channels` in [`ORG_CONFIGS`](https://docs.pharos.ai/open-telemetry/configuration/org-configs.md); when the list is omitted, every channel the mapping names is subscribed. The catch-all maps any other enabled channel even without a dedicated mapping.

A dedicated mapping gives a channel richer, purpose-built field extraction; the catch-all still converts any enabled channel into OTel signals, just with less specific field mapping.

All 16 named channels emit spans with `kind=server`; the `*` catch-all emits `kind=internal`.

![Real-time login, logout, and API activity from Salesforce Event Monitoring, visualized in Grafana.](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-e1857d1529e372d82569c1a9cf29827bb188d4a4%2Fgrafana-dashboard-authentication.png?alt=media)

***

## Threat & Anomaly Detection

Salesforce's built-in ML-based threat and anomaly detection surfaces as **7** RTEM channels. Five carry a numeric threat **Score**:

* `CredentialStuffingEvent`
* `SessionHijackingEvent`
* `ApiAnomalyEvent`
* `LoginAnomalyEvent`
* `ReportAnomalyEvent`

The other two are anomaly channels that carry an **anomaly summary** (`salesforce.anomaly.summary`) rather than a numeric score:

* `UniversalAnomalyEvent`
* `GuestUserAnomalyEvent`

All seven threat/anomaly channels emit their events as logs at **`ERROR`** severity.

***

## Scaling

RTEM's footprint scales as `org_count × channel_count` — Argus opens one Pub/Sub subscriber per org per channel. Because Salesforce enforces a single active subscriber per (org, channel), RTEM can't be scaled with an active/active pool or auto-scaling; instead, growth is handled by **manual partitioning across processes** — splitting orgs and channels across separate `argus-rtem` instances as volume grows. The optional stream-ownership lease (`STREAM_LEASE_STORE`) enforces the single-active property across processes during deploys and restarts — see [`ORG_CONFIGS` Reference](https://docs.pharos.ai/open-telemetry/configuration/org-configs.md#state-store-selectors).

***

## Metrics

Representative RTEM metric names: `argus.login.count`, `argus.api.call.count`, `argus.rtem.threat.count` (dimensioned by `salesforce.threat.type`), and `argus.rtem.anomaly.count` for the two anomaly-summary channels. The dashboards built on them are in [Dashboards & Alerts](https://docs.pharos.ai/open-telemetry/configuration/dashboards-and-alerts.md).

***

## Related

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>👁️ Argus</strong></td><td>The Salesforce Event Monitoring bridge</td><td><a href="https://docs.pharos.ai/open-telemetry/hermes/argus.md">Argus</a></td></tr><tr><td><strong>📑 EventLogFile</strong></td><td>Batch CSV log pulls over REST — the other Argus surface</td><td><a href="https://docs.pharos.ai/open-telemetry/hermes/argus/elf.md">EventLogFile</a></td></tr><tr><td><strong>📊 Scaling Profiles</strong></td><td>local / standard / scaled across Iris, RTEM, and ELF</td><td><a href="https://docs.pharos.ai/open-telemetry/hermes/scaling.md">Scaling Profiles</a></td></tr></tbody></table>
