Skip to content

DazWilkin/fly-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prometheus Exporter for Fly.io

build-container Go Reference Go Report Card

  • ghcr.io/dazwilkin/fly-exporter:ce99aa13e42f25c31779e704f12e8a7088af824d

Container

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

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

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

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

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published