observability_inject_prometheus
Inject Prometheus monitoring into an OpenSIPS configuration by adding required module loads and parameters for HTTP server and statistics. Idempotent and warns if port conflicts exist.
Instructions
Add prometheus.so (and httpd.so if missing) to an OpenSIPS cfg.
Most scenarios do not load prometheus.so by default. This tool
adds the minimum lines needed for the Prometheus scrape config and
Grafana dashboards to actually work:
loadmodule "httpd.so"(if missing)loadmodule "prometheus.so"modparam("prometheus", "statistics", "")— expose all groupsmodparam("httpd", "port", <prom_port>)(if missing)
Idempotent: re-running on a cfg that already loads prometheus.so is
a no-op. Returns warnings if httpd is configured for a different
port (the scrape job needs to target that port instead).
Parameters
config_content: Existing OpenSIPS configuration text. prom_port: TCP port the httpd module should listen on. Default 8888.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| config_content | Yes | ||
| prom_port | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||