Low commit activity in last 3 years
A tool for sending Passenger stats to Datadog. A continuation of the abandoned passenger_datadog gem by Ryan Rosenblum.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

 Project Readme

Gem Version CI License

passenger-datadog-stats

A continuation of the abandoned passenger_datadog gem by Ryan Rosenblum, maintained by IronCloud. It is published as passenger-datadog-stats because RubyGems treats passenger-datadog as the same name as the original. The executable is still passenger-datadog, so existing commands and systemd units keep working.

Inspired by passengeri-datadog-monitor

This gem can be used to send stats from Passenger to Datadog. It makes use of the command passenger-status, and the Ruby implementation of statsd provided by dogstatsd-ruby.

In order to gather stats on all Passenger instances, Passenger recommends running passenger-status as root. Therefore, it is recommended that passenger-datadog be run as root as well.

If running passenger-datadog as a user other than the user that owns the application in Passenger, make sure that same version of Passenger is installed for both users.

Installation

$ gem install passenger-datadog-stats

Support

  • Ruby >= 3.3 (tested on 3.3, 3.4, and 4.0)
  • Passenger >= 6.0

Usage

Foreground process

$ passenger-datadog

The process collects Passenger stats and sends them to Datadog every 30 seconds. It runs in the foreground and shuts down cleanly on SIGTERM/SIGINT.

As a systemd service

Generate and install a unit for this host, then start it:

$ sudo passenger-datadog install-service
$ sudo systemctl enable --now passenger-datadog

install-service resolves the Ruby interpreter, the executable, and passenger-status on the machine it runs on, and writes those absolute paths into /etc/systemd/system/passenger-datadog.service. Use --dry-run to print the unit without writing it, and uninstall-service to remove it.

Under rvm/rbenv/asdf, sudo drops the gem environment, so pass it through:

$ sudo env PATH="$PATH" GEM_HOME="$GEM_HOME" GEM_PATH="$GEM_PATH" \
    passenger-datadog install-service

Regenerate the unit with --force after a Ruby upgrade. See docs/systemd.md for the full guide.

Release

Releases use RubyGems trusted publishing — no API tokens. The trusted publisher must be registered for this repo and the release.yml workflow on RubyGems.org (a pending publisher becomes a normal one after its first push). To release:

  1. Bump the version in passenger-datadog-stats.gemspec and add a CHANGELOG.md entry.
  2. Commit, tag, and push:
$ git tag v2.0.0
$ git push origin v2.0.0

.github/workflows/release.yml builds the gem and pushes it to RubyGems.org, authenticating with an OIDC token scoped to this gem.