• Stars
    star
    161
  • Rank 233,470 (Top 5 %)
  • Language
    Go
  • License
    MIT License
  • Created about 6 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Prometheus ZFS exporter

ZFS Exporter

Test Release Go Report Card License

Prometheus exporter for ZFS (pools, filesystems, snapshots and volumes). Other implementations exist, however performance can be quite variable, producing occasional timeouts (and associated alerts). This exporter was built with a few features aimed at allowing users to avoid collecting more than they need to, and to ensure timeouts cannot occur, but that we eventually return useful data:

  • Pool selection - allow the user to select which pools are collected
  • Multiple collectors - allow the user to select which data types are collected (pools, filesystems, snapshots and volumes)
  • Property selection - allow the user to select which properties are collected per data type (enabling only required properties will increase collector performance, by reducing metadata queries)
  • Collection deadline and caching - if the collection duration exceeds the configured deadline, cached data from the last run will be returned for any metrics that have not yet been collected, and the current collection run will continue in the background. Collections will not run concurrently, so that when a system is running slowly, we don't compound the problem - if an existing collection is still running, cached data will be returned.

Installation

Download the latest release for your platform, and unpack it somewhere on your filesystem.

You may also build the latest version using Go v1.11 - 1.17 via go get:

go get -u github.com/pdf/zfs_exporter

Installation can also be accomplished using go install:

version=latest # or a specific version tag
go install github.com/pdf/zfs_exporter@$version

Usage

usage: zfs_exporter [<flags>]

Flags:
  -h, --help                 Show context-sensitive help (also try --help-long and --help-man).
      --collector.dataset-filesystem
                             Enable the dataset-filesystem collector (default: enabled)
      --properties.dataset-filesystem="available,logicalused,quota,referenced,used,usedbydataset,written"
                             Properties to include for the dataset-filesystem collector, comma-separated.
      --collector.dataset-snapshot
                             Enable the dataset-snapshot collector (default: disabled)
      --properties.dataset-snapshot="logicalused,referenced,used,written"
                             Properties to include for the dataset-snapshot collector, comma-separated.
      --collector.dataset-volume
                             Enable the dataset-volume collector (default: enabled)
      --properties.dataset-volume="available,logicalused,referenced,used,usedbydataset,volsize,written"
                             Properties to include for the dataset-volume collector, comma-separated.
      --collector.pool       Enable the pool collector (default: enabled)
      --properties.pool="allocated,dedupratio,fragmentation,free,freeing,health,leaked,readonly,size"
                             Properties to include for the pool collector, comma-separated.
      --web.listen-address=":9134"
                             Address on which to expose metrics and web interface.
      --web.telemetry-path="/metrics"
                             Path under which to expose metrics.
      --web.disable-exporter-metrics
                             Exclude metrics about the exporter itself (promhttp_*, process_*, go_*).
      --deadline=8s          Maximum duration that a collection should run before returning cached data. Should
                             be set to a value shorter than your scrape timeout duration. The current
                             collection run will continue and update the cache when complete (default: 8s)
      --pool=POOL ...        Name of the pool(s) to collect, repeat for multiple pools (default: all pools).
      --exclude=EXCLUDE ...  Exclude datasets/snapshots/volumes that match the provided regex (e.g.
                             '^rpool/docker/'), may be specified multiple times.
      --log.level=info       Only log messages with the given severity or above. One of: [debug, info, warn,
                             error]
      --log.format=logfmt    Output format of log messages. One of: [logfmt, json]
      --version              Show application version.

Collectors that are enabled by default can be negated by prefixing the flag with --no-*, ie:

zfs_exporter --no-collector.dataset-filesystem

Caveats

The collector may need to be run as root on some platforms (ie - Linux prior to ZFS v0.7.0).

Whilst inspiration was taken from some of the alternative ZFS collectors, metric names may not be compatible.

Alternatives

In no particular order, here are some alternative implementations:

More Repositories

1

kdeconnect-chrome-extension

A browser extension to send pages and content from your browser to connected KDE Connect devices.
JavaScript
229
star
2

ubuntu-mono-powerline-ttf

Ubuntu Mono fonts patched for vim-powerline and the new powerline
64
star
3

simple-navigation-bootstrap

MAINTAINER WANTED: simple-navigation-bootstrap is a simple-navigation renderer for twitter-bootstrap navigation and dropdowns.
Ruby
49
star
4

golifx

golifx provides a simple Go interface to the LIFX LAN protocol
Go
25
star
5

hyprpanel

An opinionated panel/shell for the Hyprland compositor.
Go
23
star
6

kodi-callback-daemon

A small Go daemon that reads notifications from Kodi/XBMC via the JSON-RPC socket, and performs actions based on those notifications.
Go
21
star
7

freeipa-user-mailalternateaddress

Enables the mailAlternateAddress attribute from the mailrecipient schema in FreeIPA.
Shell
14
star
8

kodirpc

Golang client for the Kodi TCP JSON-RPC interface
Go
12
star
9

knife-attribute

Manipulate Chef attributes via Knife
Ruby
10
star
10

terraform-provider-conditional

DEPREPCATED: Terraform provider for conditionals
Go
8
star
11

openwrt-14.07-x86_64

DISCONTINUED: OpenWRT 14.07 (Barrier Breaker) with x86_64 support
C
5
star
12

ultrabay_eject

Eject script for Thinkpad Ultrabay, from http://www.thinkwiki.org/wiki/How_to_hotswap_Ultrabay_devices
Shell
4
star
13

websocketrwc

Golang package that wraps Gorilla websocket in an io.ReadWriteCloser interface
Go
3
star
14

vectyx

Go
3
star
15

bower-vendor

Vendor the bower assets you want for Ruby on Rails. Inspired by bower-installer. DEPRECATED: I recommend using rails-assets instead
Ruby
3
star
16

has_cache

Convenience wrapper for the Rails Cache Store
Ruby
2
star
17

libvirt

This is a fork of libvirt so I can work on a ZFS storage backend in the zfs branch. See also: https://github.com/rlaager/python-virtinst
C
2
star
18

cliphist-wofi-img

Quick hack to display images in wofi for cliphist binary image history entries.
Go
2
star
19

crononag

super-simple wrapper for commands running from cron
Go
1
star
20

goyello_stuff_to_do

Major modiffication of Eric Davis Stuff to do plugin
Ruby
1
star
21

ohai-nfs-exports

A tiny Ohai plugin to populate attributes for NFS exports
Ruby
1
star
22

openwrt-14.07-x86_64-packages

DISCONTINUED: Package overlay for OpenWRT 14.07 (Barrier Breaker) with x86_64 support
Makefile
1
star