Repository navigation
Add sipnab Metrics to Prometheus
Your SIP proxy's statistics say what the proxy did: calls routed, transactions, memory. sipnab's say what the calls themselves looked like on the wire:
- how many completed and failed,
- post-dial delay,
- the quality of their audio.
In the same Prometheus, the two sit side by side on one dashboard.
This guide adds sipnab to the Prometheus and Grafana from Add Prometheus and Grafana to your voice stack. It also imports the dashboard that ships with sipnab. Every series sipnab publishes, and what it means, is in Prometheus metrics.
The proxy is one of these:
- OpenSIPS, from its packages or built from source;
- Kamailio, as that guide's With Kamailio section sets it up.
sipnab reads the calls off the wire, so every step is the same for each.
Every block on this page ran as written, in order, on 2026-09-28, with sipnab 0.5.194 from its release package. It ran on clean x86_64 virtual machines with 2 cores and 3 GB of memory:
- Debian 13 (kernel 6.12.63)
- Ubuntu 24.04.5 (kernel 6.8.0)
On each, it ran with OpenSIPS, from source and from the packages, with Kamailio, and with both on one machine.
On Debian 13, causing each fault under When something does not work produced what it describes.
The examples use 192.0.2.10 as the machine's address.
# Run all of these, in order.
V=$(curl -fsSL https://api.github.com/repos/NormB/sipnab/releases/latest \
| python3 -c 'import json,sys; print(json.load(sys.stdin)["tag_name"].lstrip("v"))')
curl -fsSLO https://github.com/NormB/sipnab/releases/download/v$V/sipnab_${V}_amd64.deb
curl -fsSL https://github.com/NormB/sipnab/releases/download/v$V/SHA256SUMS.txt \
| grep " sipnab_${V}_amd64.deb$" | sha256sum -c -
sudo apt-get install -y ./sipnab_${V}_amd64.deb
sipnab --versionsipnab's package runs it under systemd as the sipnab user, with its metrics
on 127.0.0.1:9090. That is Prometheus's own port. So move sipnab's to
127.0.0.1:9091 in a drop-in.
The call counts need only the SIP, which sipnab captures by default. The media series (MOS, jitter, loss) need the audio too:
- sipnab 0.5.192 and earlier capture it only when a capture filter names its ports, as the rtpengine guide does.
- Later versions capture it by default.
# Run all of these, in order.
sudo mkdir -p /etc/systemd/system/sipnab.service.d
sudo tee /etc/systemd/system/sipnab.service.d/metrics.conf >/dev/null <<'EOF'
[Service]
ExecStart=
ExecStart=/usr/bin/sipnab -N -d any --no-cli-print --syslog --metrics 127.0.0.1:9091
EOF
sudo systemctl daemon-reload
sudo systemctl enable sipnab
sudo systemctl restart sipnab
systemctl is-active sipnab
until curl -fs -o /dev/null 127.0.0.1:9091/metrics; do sleep 1; done
curl -s 127.0.0.1:9091/metrics | awk '/^sipnab_/ && n++ < 3'The empty ExecStart= line clears the package's command before the next line
sets this one. Another guide's drop-in may also set ExecStart. Then systemd
uses only the last one it reads. So put all the flags in one drop-in.
Add sipnab to Prometheus's targets. Restart Prometheus so that it reads
the change. The until line waits for Prometheus to scrape sipnab once:
# Run all of these, in order.
cd /opt/monitoring
cat >> prometheus.yml <<'EOF'
- job_name: sipnab
static_configs:
- targets: ["127.0.0.1:9091"]
EOF
docker compose restart prometheus
targets() { curl -s localhost:9090/api/v1/targets | python3 -c 'import sys,json; [print(t["labels"]["job"], t["health"]) for t in json.load(sys.stdin)["data"]["activeTargets"]]'; }
until targets 2>/dev/null | grep -q '^sipnab up$'; do sleep 2; done
targetsIt prints the proxy's target, opensips up or kamailio up, and sipnab up.
The dashboard ships in sipnab's repository as contrib/grafana/sipnab-dashboard.json.
It asks, on import, which Prometheus data source to use. Import it through
Grafana's API. Answer with the data source the Prometheus guide provisioned:
# Run all of these, in order.
cd /opt/monitoring
V=$(sipnab --version | head -1 | awk '{print $2}')
curl -fsSL "https://raw.githubusercontent.com/NormB/sipnab/v$V/contrib/grafana/sipnab-dashboard.json" -o sipnab-dashboard.json
python3 -c 'import json; d=json.load(open("sipnab-dashboard.json")); print(json.dumps({"dashboard": d, "overwrite": True, "inputs": [{"name": "DS_PROMETHEUS", "type": "datasource", "pluginId": "prometheus", "value": "prometheus"}]}))' > import.json
curl -fs -u "admin:$(sed -n 's/^GF_PASS=//p' .env)" -H 'Content-Type: application/json' \
-d @import.json localhost:3000/api/dashboards/import | python3 -c 'import sys,json; print(json.load(sys.stdin)["importedUrl"])'
rm import.jsonThe last line prints the dashboard's path. Open it under
http://192.0.2.10:3000: the dashboard is sipnab Overview.
Place a test call as in the Place a test call and watch the counter step of the Prometheus guide. Then ask Prometheus how many calls sipnab saw complete:
# Run all of these, in order.
cd ~/sipp
sipp -sn uas -i 127.0.0.1 -p 5070 -m 1 -bg
sipp -sf uac_rr.xml 192.0.2.10:5060 -i 192.0.2.10 -p 5080 -m 1 -d 1000 -timeout 20s
sleep 8
curl -s localhost:9090/api/v1/query --data-urlencode 'query=sum(sipnab_dialogs_total{state="completed"})' \
| python3 -c 'import sys,json; print(json.load(sys.stdin)["data"]["result"][0]["value"][1])'It prints 1: sipnab saw the call from its INVITE to its BYE. The proxy
counted the same call in its own series:
- OpenSIPS's
opensips_processed_dialogs, - or Kamailio's
kamailio_core_rcv_requests_invite.
With Kamailio on 5062, as
OpenSIPS and Kamailio on one machine
sets it up, sipnab's default capture of ports 5060-5061 misses Kamailio's
calls. Add --portrange 5060-5062 to the drop-in in the Run sipnab with its
metrics on a free port step:
# Run all of these, in order.
sudo sed -i 's|--metrics 127.0.0.1:9091$|--metrics 127.0.0.1:9091 --portrange 5060-5062|' /etc/systemd/system/sipnab.service.d/metrics.conf
grep '^ExecStart=/' /etc/systemd/system/sipnab.service.d/metrics.conf
sudo systemctl daemon-reload
sudo systemctl restart sipnabThe Scrape sipnab step then prints three targets, opensips, kamailio and
sipnab, all up. A call through either proxy adds one to sipnab's count.
-
systemctl is-active sipnabdoes not sayactive. Readjournalctl -u sipnab.-
Failed to bind metrics server on 127.0.0.1:9090: Address already in usemeans something else, here Prometheus, holds the port. systemd then keeps restarting sipnab. - Check the drop-in's
--metricsport.
-
-
The
sipnabtarget isdown. Checkcurl 127.0.0.1:9091/metricson the machine. Then check the target in/opt/monitoring/prometheus.yml.
Website · Repository · Issues · Generated from docs/ — edit there, not here.
Getting started
- Installation
- First CLI Triage
- Glossary
- Cookbook
- Runnable Examples
- Real World Captures
- Troubleshooting
- Tuning Capture
- Encapsulations
- Rtpengine Relays
- Backers
Using the TUI
CLI & automation
- CLI Reference
- Error Messages
- Filter DSL
- Output Formats
- SIP Response Codes
- SIP Methods
- SIP Header Fields
- SIP Parameters
- SIP Lint Rules
- MOS and Codecs
Configuration
Integrations (API & MCP)
- REST API
- Prometheus Metrics
- Authentication
- MCP
- MCP Deployment
- MCP Across an Estate
- MCP Tools
- MCP Tools Core
- MCP Tools Signaling
- MCP Tools Captures
- MCP Tools Security
- MCP Tools Media
- MCP Tools Relay
- MCP Tools TFPS
- MCP Tools Server
- MCP Tools vCon
- MCP Tools TLS
- MCP Protocol
- Uprobe Walkthrough
- Capture SIP over TLS
- WASM Plugins
- vCon Export
- vCon Capture Stack
- G729 Decoding
Your SIP server
- Use OpenSIPS as the SIP Server
- Run sipnab beside OpenSIPS
- Use Kamailio as the SIP Server
- Run sipnab beside Kamailio
- Use Asterisk as the PBX
- Run sipnab beside Asterisk
- Use FreeSWITCH in the Voice Stack
- Run sipnab beside FreeSWITCH
Add to your voice stack
- Add a vCon Server
- Send vCons to a vCon Server
- Send vCons to vcon store
- Add TFPS
- Control TFPS from sipnab
- Ban SIP Scanners with fail2ban
- Feed fail2ban from sipnab
- Add rtpengine
- Name rtpengine Media with sipnab
- Add rtpproxy
- Name rtpproxy Media with sipnab
- Add Homer
- Connect sipnab to Homer
- Add Prometheus and Grafana
- Add sipnab Metrics to Prometheus
Development & internals
- Internals Index
- Internals Subsystem Guide
- Internals Invariants
- Internals Testing
- Internals Walkthroughs
- Internals Build CI Release
- Internals Profiling
- Internals Domain Primer
- Library API
- Benchmarks
- Fault Model
- Threat Model
- Assurance Case
- Architecture
- Internals Threading
- Internals TUI Testing
- Internals Zero Copy Payloads
- Internals Uprobe Capture
- Internals Rtpengine Control Plane
- Internals Relay Control Decoding
- Internals vCon Exporter