Atlas Knowledge Base
Dashboard
Flow Commands

Flow Commands


The sbn-media flow command tree queries the flow log store and the live flow event stream for cross-service call and session tracing. It answers "what happened to trace ID X" without shell access to the host.

Local invocations talk directly to the Flow Server over NATS. Remote invocations (-e/--environment) go through the API Proxy over HTTPS instead, so a support engineer's workstation never needs a NATS connection to the target deployment — only the API proxy URL and a token.

Remote environments (-e)

Every subcommand below that touches live data accepts -e <environment> to target a remote deployment instead of the local broker. Environments are declared under diagnose.environments.<name> in the configuration:

diagnose:
environments:
staging:
servers: [media.example.com:8081]
useTls: true
token: "<admin-token>"

An environment entry needs the server address and a token issued for that deployment. With the entry in place, -e staging routes the command over HTTPS to that deployment.

Subcommands


Command

Purpose

trace

Print all flow entries for a trace ID

sip

Print SIP wire-level messages for a trace ID

search

Search flow traces by device, service, time, or text

logs

Print raw log lines correlated to a trace ID

tail

Live-stream flow entries as they arrive

stats

Show a flow statistics dashboard

ui

Interactive terminal UI for browsing flow traces

trace

Fetch and print the flow log entries for a given trace ID.

sbn-media flow trace [traceId] [flags]

Flag

Short

Description

--environment

-e

Remote environment (routes via the API proxy over HTTPS; otherwise uses local NATS)

Without --environment, the command publishes a NATS request directly to the local Flow Server. With --environment, the request goes over HTTPS to that deployment's API proxy /api/flow/trace/{traceId} endpoint.

# Trace a call locally
sbn-media flow trace abc123

# Trace a call on a remote environment
sbn-media flow trace abc123 -e staging

sip

Fetch and print the SIP wire-level messages for a given trace ID.

sbn-media flow sip [traceId] [flags]

Flag

Short

Description

--environment

-e

Remote environment

--verbose

-v

Show full SIP message body (headers + SDP)

Multi-leg calls are resolved transitively via RelatedCallID, so a B2BUA scenario (for example, a callback that hairpins through a second leg) shows messages from every linked call leg, not just the one matching the trace ID.

# SIP legs for a trace ID
sbn-media flow sip abc123

# Full headers + SDP, remote environment
sbn-media flow sip abc123 -v -e staging

Search for flow traces matching the given filters.

sbn-media flow search [flags]

Flag

Description

--device

Filter by device ID

--service

Filter by service name

--contains

Substring match on entry body

--error

Show only traces with errors

--since

Lookback window (for example 1h, 7d); default 24h

--limit

Max results (default 100)

--environment, -e

Remote environment

Returns one summary line per trace: timestamp, trace ID, services involved, error flag, and duration. Use this when you don't have a trace ID yet — for example, narrowing down which trace belongs to a reported call by device or time window.

# Traces with errors on a device in the last 6 hours
sbn-media flow search --device cam-042 --error --since 6h

# Traces mentioning a specific string, remote environment
sbn-media flow search --contains "SDP negotiation failed" -e staging

logs

Fetch and print the raw log lines that share the given trace ID.

sbn-media flow logs [traceId] [flags]

Flag

Short

Description

--service


Filter by service name

--level


Filter by log level (for example ERROR)

--verbose

-v

Show all fields, suppressing repeated values from the previous line

--environment

-e

Remote environment

By default only high-signal fields (status, direction, payload, error) are shown inline. Use this as the fallback when flow trace and flow sip don't carry enough context and you need the underlying log lines themselves.

sbn-media flow logs abc123 --service sipmedia --level ERROR

tail

Stream flow log entries in real time.

sbn-media flow tail [flags]

Flag

Description

--device

Filter by device ID

--service

Filter by service name

--environment, -e

Remote environment

Uses NATS locally, or server-sent events over HTTPS when --environment is set. Press Ctrl-C to stop. Useful for watching a reproduction live instead of retro-fetching a trace after the fact.

sbn-media flow tail --service safelinefrontend -e staging

stats

Show a compact dashboard with trace counts, error counts, slowest traces, and noisiest devices for a given time window.

sbn-media flow stats [flags]

Flag

Description

--hours

Lookback window in hours (default 24)

--environment, -e

Remote environment

sbn-media flow stats --hours 4 -e staging

ui

Launch a three-pane interactive terminal UI for browsing, searching, and live-tailing flow traces.

sbn-media flow ui [flags]

Flag

Short

Description

--environment

-e

Remote environment

Uses NATS locally, or HTTPS when --environment is set. Prefer this over chaining search/trace/sip by hand when exploring an unfamiliar incident interactively.

Relationship to log trace and log flow

The older sbn-media log trace and sbn-media log flow commands read the plain-text service log files directly and predate the flow store. They still work and remain useful when a host's flow data hasn't been ingested yet, but flow trace, flow sip, and flow search are the preferred path for remote support use because they don't require log-file access on the target host — only the API proxy endpoint.

  1. SBN Media Overview
  2. Flow Server
  3. API Proxy
  4. Alarm Capture Commands




Was this helpful?