fly-exporter

command module
v0.0.0-...-2f81b85 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

README

Prometheus Exporter for Fly.io

build-container Go Reference Go Report Card

  • ghcr.io/dazwilkin/fly-exporter:60be56d4c7ea6721a75aa698c3361c1df02d65bd

Container

TOKEN="[FLY-TOKEN]"
IMAGE="ghcr.io/dazwilkin/fly-exporter:60be56d4c7ea6721a75aa698c3361c1df02d65bd"

podman run \
--interactive --tty --rm \
--env=TOKEN=${TOKEN} \
--publish=8080:8080 \
${IMAGE} \
  --endpoint=0.0.0.0:8080

Metrics

curl http://localhost:8080/metrics

Yields:

# HELP build_info A metric with a constant '1' value labeled by OS version, Go version, and the Git commit of the exporter
# TYPE build_info counter
build_info{git_commit="897f2bbe476e834c9a3a0b53784c5d0360bfb5f9",go_version="go1.18.2",os_version="5.15.32-v8+"} 1
# HELP fly_exporter_app_info Info about Applications
# TYPE fly_exporter_app_info counter
fly_exporter_app_info{deployed="true",id="foo",name="foo",org_slug="personal",status="running"} 1
fly_exporter_app_info{deployed="true",id="foo",name="foo",org_slug="personal",status="running"} 1
# HELP fly_exporter_cert_info Info about Certificates
# TYPE fly_exporter_cert_info counter
fly_exporter_cert_info{app_id="foo",app_name="foo",status="Awaiting certificates"} 1
# HELP start_time Exporter start time in Unix epoch seconds
# TYPE start_time gauge
start_time 1.652975685e+09

Raspberry Pi

if [ "$(getconf LONG_BIT)" -eq 64 ]
then
  # 64-bit Raspian
  ARCH="GOARCH=arm64"
  TAG="arm64"
else
  # 32-bit Raspian
  ARCH="GOARCH=arm GOARM=7"
  TAG="arm32v7"
fi


IMAGE="ghcr.io/dazwilkin/fly-exporter:${TAG}"

podman build \
--build-arg=GOLANG_OPTIONS="CGO_ENABLED=0 GOOS=linux ${ARCH}" \
--build-arg=COMMIT=$(git rev-parse HEAD) \
--build-arg=VERSION=$(uname --kernel-release) \
--tag={IMAGE} \
--file=./Dockerfile \
.

Then:

POD="exporter"
IMAGE="ghcr.io/dazwilkin/fly-exporter:${TAG}"

podman run \
--detach --tty --rm \
--pod=${POD} \
--name=fly-exporter \
--env=TOKEN=${TOKEN} \
${IMAGE} \
  --endpoint=0.0.0.0:8080

Sigstore

fly-exporter container images are being signed by Sigstore and may be verified:

cosign verify \
--key=./cosign.pub \
ghcr.io/dazwilkin/fly-exporter:60be56d4c7ea6721a75aa698c3361c1df02d65bd

NOTE cosign.pub may be downloaded here

To install cosign:

go install github.com/sigstore/cosign/cmd/cosign@latest

Similar Exporters



Buy Me A Coffee

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL