Template for a basic Prometheus Exporter
Find a file Use this template
2024-07-11 09:57:48 +02:00
.woodpecker initial commit 2024-07-11 09:57:48 +02:00
cache initial commit 2024-07-11 09:57:48 +02:00
collector initial commit 2024-07-11 09:57:48 +02:00
helpers initial commit 2024-07-11 09:57:48 +02:00
models initial commit 2024-07-11 09:57:48 +02:00
.gitignore initial commit 2024-07-11 09:57:48 +02:00
CHANGELOG.md initial commit 2024-07-11 09:57:48 +02:00
CONTRIBUTING.md initial commit 2024-07-11 09:57:48 +02:00
docker-compose.yml initial commit 2024-07-11 09:57:48 +02:00
Dockerfile initial commit 2024-07-11 09:57:48 +02:00
go.mod initial commit 2024-07-11 09:57:48 +02:00
go.sum initial commit 2024-07-11 09:57:48 +02:00
LICENSE initial commit 2024-07-11 09:57:48 +02:00
main.go initial commit 2024-07-11 09:57:48 +02:00
MAINTAINERS.md initial commit 2024-07-11 09:57:48 +02:00
Makefile initial commit 2024-07-11 09:57:48 +02:00
README.md initial commit 2024-07-11 09:57:48 +02:00

Template Exporter

This repository is a template repository for @adoralaura. It's used to easily implement (small) Prometheus Exporters.

If you run into issues you may inform @adoralaura, but know that you use this template on your own risk!

Usage

Installation

Pre-built docker images can be found at Docker Hub. A sample docker-compose.yml can be found here.

Binaries can be built by cloning this repository and run go build main.go with Golang installed.

Running

Start template-exporter as a daemon or from CLI:

./template-exporter

Visit http://localhost:43609/metrics?target=203.0.113.8 where 203.0.113.8 is the IP of the NTP server you want to get the score from.

Prometheus Configuration

The URL parameter target can be controlled through relabelling.

Example config:

scrape_configs:
  - job_name: 'template'
    static_configs:
      - targets:
        - 203.0.113.8 # change this
        - 2003:db8::1 # change this
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 127.0.0.1:43609  # The template exporter's real hostname:port.

Similarly to blackbox_exporter, template-exporter is meant to run on a few central machines and can be thought of like a "Prometheus proxy".

TLS and basic authentication

The Template Exporter does not support TLS and basic authentication yet. This may be added in a future release.

Once you have it running

It can be opaque to get started with all this. To make it easier for others, please consider contributing back your configurations to us.

Contributing

If you have any ideas, enhancements, bug reports or general questions, please don't hesitate to create a new issue.

If you want to contribute to this project, please read the Contribution Guidelines

License

This project is available under the Apache License, Version 2.0. See the LICENSE file for more info.