All Projects → nats-io → Prometheus Nats Exporter

nats-io / Prometheus Nats Exporter

Licence: apache-2.0
A Prometheus exporter for NATS metrics

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Prometheus Nats Exporter

Appmetrics
App Metrics is an open-source and cross-platform .NET library used to record and report metrics within an application.
Stars: ✭ 1,986 (+1009.5%)
Mutual labels:  monitoring, prometheus, grafana-dashboard
Wgcloud
linux运维监控工具,支持系统信息,内存,cpu,温度,磁盘空间及IO,硬盘smart,系统负载,网络流量等监控,API接口,大屏展示,拓扑图,进程监控,端口监控,docker监控,文件防篡改,日志监控,数据可视化,web ssh,堡垒机,指令下发批量执行,linux面板,探针,故障告警
Stars: ✭ 2,669 (+1391.06%)
Mutual labels:  monitoring, prometheus, grafana-dashboard
Pmm Server
PMM Server
Stars: ✭ 165 (-7.82%)
Mutual labels:  monitoring, prometheus, grafana-dashboard
Prom2teams
prom2teams is an HTTP server built with Python that receives alert notifications from a previously configured Prometheus Alertmanager instance and forwards it to Microsoft Teams using defined connectors
Stars: ✭ 122 (-31.84%)
Mutual labels:  monitoring, prometheus
Openitcockpit
openITCOCKPIT is an Open Source system monitoring tool built for different monitoring engines like Nagios, Naemon and Prometheus.
Stars: ✭ 108 (-39.66%)
Mutual labels:  monitoring, prometheus
Heplify Server
HEP Capture Server
Stars: ✭ 110 (-38.55%)
Mutual labels:  monitoring, prometheus
Kubernetes Oom Event Generator
Generate a Kubernetes Event when a Pod's container has been OOMKilled
Stars: ✭ 93 (-48.04%)
Mutual labels:  monitoring, prometheus
Nvidia gpu prometheus exporter
NVIDIA GPU Prometheus Exporter
Stars: ✭ 138 (-22.91%)
Mutual labels:  monitoring, prometheus
Rabbitmq Prometheus
A minimalistic Prometheus exporter of core RabbitMQ metrics
Stars: ✭ 124 (-30.73%)
Mutual labels:  monitoring, prometheus
Promster
⏰A Prometheus exporter for Hapi, express and Marble.js servers to automatically measure request timings 📊
Stars: ✭ 146 (-18.44%)
Mutual labels:  monitoring, prometheus
Opencensus Go
A stats collection and distributed tracing framework
Stars: ✭ 1,895 (+958.66%)
Mutual labels:  monitoring, prometheus
Jmx exporter
A process for exposing JMX Beans via HTTP for Prometheus consumption
Stars: ✭ 2,134 (+1092.18%)
Mutual labels:  monitoring, prometheus
Grafana
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
Stars: ✭ 45,930 (+25559.22%)
Mutual labels:  monitoring, prometheus
Prometheus
The Prometheus monitoring system and time series database.
Stars: ✭ 40,114 (+22310.06%)
Mutual labels:  monitoring, prometheus
Mq Golang
Calling IBM MQ from Go applications
Stars: ✭ 118 (-34.08%)
Mutual labels:  monitoring, prometheus
Pingprom
Prometheus uptime monitoring quickstart
Stars: ✭ 107 (-40.22%)
Mutual labels:  monitoring, prometheus
Grafana Influx Dashboard
Grafana InfluxDB scripted dashboard
Stars: ✭ 130 (-27.37%)
Mutual labels:  monitoring, grafana-dashboard
Stackdriver Prometheus Sidecar
A sidecar for the Prometheus server that can send metrics to Stackdriver.
Stars: ✭ 91 (-49.16%)
Mutual labels:  monitoring, prometheus
Ciao
HTTP checks & tests (private & public) monitoring - check the status of your URL
Stars: ✭ 1,322 (+638.55%)
Mutual labels:  monitoring, prometheus
Legend
Legend builds and publishes Grafana dashboards for your services with prefilled metrics and alerts for your services.
Stars: ✭ 149 (-16.76%)
Mutual labels:  monitoring, grafana-dashboard

License Build Coverage

The Prometheus NATS Exporter

The Prometheus NATS Exporter consists of both a package and an application that exports NATS server metrics to Prometheus for monitoring. The exporter aggregates metrics from the server monitoring endpoints you choose (varz, connz, subsz, routez) from a NATS server into a single Prometheus exporter endpoint.

Build

make build

If you want to run tests, you can do this.

make install-tools
make test
make lint

# If you want to see the coverage locally, then run this.
# make test-cover

Run

Start the prometheus-nats-exporter executable, and poll the varz metrics endpoints of the NATS server located on localhost configured with a monitor port of 5555.

prometheus-nats-exporter -varz "http://localhost:5555"

To run with docker, you can use the following image:

docker run natsio/prometheus-nats-exporter:latest

Usage

prometheus-nats-exporter <flags> url
  -D	Enable debug log level.
  -DV
    	Enable debug and trace log levels.
  -V	Enable trace log level.
  -a string
    	Network host to listen on. (default "0.0.0.0")
  -addr string
    	Network host to listen on. (default "0.0.0.0")
  -channelz
    	Get streaming channel metrics.
  -connz
    	Get connection metrics.
  -gatewayz
    	Get gateway metrics.
  -http_pass string
    	Set the password for HTTP scrapes. NATS bcrypt supported.
  -http_user string
    	Enable basic auth and set user name for HTTP scrapes.
  -l string
    	Log file name.
  -log string
    	Log file name.
  -p int
    	Port to listen on. (default 7777)
  -path string
    	URL path from which to serve scrapes. (default "/metrics")
  -port int
    	Port to listen on. (default 7777)
  -prefix string
    	Replace the default prefix for all the metrics.
  -r string
    	Remote syslog address to write log statements.
  -remote_syslog string
    	Write log statements to a remote syslog.
  -replicatorVarz
    	Get replicator general metrics.
  -ri int
    	Interval in seconds to retry NATS Server monitor URL. (default 30)
  -routez
    	Get route metrics.
  -s	Write log statements to the syslog.
  -serverz
    	Get streaming server metrics.
  -subz
    	Get subscription metrics.
  -syslog
    	Write log statements to the syslog.
  -tlscacert string
    	Client certificate CA for verification (used with HTTPS).
  -tlscert string
    	Server certificate file (Enables HTTPS).
  -tlskey string
    	Private key for server certificate (used with HTTPS).
  -use_internal_server_id
    	Enables using ServerID from /varz
  -varz
    	Get general metrics.
  -version
    	Show exporter version and exit.

The URL parameter

The url parameter is a standard url. Both http and https (when TLS is configured) is supported.

e.g. http://denver1.foobar.com:8222

Monitoring

The NATS Prometheus exporter exposes metrics through an HTTP interface, and will default to: http://0.0.0.0:7777/metrics.

When --http_user and --http_pass is used, you will need to set the username password in prometheus. See basic_auth in the prometheus configuration documentation. If using a bcrypted password use a very low cost as scrapes occur frequently.

It will return output that is readable by Prometheus.

The returned data looks like this:

# HELP gnatsd_varz_in_bytes in_bytes
# TYPE gnatsd_varz_in_bytes gauge
gnatsd_varz_in_bytes{server_id="http://localhost:8222"} 0
# HELP gnatsd_varz_in_msgs in_msgs
# TYPE gnatsd_varz_in_msgs gauge
gnatsd_varz_in_msgs{server_id="http://localhost:8222"} 0
# HELP gnatsd_varz_max_connections max_connections
# TYPE gnatsd_varz_max_connections gauge
gnatsd_varz_max_connections{server_id="http://localhost:8222"} 65536

The NATS Prometheus Exporter API

The NATS prometheus exporter also provides a simple and easy to use API that allows it to run embedded in your code.

Import the exporter package

    // import the API like this
    import (
      "github.com/nats-io/prometheus-nats-exporter/exporter"
    )

API Usage

In just a few lines of code, configure and launch an instance of the exporter.

	// Get the default options, and set what you need to.  The listen address and port
	// is how prometheus can poll for collected data.
	opts := exporter.GetDefaultExporterOptions()
	opts.ListenAddress = "localhost"
	opts.ListenPort = 8888
	opts.GetVarz = true
	opts.NATSServerURL = "http://localhost:8222"

	// create an exporter instance, ready to be launched.
	exp := exporter.NewExporter(opts)

	// start collecting data
	exp.Start()

	// when done, simply call Stop()
	exp.Stop()

	// For convenience, you can block until the exporter is stopped
	exp.WaitUntilDone()

Monitoring Walkthrough

For additional information, refer to the walkthrough of monitoring NATS with Prometheus and Grafana. The NATS Prometheus Exporter can be used to monitor NATS Streaming as well. Refer to the walkthrough/streaming documentation.

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].