Using SNMP Traps Instead of Prometheus Metrics
The SBA Gateway captures metrics in Prometheus format by default. However, if your environment does not have a Prometheus instance, complete these tasks to obtain these metrics as SNMP traps delivered to your SNMP network management system (NMS). The SNMP Prometheus Adapter can act as a bridge between the two formats by converting the captured Prometheus metrics to SNMP format.
The SNMP Prometheus Adapter for 5G SBA Gateway has two main actions:
- Metrics — Converts Prometheus metrics produced by SBA Gateway into SNMP metrics.
- Alarms — Scans the log file produced by SBA Gateway for matching patterns and raises SNMP notifications (traps) to the Network Management System (NMS).
The primary deployment architecture for SBA Gateway is Kubernetes. Kubernetes typically uses Prometheus to capture metrics, which is why the SBA Gateway exposes its metrics through Prometheus HTTP endpoints.
However, if your environment requires, you can still use SNMP for metrics. The SNMP Prometheus Adapter allows these to be converted. In a similar way, alarms are picked up from a log aggregator, which collects the output from all running processes.
Figure 1 shows a simplified version of how the SNMP Prometheus Adapter converts Prometheus metric data to SNMP format for the SNMP server.
Converting Prometheus to SNMP
SNMP metrics must be defined ahead of time and provided to the NMS in a MIB file that explains what each of the values means.
For more information about the MATRIXX environment variables, see the discussion about container directories and environment variables in MATRIXX Installation and Upgrade.
With Prometheus, metrics are more dynamic and also multi-dimensional. For example, in SNMP you can expose the count of all requests sent to an API endpoint. With Prometheus, you could expose this same metric, but you could tag occurrences with extra information that might be useful for troubleshooting, usage analytics, and so on.
This capability allows you to break down this metric by return type, sender details, or for some other business purpose, from inside the message. It would be difficult to express the same information in SNMP, because values must be assigned at the time of deployment.
However, attempting to convert from SNMP to Prometheus could cause many of the additional advantages (such as multi-dimensional tagging) to be lost. Converting from Prometheus to SNMP preserves the extra details in the Prometheus metrics with the same level of detail in the SNMP metrics as if it was supported locally.