Skip to main content

← Overview

OmniNRF Configuration Reference

OmniNRF reads its operator configuration from config/runtime.exs, which maps environment variables onto the :omninrf application environment. Every operator-facing key is listed below with its environment variable and default.

Runtime Configuration​

import Config

config :omninrf,
sbi_addr: System.get_env("SBI_ADDR", "127.0.0.1"),
sbi_port: String.to_integer(System.get_env("SBI_PORT", "7777")),
mcc: System.get_env("MCC", "999"),
mnc: System.get_env("MNC", "70"),
heartbeat_timeout: String.to_integer(System.get_env("HEARTBEAT_TIMEOUT", "30000")),
prometheus_metrics_port: String.to_integer(System.get_env("PROMETHEUS_PORT", "9568"))

config :logger, :default_formatter,
format: {OmniLogger.JsonFormatter, :format},
metadata: :all

Parameter Table​

ParameterTypeRequiredDefaultEnv VarDescription
sbi_schemestringNohttpNoneURI scheme (http or https) used when the NRF builds absolute SBI URLs (Location headers, nfInstanceUri in notifications). The listener itself serves cleartext HTTP/2. Set via the :omninrf application environment
sbi_addrstringNo127.0.0.1SBI_ADDRIP address the SBI HTTP/2 listener binds to. Set to a reachable address (e.g. 0.0.0.0 or the signalling-plane IP) so other NFs can register and discover
sbi_portintegerNo7777SBI_PORTTCP port the SBI listener accepts connections on. This is the port every other NF must be pointed at as their NRF
mccstringNo999MCCMobile Country Code of the PLMN this NRF serves. Used to derive the serving network name and as the default PLMN for discovery matching
mncstringNo70MNCMobile Network Code of the PLMN this NRF serves
heartbeat_timeoutinteger (ms)No30000HEARTBEAT_TIMEOUTMaximum age of an NF's last heartbeat before it is treated as dead and removed. See Heartbeat aging semantics below. Also used as the default heartBeatTimer hint (in seconds) returned to NFs that do not supply their own
cleanup_intervalinteger (ms)No10000NoneInterval between background sweeps that age out NFs whose last heartbeat is older than heartbeat_timeout. Set via the :omninrf application environment
notification_max_attemptsintegerNo4NoneMaximum delivery attempts per NF status-change notification before the NRF gives up. Set via the :omninrf application environment
notification_backoff_msinteger (ms)No500NoneBase backoff for notification retries; the delay doubles on each successive attempt (exponential backoff). Set via the :omninrf application environment
discovery_validity_periodinteger (s)No3600NonevalidityPeriod in seconds advertised in every NFDiscovery SearchResult response, telling consumers how long they may cache the result. Set via the :omninrf application environment
plmn_listlistNo[%{mcc: mcc, mnc: mnc}]NoneList of PLMNs the NRF serves, as %{mcc, mnc} maps. Defaults to a single entry derived from mcc/mnc. Set via the :omninrf application environment
prometheus_metrics_portintegerNo9568PROMETHEUS_PORTTCP port the Prometheus metrics endpoint (/metrics) is served on
logger formattupleNo{OmniLogger.JsonFormatter, :format}NoneLog line formatter. The default emits structured JSON logs
logger metadataatom/listNo:allNoneWhich logger metadata fields to include. :all emits every field (NF instance ID, procedure, etc.)

SBI_ADDR defaults to 127.0.0.1 (loopback). In any multi-host or containerised deployment this must be overridden to an address the other NFs can reach, otherwise no NF will be able to register or discover.

Heartbeat aging semantics​

The NRF receives heartbeats from other NFs; it does not send them. Each time an NF sends a PATCH heartbeat (or any registration/update) for its instance, the NRF records a fresh "last seen" timestamp against that NF profile.

A background sweep runs every cleanup_interval milliseconds and removes any NF whose last-seen timestamp is older than heartbeat_timeout milliseconds. When an NF is aged out this way it is deregistered from the store and a NF_DEREGISTERED status notification is sent to any matching subscribers, so consumers stop being handed a dead endpoint.

On registration, if an NF does not include its own heartBeatTimer, the NRF fills one in equal to heartbeat_timeout / 1000 seconds as a hint of how often it expects to be heartbeated. Operators should ensure NFs heartbeat well inside heartbeat_timeout (a value comfortably shorter than the timeout) so transient jitter does not cause a live NF to be expired.

The background sweep interval (cleanup_interval) and the staleness threshold (heartbeat_timeout) are independent. An NF is only removed on the first sweep that runs after its last-seen age has already crossed heartbeat_timeout, so the real worst-case time an NF lingers after going silent is up to heartbeat_timeout + cleanup_interval. Keep cleanup_interval well below heartbeat_timeout (the defaults are 10 s and 30 s) so this overshoot stays small; a cleanup_interval larger than heartbeat_timeout would leave dead NFs advertised for longer than intended.

plmn_list​

plmn_list is the set of PLMNs this NRF serves, expressed as a list of %{mcc, mnc} maps. It is distinct from the plmnList carried inside each registered NF's own profile. That per-NF list is what discovery filters against, whereas plmn_list describes the NRF's own served network(s).

Sub-fieldTypeDescription
mccstringMobile Country Code (3 digits)
mncstringMobile Network Code (2 to 3 digits)

If unset, plmn_list defaults to a single entry built from the top-level mcc/mnc keys. Configure multiple entries for a shared / multi-operator NRF, for example:

config :omninrf,
plmn_list: [%{mcc: "999", mnc: "70"}, %{mcc: "001", mnc: "01"}]

Discovery matching (the plmn-id query parameter) is evaluated against each NF's own plmnList, not against plmn_list. Per TS 29.510, a registered NF that advertises no plmnList is assumed to belong to the NRF's PLMN and therefore matches any plmn-id filter.


Management / OAM API​

Alongside the 5G SBI, OmniNRF exposes an operator-facing REST management API for runtime inspection and control. It is served over HTTPS on the api_ex management listener (default port 8443). Request and response bodies are JSON.

MethodPathDescription
GET/api/oam/configView the current runtime configuration (sbi_addr, sbi_port, heartbeat_timeout, cleanup_interval, plmn_list, log_level)
PATCH/api/oam/config/:idUpdate runtime configuration. Only heartbeat_timeout, cleanup_interval, and log_level may be changed; all supplied values are validated before any are applied (400 on an invalid value)
POST/api/oam/log_levelChange the log level at runtime. Body {"level": "..."}; valid levels are emergency, alert, critical, error, warning, warn, notice, info, debug (400 otherwise)
POST/api/oam/heartbeatManually refresh the heartbeat timestamp for an NF. Body {"nf_instance_id": "..."} (404 if the instance is not registered)
GET/api/oam/nf_uptime/:idShow registration/heartbeat age and status for one NF instance (404 if not registered)
POST/api/oam/nf_purgeTrigger an immediate stale-instance purge sweep of the registry; reports how many NF instances were removed
GET/api/oam/resourcesShow BEAM VM resource usage (memory, process/port counts, scheduler count, uptime, OTP/BEAM versions)
GET/api/oam/diagnosticsShow BEAM VM diagnostics (node, uptime, connected nodes, process count, run queue, I/O and GC statistics)
PATCH/api/oam/nf_status/:idUpdate the stored status of an NF instance

The same listener also serves read-only status and inventory endpoints: /api/status/api, /api/status/license, /api/status/nrf, /api/status/nf, /api/api/nf_instances, /api/api/subscriptions, and /api/api/statistics.

Inspecting and purging NF instances​

GET /api/oam/nf_uptime/:id is the direct way to see how close an NF is to being aged out. It reports:

FieldMeaning
last_heartbeat_ms_agoAge of the NF's last-seen timestamp, in milliseconds
heartbeat_timeoutThe current staleness threshold, in milliseconds
nf_type, nf_statusThe NF's type and stored status

An NF is a candidate for removal once last_heartbeat_ms_ago exceeds heartbeat_timeout; the gap between the two is roughly how much longer the NF may stay silent before the sweep expires it.

POST /api/oam/nf_purge runs the same stale-instance sweep as the background timer, immediately and on demand, and returns how many instances were removed. It only removes NFs that are already stale (last-seen older than heartbeat_timeout); it does not force out healthy NFs. Use it to reclaim the registry at once rather than waiting for the next scheduled sweep. To forcibly remove a specific live NF regardless of its heartbeat age, deregister it directly with DELETE /api/api/nf_instances/:id.


Logging​

OmniNRF emits structured JSON logs via the OmniLogger.JsonFormatter formatter, with all logger metadata included (metadata: :all). Each log line carries per-request metadata such as the NF instance ID and the procedure being handled, which makes it straightforward to correlate registration, heartbeat, discovery, and notification events for a given NF.

The active log level can be changed at runtime without a restart, either through POST /api/oam/log_level or via the log_level key of PATCH /api/oam/config/:id.