Skip to content

Configuration ​

np_net is configured with convars in server.cfg. shared/config.lua only reads them into Config; there is nothing to edit in it. With np_admin running, most settings can also be changed live (see Editable in np_admin).

Precedence: np_admin override > convar > default.

Convars ​

cfg
set  np_net_token "a-long-random-string"   # server only, never setr
set  np_net_allow_ips "10.0.0.5"           # optional
setr np_net_flush_ms 5000                  # setr: the client shims read it too
setr np_net_client_report_ms 30000         # setr: np_net's client reads it
set  np_net_max_series 2000
set  np_net_tick 1
set  np_net_hitch_ms 150
set  np_net_statebags 1
set  np_net_statebag_bytes 0
set  np_net_heatmap 1                      # heatmaps, see below
Convar Default What
np_net_token empty Bearer token for /np_net/metrics. Empty = the endpoint answers 503 and logs a hint once. Use set, never setr
np_net_allow_ips empty Optional comma list of IPs allowed to scrape (10.0.0.5,::1). Others get 403
np_net_flush_ms 5000 How often each shim hands its delta to np_net. Minimum 1000. Read by every shimmed resource when it starts, so use setr for the client shims to see it
np_net_client_report_ms 30000 Client report interval. 0 = clients don't report and their deltas are dropped. Use setr
np_net_max_series 2000 Label series np_net keeps, separately for server events, client-reported events and state bag keys. New ones beyond it are counted as event="__other__" / key="__other__". Minimum 10
np_net_tick 1 Measure the server tick
np_net_hitch_ms 150 A tick slower than this counts as a hitch
np_net_statebags 1 Count state bag changes. Read at start: changing it needs a restart of np_net
np_net_statebag_bytes 0 Also pack every changed state bag value to count its bytes. Costs CPU on busy servers

Heatmaps ​

cfg
set np_net_heatmap 1
set np_net_heatmap_sample_ms 30000
set np_net_heatmap_cell 50
set np_net_heatmap_days 30
set np_net_heatmap_token "another-long-random-string"   # optional: for staff, opens the heatmap only
Convar Default What
np_net_heatmap 1 Record heatmaps
np_net_heatmap_sample_ms 30000 How often player positions count towards player time. Minimum 5000
np_net_heatmap_cell 50 Grid cell in metres (10–1000). A change applies from the next day
np_net_heatmap_days 30 Days kept in data/ (1–366)
np_net_heatmap_max_cells 40000 Cells per layer and day. Points in new cells beyond it only count in the totals
np_net_heatmap_low_fps 30 A client report below this many FPS is a low FPS point. 0 = off
np_net_heatmap_deaths 1 Count deaths from esx:onPlayerDeath and baseevents
np_net_heatmap_token empty Token for the heatmap only. Empty = np_net_token. Use set, never setr
np_net_heatmap_map_url empty http(s) URL of a map image for the viewer background
np_net_heatmap_map_bounds empty World area of the map image: minX,minY,maxX,maxY. See Map image

Limits ​

Fixed in the code, to keep the series count and the client reports bounded:

Limit Value Beyond it
Event names per resource, per shim 128 Counted as __other__
Resources per client report 64 Report rejected (too_many_resources)
Events per resource per client report 150 Report rejected (too_many_events)
Event name length / resource name length 128 / 64 Report rejected (bad_name, also for names that aren't valid UTF-8)
Client reports per player one per max(5 s, interval / 2), rejected attempts included Report rejected (rate)

See Metrics → Series cap and Client reports.

Editable in np_admin ​

With np_admin running, Resource settings → np_net shows these fields. An np_admin value beats the convar. Without np_admin the convars decide.

Category Setting Key Applies
Clients Client report interval (ms, 0–600000) ClientReportMs live, shared with clients
Server Max label series (100–20000) MaxSeries live
Server Measure server tick Tick live
Server Hitch threshold (ms, 10–5000) HitchMs live
Server Count state bag changes StateBags restart
Server Count state bag value bytes StateBagBytes live
Heatmap Record heatmaps Heatmap live
Heatmap Position sample interval (ms, 5000–600000) HeatmapSampleMs live
Heatmap Grid cell (m, 10–1000) HeatmapCell next day
Heatmap Keep days (1–366) HeatmapDays live
Heatmap Low FPS below (0–240) HeatmapLowFps live
Heatmap Record deaths HeatmapDeaths live

The tokens, the IP list, the flush interval, the heatmap cell cap and the map image are not in np_admin: the tokens stay server-only convars, and the flush interval is read by every shimmed resource on its own.

Permissions and staff tools are on Commands & np_admin.