npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

plex-exporter

v0.3.0

Published

![npm](https://img.shields.io/npm/v/plex-exporter?style=for-the-badge) ![npm downloads](https://img.shields.io/npm/dt/plex-exporter?style=for-the-badge)

Readme

plex-exporter

npm npm downloads

A Prometheus exporter that exports metrics on Plex Media Server.

Install

npm install plex-exporter

Usage

NAME:
   plex-exporter - A Prometheus exporter that exports metrics on Plex Media Server.

USAGE:
   plex-exporter command [arguments...]

COMMANDS:
   token  Get authentication token from plex.tv
   server Run the exporter server

GLOBAL OPTIONS:
   --config.path value, -c value     Path to config file (default: "/etc/prometheus/plex.yml")
   --port, -p value                  Port for server (default: 9594)
   --log-level value                 Verbosity level of logs (default: "info")
   --plex-server value, -s value     Address of Plex Media Server (e.g. 192.168.0.2)
   --token value, -t value           Authentication token for Plex Media Server if using token authentication
   --username value                  Username of the plex account if logging in using credentials
   --password value                  Password of the plex account if logging in using credentials

Metrics

# HELP plex_library_section_size_count Number of items within a library section
# TYPE plex_library_section_size_count gauge
plex_library_section_size_count{name="Photos",type="album"} 580
plex_library_section_size_count{name="Photos",type="photo"} 13883
plex_library_section_size_count{name="TV programmes",type="show"} 98
plex_library_section_size_count{name="TV programmes",type="season"} 487
plex_library_section_size_count{name="TV programmes",type="episode"} 6743
plex_library_section_size_count{name="Films",type="movie"} 683
plex_library_section_size_count{name="Music",type="artist"} 350
plex_library_section_size_count{name="Music",type="album"} 990
plex_library_section_size_count{name="Music",type="track"} 9662

# HELP plex_sessions_active Now playing
# TYPE plex_sessions_active gauge
plex_sessions_active{type="movie",title="My Neighbor Totoro",progress="0.8730076653251979",player_product="Plex Web",player_title="Opera",player_platform="Opera",player_state="paused"} 2
plex_sessions_active{type="track",title="My Body Is a Cage",progress="0.08050103846339618",player_product="Plex for Windows",player_title="MY_HOSTNAME",player_platform="windows",player_state="playing",artist="Peter Gabriel",album="Scratch My Back"} 2

Authentication

The application needs to be authenticated before it can be used and there are 2 options available: pin authentication or credential authentication.

Credential Authentication

Simply provide the username and password in the configuration file or use the --username and --password command line arguments to provide your plex credentials.

Token Authentication

Simply run plex-exporter token to start the PIN retrieval process. Follow the instructions and save the retrieved token to put in the configuration file or pass as a command line parameter later.

Configuration

Instead of passing command line arguments, a configuration file can be used instead.

Specify the --config.file command line argument to point to a yaml or json file that contains the following properties:

port: 9594
logLevel: 'info'
plexServer: '192.168.0.2'

token: 'thetoken'
# or
username: 'MyUser'
password: 'MySuperSecretPassword'

Prometheus

Simply add the server to the prometheus.yml file:

- job_name: 'plex'
  scrape_interval: 1h
  static_configs:
    - targets: ['localhost:9594']