1.0.6 • Published 2 years ago

@mailprotector/haraka-plugin-prometheus v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

haraka-plugin-prometheus

A Haraka plugin for collecting metrics into Prometheus.

Install

Install with npm

npm install @mailprotector/haraka-plugin-prometheus --save

Setup

HTTP Server

Enable Haraka's HTTP server (see listen in http.ini) to listen on port 9904

http.ini:

listen=[::]:9904

Enable Plugin

Add to plugin file in the haraka config folder

@mailprotector/haraka-plugin-prometheus

Config

Config options are set in prometheus.json:

ParameterDescriptionTypeDefault Value
enabledwhether to enable the pluginbooleantrue
prefixprefix that gets appended to all metricsstringnone
default_labelslabels to add to all metricsmapnone

Sending metrics from other plugins

You can push metrics into the connection.notes.prometheus_metrics array from any other Haraka plugin. They will be collected into Prometheus on the disconnect hook.

The format of the array is:

connection.notes.prometheus_metrics = [
  { type: 'counter', name 'test_counter', help: '', value: 1, label_names: ['foo', 'bar'] },
  { type: 'gauge', name 'test_gauge', help: '', value: 1, label_names: ['foo', 'bar'] },
  { type: 'histogram', name 'test_histogram', help: '', value: 1, label_names: ['foo', 'bar'] },
  { type: 'summary', name 'test_summary', help: '', value: 1, label_names: ['foo', 'bar'] }
]

alt text

About Mailprotector

1.0.6

2 years ago

1.0.5

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago