Skip to content

topi314/prometheus-exporters

Repository files navigation

Go Report Go Version License Version Docker Discord

prometheus-exporters

This repository contains a collection of random Prometheus exporters I use.

Installation

You can either run the exporters directly or use the provided Docker image.

Docker-Compose

services:
  http-exporter:
    image: ghcr.io/topi314/http-exporter:master
    container_name: http-exporter
    restart: unless-stopped
    volumes:
      - ./config.toml:/var/lib/http-exporter/config.toml
    ports:
      - "2112:2112"

Configuration

The exporters are configured via a TOML file. The default path is /var/lib/http-exporter/config.toml but you can change it with the --config flag.

[global]
scrape_interval = "1m"
scrape_timeout = "10s"

[log]
level = "info"
format = "text"
add_source = false

[server]
listen_addr = ":2112"
endpoint = "/metrics"

# Add your exporter configurations here
# [[configs]]
# name = "Bla"
# type = "http-temp"
# interval = "1m"
# timeout = "10s"
# [configs.options]

Exporters

HTTP Temperature Exporter

This exporter reads temperature data from a HTTP endpoint and exposes it as a Prometheus gauge metric.

Configuration

[[configs]]
name = "Bla"
type = "http-temp"
interval = "1m"
timeout = "10s"

[configs.options]
# The metric name, help text and labels
metric = { name = "bla_temp", help = "Temperature in celsius", labels = { name = "bla" } }

# The HTTP endpoint to fetch the data from
address = "hostname:port"
insecure = true
username = "user"
password = "password"

License

Shelly Exporter is licensed under the Apache License 2.0.

Contributing

Contributions are always welcome! Just open a pull request or discussion and I will take a look at it.

Contact