Categorygithub.com/linode-obs/ping_exporter
module
1.0.5
Repository: https://github.com/linode-obs/ping_exporter.git
Documentation: pkg.go.dev

# README

Prometheus Ping Exporter

Github Release Downloads license golangci-lint Go Report Card contributions

Yet another ping exporter.

Features:

This ping exporter is simple and fills a gap in the ping exporter market just by supporting the multi-target export pattern. No additional prober configuration is needed, as many other ping exporters require. A scrape job will take care of all configuration.

Parameters

Parameter NameDescriptionDefaultAcceptable Values
targetWhat to pingnoneAny hostname or IPv4/v6 address
timeoutHow long the entire ping job should run before returning10sAny time.Duration value
intervalHow long to wait between pings1sAny time.Duration value
countHow many pings to send5Any integer value
sizeThe size of the packet56Any integer value between 24 and 65507
TTLTTL of the packet64Any time.Duration value
protocol, protIPv4 or IPv61sv6, 6, ip6 (all other values considered to be IPv4)
packetUDP or ICMP (ICMP requires root in most cases)icmpicmp (all other values considered to be udp)

Metrics

/probe

Metric NameTypeDescription
ping_duration_secondsgaugeReturns how long the probe took to complete in seconds
ping_loss_ratiogaugePacket loss from 0 to 100
ping_rtt_avg_secondsgaugeMean round trip time
ping_rtt_max_secondsgaugeWorst round trip time
ping_rtt_min_secondsgaugeBest round trip time
ping_rtt_std_deviationgaugeStandard deviation
ping_successgaugeReturns whether the ping succeeded (if any packet returns this is successful)
ping_timeoutgaugeReturns whether the ping failed by timeout

/metrics

Standard Prometheus webserver metrics, plus ping_exporter_version_info.

Example Scrape Job

scrape_configs:
  - job_name: 'ping_exporter_metrics'
    scrape_interval: 15s
    scrape_timeout: 15s
    static_configs:
      - targets: ['0.0.0.0:9141']

  - job_name: 'prober'
    metrics_path: '/probe'
    scrape_interval: 15s
    scrape_timeout: 15s
    params:
      protocol: ['4']
      count: ['5']
      interval: ['1s']
    honor_labels: True
    static_configs:
    - targets:
      - google.com
      - linode.com
    relabel_configs:
    # Set the exporter's target
    - source_labels: [__address__]
      target_label: __param_target
    # Set address label to instance
    - source_labels: [__address__]
      target_label: instance
    # Actually talk to the blackbox exporter
    - target_label: __address__
      replacement: 0.0.0.0:9141
    # If we set a custom instance label, write it to the
    # expected instance label
    - source_labels: [__instance]
      target_label: instance
      regex: '(.+)'
      replacement: '${1}'

Installation

Debian/RPM package

Substitute {{ version }} for your desired release.

wget https://github.com/linode-obs/ping_exporter/releases/download/v{{ version }}/prometheus-ping-exporter_{{ version }}_linux_amd64.{deb,rpm}
{dpkg,rpm} -i prometheus-ping-exporter_{{ version }}_linux_amd64.{deb,rpm}

Docker

sudo docker run \
--privileged \
ghcr.io/linode-obs/ping_exporter

Binary

wget https://github.com/linode-obs/ping_exporter/releases/download/v{{ version }}/ping_exporter_{{ version }}_Linux_x86_64.tar.gz
tar xvf ping_exporter_{{ version }}_Linux_x86_64.tar.gz
./ping_exporter/prometheus-ping-exporter

Source

wget https://github.com/linode-obs/ping_exporter/archive/refs/tags/v{{ version }}.tar.gz
tar xvf ping_exporter-{{ version }}.tar.gz
cd ./ping_exporter-{{ version }}
go build ping_exporter.go
./ping_exporter.go

Other Ping Exporters

There are many other good ping exporters, please give them a look too:

Releasing

  1. Merge commits to main.
  2. Tag release git tag -a v1.0.X -m "message"
  3. git push origin v1.0.X
  4. goreleaser release

Contributors

Special thanks to stalloneclone for supplying the idea and initial code for the project!

# Packages

No description provided by the author
No description provided by the author