portmaster-plugin-prometheus

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2022 License: MIT Imports: 18 Imported by: 0

README

portmaster-plugin-prometheus

DISCLAIMER: This is not an official Safing product!

This repository provides a Safing Portmaster plugin that exposes connection statistics to Prometheus. It supports pull (scraping) and push mode.

Warning: This repository is based on the experimental Portmaster Plugin System which is available in safing/portmaster#834 but has not been merged and released yet.

Installation

Using the install command

This plugin uses the cmds.InstallCommand() from the portmaster plugin framework so installation is as simple as:

go build .
sudo ./portmaster-plugin-prometheus install --data /opt/safing/portmaster
Manual Installation

To manually install the plugin follow these steps:

  1. Build the plugin from source code: go build .

  2. Move the plugin /opt/safing/portmaster/plugins/portmaster-plugin-prometheus

  3. Edit /opt/safing/portmaster/plugins.json to contain the following content:

    [
         {
             "name": "portmaster-plugin-prometheus",
             "types": [
                 "decider"
             ],
             "config": {
                 "namespace": "",
                 "subsystem": "",
                 "mode": "pull",
                 "address": "0.0.0.0:8081",
                 "push": {
                     "interval": "10s",
                     "jobName": "portmaster"
                 }
             }
         }
    ]
    

Configuration

Important: Before being able to use plugins in the Portmaster you must enable the "Plugin System" in the global settings page. Note that this setting is still marked as "Experimental" and "Developer-Only" so you'r Portmaster needs the following settings adjusted to even show the "Plugin System" setting:

The plugin can either be configured using static configuration in plugins.json.

Just specify the static configuration when using portmaster-plugin-prometheus install. For example:

sudo ./portmaster-plugin-prometheus install --mode push --address https://pushgateway.example.com/metrics/ --push-job-name portmaster --push-interval 10s --data /opt/safing/portmaster

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL