Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 1.65 KB

README.md

File metadata and controls

58 lines (41 loc) · 1.65 KB

Graphite Exporter Ephemeral

This repo is a fork of the Prometheus Graphite Exporter with the following changes:

  • The ability to run the exporter in the "ephemeral" mode – the exporter will only serve the metrics once and then delete them.

Please find the original README in the repo above.

Usage

git apply patches/patches/delete-after-scrape.patch
make
./graphite_exporter

Configure existing monitoring to send Graphite plaintext data to port 9109 on UDP or TCP. As a simple demonstration:

# Send the metric
echo "test.tcp 10 $(date +%s)" | nc localhost 9109

# The metric is available
curl localhost:9108/metrics  | grep 'test_tcp 10' | wc -l
  1

# The metric is not available anymore
curl localhost:9108/metrics | grep 'test_tcp 10' | wc -l
  0

Metrics will be available on http://localhost:9108/metrics.

To avoid using unbounded memory, metrics will be garbage collected five minutes after they are last pushed to. This is configurable with the --graphite.sample-expiry flag.

Kubernetes Setup

Replace the image in k8s/graphite-exporter-deployment.yaml with your own image and run the following commands:

kubectl apply -f k8s/graphite-exporter-deployment.yaml
kubectl apply -f k8s/graphite-exporter-service.yaml

To get the IP of the service, run:

kubectl get pod -l app=graphite-exporter-ephemeral -o jsonpath='{.items[0].status.podIP}'
  10.252.1.256  # example output

Docker Setup

docker build -t graphite-exporter-ephemeral .
docker run -d -p 9108:9108 -p 9109:9109 -p 9109:9109/udp graphite-exporter-ephemeral