/passenger_exporter

prometheus passenger exporter for nginx integration

Primary LanguageGoMIT LicenseMIT

************************
passenger_exporter_nginx
------------------------

This is a Prometheus exporter for passenger with nginx integration.

https://www.phusionpassenger.com/

*********************
Building the Exporter
---------------------

The default Makefile target creates a statically linked binary for Linux.

A Dockerfile and Makefile target are also supplied:

make build-docker

********************
Running the Exporter
--------------------

Usage of passenger_exporter_nginx:
  -log.format value
      If set use a syslog logger or JSON logging.
      Example: logger:syslog?appname=bob&local=7 or logger:stdout?json=true.
      Defaults to stderr.
  -log.level value
      Only log messages with the given severity or above.
      Valid levels: [debug, info, warn, error, fatal]. (default info)
  -passenger.command string
      Passenger command for querying passenger status.
      (default "passenger-status --show=xml")
  -passenger.pid-file string
    	Optional path to a file containing the passenger/nginx PID for additional metrics.
  -passenger.command.timeout duration
      Timeout for passenger.command. (default 500ms)
  -web.listen-address string
      Address to listen on for web interface and telemetry. (default ":9149")
  -web.telemetry-path string
      Path under which to expose metrics. (default "/metrics")

To run the Docker image:

docker run -p 9106:9106 -v $PATH_TO_PASSENGER_STATUS:/bin \
        passenger_exporter_nginx:latest /passenger_exporter_nginx

Notes for running the Docker container:

- You must mount the passenger-status binary within the container to
  have access.
- You must expose the -web.listen-address port on the container to be scraped.

**********
Collectors
----------

An example of the metrics exported can be seen in testdata/scrape_output.txt

*************
Running Tests
-------------

Tests can be run with:

go test .

Additionally, the testdata/scrape_output.txt can be regenerated by passing the
--golden flag:

go test -v . --golden