No description
Find a file
Kumi 139a036dad
fix: handle errors gracefully in user count updates
Return False instead of 0 when fetching registered users fails, and skip updating the gauge if an error occurs. Improves error handling, avoiding misleading user count updates.
2024-06-30 08:15:55 +02:00
.gitignore feat: Fork exporter to Prometheus Piped 2024-05-23 11:50:25 +02:00
config.dist.yaml feat: Fork exporter to Prometheus Piped 2024-05-23 11:50:25 +02:00
LICENSE feat: Fork exporter to Prometheus Piped 2024-05-23 11:50:25 +02:00
prometheus_piped.py fix: handle errors gracefully in user count updates 2024-06-30 08:15:55 +02:00
README.md feat: Fork exporter to Prometheus Piped 2024-05-23 11:50:25 +02:00
requirements.txt feat: Fork exporter to Prometheus Piped 2024-05-23 11:50:25 +02:00

Prometheus Exporter for Piped instances

This is a simple exporter for Prometheus that gets statistics from Piped instances. Currently, it only supports getting the number of registered users.

Prerequisites

  • Python >= 3.8
  • prometheus-client, pyyaml (pip install -r requirements.txt)

Configuration

The exporter is configured using config.yaml. The provided config.dist.yaml is a template for the configuration file.

To add a new instance, simply add its API URL to the piped list.

Usage

To run the exporter, simply execute the prometheus_piped.py script. The exporter will listen on port 8098.

A sample output of the exporter looks like this:

# HELP registered_users Number of registered users
# TYPE registered_users gauge
registered_users{domain="api.piped.private.coffee"} 54.0

License

This project is licensed under the MIT License - see the LICENSE file.