@skroutz/cron-exporter

Prometheus exporter for cron metrics

Usage no npm install needed!

<script type="module">
  import skroutzCronExporter from 'https://cdn.skypack.dev/@skroutz/cron-exporter';
</script>

README

Prometheus Cron Exporter

An exporter built to report various metrics of cron jobs by parsing the syslog files writen to by crond

Installation

Using the repository

  1. Run $ yarn to install dependencies
  2. Run the tests with $ yarn test
  3. Build the exporter with $ yarn build
  4. Run $ node ./build/index.js

Via npm package

  1. Run $ yarn global add @skroutz/cron-exporter
  2. The binary should be installed under $ <PATH_TO_YOUR_NODE_MODULES>/.bin/cron-exporter

Configuration

The exporter can be configured using environment variables

Variable Description Default Value
CE_HOST The host that the app should respond to undefined
CE_PORT The port to run the exporter 6748
CE_PREFIX Metric prefix for prometheus ''
CE_APPEND_TIMESTAMP Wether the metric should also be timestamped true
CE_ENDPOINT Endpoint that the exporter responds to '/metrics'
CE_LOGFILE Logfile to parse data from '/var/log/cron.log'
CE_COLLECT_INTERVAL Interval of the collecting process in milliseconds 5