All Projects → florentchauveau → kamailio_exporter

florentchauveau / kamailio_exporter

Licence: MIT license
Prometheus exporter for Kamailio SIP server

Programming Languages

go
31211 projects - #10 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to kamailio exporter

Kube Opex Analytics
🎨 Kubernetes Cost Allocation and Capacity Planning Analytics Tool. Hourly, daily, monthly reports - Prometheus exporter - Built-in & Grafana dashboard.
Stars: ✭ 232 (+373.47%)
Mutual labels:  prometheus-exporter
OctoPrint-Prometheus-Exporter
An octoprint plugin for prometheus compatible metrics endpoint
Stars: ✭ 36 (-26.53%)
Mutual labels:  prometheus-exporter
lustre exporter
Prometheus exporter for use with the Lustre parallel filesystem
Stars: ✭ 25 (-48.98%)
Mutual labels:  prometheus-exporter
Collectd
The system statistics collection daemon. Please send Pull Requests here!
Stars: ✭ 2,700 (+5410.2%)
Mutual labels:  prometheus-exporter
mongodb-query-exporter
Prometheus MongoDB aggregation query exporter
Stars: ✭ 74 (+51.02%)
Mutual labels:  prometheus-exporter
ha cluster exporter
Prometheus exporter for Pacemaker based Linux HA clusters
Stars: ✭ 63 (+28.57%)
Mutual labels:  prometheus-exporter
Aliyun Exporter
Prometheus exporter for Alibaba Cloud Monitor
Stars: ✭ 210 (+328.57%)
Mutual labels:  prometheus-exporter
app-stores-prometheus-exporter
Prometheus exporter that exports metrics (score, ratings, reviews, app version, etc.) from the Apple App Store and Google Play Store
Stars: ✭ 80 (+63.27%)
Mutual labels:  prometheus-exporter
github releases exporter
Exports GitHub release metrics to the Prometheus format
Stars: ✭ 21 (-57.14%)
Mutual labels:  prometheus-exporter
ansitheus
Ansible playbook - Containerize, configure and deploy Prometheus ecosystem
Stars: ✭ 19 (-61.22%)
Mutual labels:  prometheus-exporter
Mikrotik Exporter
prometheus mikrotik device(s) exporter
Stars: ✭ 248 (+406.12%)
Mutual labels:  prometheus-exporter
ansible-snmp-exporter
Provision SNMP metrics exporter for prometheus monitoring
Stars: ✭ 18 (-63.27%)
Mutual labels:  prometheus-exporter
ominicontacto
The Open Source Contact Center Solution (mirror of https://gitlab.com/omnileads/ominicontacto)
Stars: ✭ 24 (-51.02%)
Mutual labels:  kamailio
Github Exporter
Prometheus exporter for github metrics
Stars: ✭ 231 (+371.43%)
Mutual labels:  prometheus-exporter
enviroplus exporter
Prometheus exporter for enviroplus module by Pimoroni
Stars: ✭ 70 (+42.86%)
Mutual labels:  prometheus-exporter
Ssl exporter
Exports Prometheus metrics for SSL certificates
Stars: ✭ 211 (+330.61%)
Mutual labels:  prometheus-exporter
domain exporter
Prometheus WHOIS domain details exporter.
Stars: ✭ 73 (+48.98%)
Mutual labels:  prometheus-exporter
elcep
Elastic Log Counter Exporter for Prometheus
Stars: ✭ 14 (-71.43%)
Mutual labels:  prometheus-exporter
extatus
App to report metrics to Prometheus from Elixir GenServers
Stars: ✭ 18 (-63.27%)
Mutual labels:  prometheus-exporter
fortigate exporter
Prometheus exporter for Fortigate firewalls
Stars: ✭ 133 (+171.43%)
Mutual labels:  prometheus-exporter

Kamailio Exporter for Prometheus

Go Report Card CI License Go Reference

A Kamailio exporter for Prometheus.

Safe to use in production. It has been used in production for years at Callr.

It communicates with Kamailio using native BINRPC via the ctl module.

BINRPC is implemented in library https://github.com/florentchauveau/go-kamailio-binrpc.

Getting Started

Pre-built binaries are available in releases.

Docker images are also available on DockerHub.

To run it:

./kamailio_exporter [flags]

Help on flags:

./kamailio_exporter --help

Flags:
      --help                 Show context-sensitive help (also try --help-long
                             and --help-man).
  -l, --web.listen-address=":9494"
                             Address to listen on for web interface and
                             telemetry.
      --web.telemetry-path="/metrics"
                             Path under which to expose metrics.
  -u, --kamailio.scrape-uri="unix:/var/run/kamailio/kamailio_ctl"
                             URI on which to scrape kamailio. E.g.
                             "unix:/var/run/kamailio/kamailio_ctl" or
                             "tcp://localhost:2049"
  -m, --kamailio.methods="tm.stats,sl.stats,core.shmmem,core.uptime,core.tcp_info"
                             Comma-separated list of methods to call. E.g.
                             "tm.stats,sl.stats". Implemented:
                             tm.stats,sl.stats,core.shmmem,core.uptime,core.tcp_info,dispatcher.list,tls.info,dlg.stats_active
  -t, --kamailio.timeout=5s  Timeout for trying to get stats from kamailio.

Usage

The CTL module must be loaded by the Kamailio instance. If you are using kamcmd (and you probably are), the module is already loaded.

By default (if no parameters are changed in the config file), the ctl module exposes a Unix stream socket: /var/run/kamailio/kamailio_ctl. If you change it, specify the scrape URI with the --kamailio.scrape-uri flag. Example:

./kamailio_exporter -u "tcp://localhost:2049"

Metrics

Default metrics

By default, the exporter will try to fetch values from the following commands:

  • tm.stats (requires the TM module)
  • sl.stats (requires the SL module)
  • core.shmmem
  • core.uptime

Module specific metrics

Dispatcher

If you are using the DISPATCHER module, you can enable dispatcher.list.

TLS

For TLS you can enable tls.info.

Dialog

For DIALOG module, you can enable dlg.stats_active.

Example for using non-default metrics

./kamailio_exporter -m "tm.stats,sl.stats,core.shmmem,core.uptime,dispatcher.list,tls.info,dlg.stats_active"

If you want more information regarding TCP and TLS connections, you can use core.tcp_info as well:

./kamailio_exporter -m "tm.stats,sl.stats,core.shmmem,core.uptime,core.tcp_info"

List of exposed metrics:

# HELP kamailio_core_shmmem_fragments Number of fragments in shared memory.
# TYPE kamailio_core_shmmem_fragments gauge
# HELP kamailio_core_shmmem_free Free shared memory.
# TYPE kamailio_core_shmmem_free gauge
# HELP kamailio_core_shmmem_max_used Max used shared memory.
# TYPE kamailio_core_shmmem_max_used gauge
# HELP kamailio_core_shmmem_real_used Real used shared memory.
# TYPE kamailio_core_shmmem_real_used gauge
# HELP kamailio_core_shmmem_total Total shared memory.
# TYPE kamailio_core_shmmem_total gauge
# HELP kamailio_core_shmmem_used Used shared memory.
# TYPE kamailio_core_shmmem_used gauge
# HELP kamailio_core_uptime_uptime_total Uptime in seconds.
# TYPE kamailio_core_uptime_uptime_total counter
# HELP kamailio_dispatcher_list_target Target status.
# TYPE kamailio_dispatcher_list_target gauge
# HELP kamailio_exporter_failed_scrapes Number of failed kamailio scrapes
# TYPE kamailio_exporter_failed_scrapes counter
# HELP kamailio_exporter_total_scrapes Number of total kamailio scrapes
# TYPE kamailio_exporter_total_scrapes counter
# HELP kamailio_sl_stats_codes_total Per-code counters.
# TYPE kamailio_sl_stats_codes_total counter
# HELP kamailio_tm_stats_codes_total Per-code counters.
# TYPE kamailio_tm_stats_codes_total counter
# HELP kamailio_tm_stats_created_total Created transactions.
# TYPE kamailio_tm_stats_created_total counter
# HELP kamailio_tm_stats_current Current transactions.
# TYPE kamailio_tm_stats_current gauge
# HELP kamailio_tm_stats_delayed_free_total Delayed free transactions.
# TYPE kamailio_tm_stats_delayed_free_total counter
# HELP kamailio_tm_stats_freed_total Freed transactions.
# TYPE kamailio_tm_stats_freed_total counter
# HELP kamailio_tm_stats_rpl_generated_total Number of reply generated.
# TYPE kamailio_tm_stats_rpl_generated_total counter
# HELP kamailio_tm_stats_rpl_received_total Number of reply received.
# TYPE kamailio_tm_stats_rpl_received_total counter
# HELP kamailio_tm_stats_rpl_sent_total Number of reply sent.
# TYPE kamailio_tm_stats_rpl_sent_total counter
# HELP kamailio_tm_stats_total_local_total Total local transactions.
# TYPE kamailio_tm_stats_total_local_total counter
# HELP kamailio_tm_stats_total_total Total transactions.
# TYPE kamailio_tm_stats_total_total counter
# HELP kamailio_tm_stats_waiting Waiting transactions.
# TYPE kamailio_tm_stats_waiting gauge
# HELP kamailio_up Was the last scrape successful.
# TYPE kamailio_up gauge
# HELP kamailio_core_tcp_info_readers Total TCP readers.
# TYPE kamailio_core_tcp_info_readers gauge
# HELP kamailio_core_tcp_info_max_connections Maximum TCP connections.
# TYPE kamailio_core_tcp_info_max_connections gauge
# HELP kamailio_core_tcp_info_max_tls_connections Maximum TLS connections.
# TYPE kamailio_core_tcp_info_max_tls_connections gauge
# HELP kamailio_core_tcp_info_max_opened_connections Opened TCP connections.
# TYPE kamailio_core_tcp_info_max_opened_connections gauge
# HELP kamailio_core_tcp_info_max_opened_tls_connections Opened TLS connections.
# TYPE kamailio_core_tcp_info_max_opened_tls_connections gauge
# HELP kamailio_core_tcp_info_max_write_queued_bytes Write queued bytes.
# TYPE kamailio_core_tcp_info_max_write_queued_bytes gauge
# HELP kamailio_tls_info_opened_connections Number of opened tls connections.
# TYPE kamailio_tls_info_opened_connections gauge
# HELP kamailio_tls_info_max_connections Number of max tls connections.
# TYPE kamailio_tls_info_max_connections gauge
# HELP kamailio_dlg_stats_active_all Dialogs all.
# TYPE kamailio_dlg_stats_active_all gauge
# HELP kamailio_dlg_stats_active_answering Dialogs answering.
# TYPE kamailio_dlg_stats_active_answering gauge
# HELP kamailio_dlg_stats_active_connecting Dialogs connecting.
# TYPE kamailio_dlg_stats_active_connecting gauge
# HELP kamailio_dlg_stats_active_ongoing Dialogs ongoing.
# TYPE kamailio_dlg_stats_active_ongoing gauge
# HELP kamailio_dlg_stats_active_starting Dialogs starting.
# TYPE kamailio_dlg_stats_active_starting gauge

Compiling

With go1.18+, clone the project and:

go build

Dependencies will be fetched automatically.

Contributing

Feel free to send pull requests.

How it works

How we implemented the exporter is explained in this blog post: https://blog.callr.tech/kamailio-exporter-for-prometheus/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].