Code Monkey home page Code Monkey logo

putio-exporter's Introduction

putio-exporter

Prometheus Exporter for put.io account details.

This Prometheus Exporter will export metrics gathered about a user's put.io account, including disk space used/available. This is useful for monitoring disk availability over time.

๐Ÿ“š Background

Put.io is a cloud-based storage service that allows users to store and access their files from anywhere with an internet connection. This project is NOT affiliated with Put.io.

Metrics Gathered

Metric name Type Description
putio_up Gauge (1- yes, 0- no) Was the last metrics-gathering query to putio successful.
putio_account_active Gauge (1- yes, 0- no) Is the putio account being queried currently active.
putio_account_plan_expiration_date Gauge (timestamp) The unix time when the currently active putio plan expires.
putio_disk_available Gauge (bytes) The available disk space in the account (in bytes).
putio_disk_size Gauge (bytes) The total disk space, available and used, in the account (in bytes).
putio_simultaneous_download_limit Gauge (count) The maximum amount of downloads permitted by the account tier.
putio_transfers_by_status Gauge (count) The number of transfers by status type.

โ• The putio_transfers_by_status metric has a label ("type"), which can be of status ERROR, COMPLETED, or DOWNLOADING.

Running Locally

๐Ÿช„ docker-compose (recommended)

  1. In the docker-compose.yaml file, set PUTIO_OAUTH_TOKEN to your put.io OAUTH token.
  2. Run docker-compose up.

๐Ÿšข Docker

Steps:

$ docker build putio-exporter:latest # Build the docker image
$ docker run --env PUTIO_OAUTH_TOKEN=your-putio-oauth-token -p 9101:9101 putio-exporter:latest # Run the docker image

๐Ÿ”ง Manual Build

Requirements:

  • go (Created using go version go1.20.2 darwin/amd64)

Steps:

$ go build # Build the executable
$ ./putio-exporter # Run the executable

โš™๏ธ Configuration Options

Variable Command Line Flag Required Description
PUTIO_OAUTH_TOKEN --oauth-token Required The put.io OAUTH token created from your account.
PUTIO_EXPORTER_LISTEN_PORT --listen-port Optional (default 9101) The port at which the exporter listens for requests.
PUTIO_EXPORTER_METRICS_PATH --metrics-path Optional (default /metrics) The path at which the exporter serves the collected metrics.

There are three ways to pass in configuration options:

  • as environment variables (recommended)
  • in an .env file
  • as command-line arguments when using the executable directly
    • ./putio-exporter --metrics-path=9303 ...

๐Ÿš€ Contributing

All contributions are welcome. Please create a PR with a description of the proposed changes.

This software is distributed with the Apache 2.0 license.

putio-exporter's People

Contributors

alexanderldavis avatar renovate[bot] avatar

Watchers

 avatar

putio-exporter's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
docker-compose.yaml
dockerfile
Dockerfile
  • golang 1.22
github-actions
.github/actions/docker-image/action.yaml
  • docker/metadata-action v5
  • docker/setup-qemu-action v3
  • docker/setup-buildx-action v3
  • docker/login-action v3
  • docker/build-push-action v5
.github/actions/go-release/action.yaml
  • actions/setup-go v5
  • goreleaser/goreleaser-action v5
.github/workflows/build.yml
  • mathieudutour/github-tag-action v6.2
  • actions/checkout v4
.github/workflows/release.yml
  • actions/checkout v4
gomod
go.mod
  • go 1.20
  • github.com/joho/godotenv v1.5.1
  • github.com/prometheus/client_golang v1.19.0
  • github.com/putdotio/go-putio v1.7.1
  • golang.org/x/oauth2 v0.16.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.