• Stars
    star
    132
  • Rank 274,205 (Top 6 %)
  • Language
    Go
  • License
    MIT License
  • Created over 7 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Prometheus exporter for DigitalOcean metrics, written in Go.

DigitalOcean Exporter Build Status

Docker Pulls Go Report Card

Prometheus exporter for various metrics about your DigitalOcean droplets, volumes, snapshots & networks and much more, written in Go.

Installation

For pre-built binaries please take a look at the releases.
https://github.com/metalmatze/digitalocean_exporter/releases

To deploy directly onto digitalocean, click the button below.
Deploy to DO

Docker

docker pull metalmatze/digitalocean_exporter:0.6.1
docker run --rm -p 9212:9212 -e DIGITALOCEAN_TOKEN=XXX metalmatze/digitalocean_exporter:0.6.1

Example docker-compose.yml with Transmission also running in docker.

digitalocean_exporter:
    image: metalmatze/digitalocean_exporter:0.6.1
    environment:
    - '-do.token=XXX'
    restart: always
    ports:
    - "127.0.0.1:9212:9212"

Configuration

ENV Variable Description
DEBUG If set to true also debug information will be logged, otherwise only info
DIGITALOCEAN_TOKEN Token for API access
DIGITALOCEAN_SPACES_ACCESS_KEY_ID Spaces Access Key ID to list buckets
DIGITALOCEAN_SPACES_ACCESS_KEY_SECRET Spaces Access Key Secret to list buckets
HTTP_TIMEOUT Timeout for the godo client, default: 5000ms
WEB_ADDR Address for this exporter to run, default: :9212
WEB_PATH Path for metrics, default: /metrics

You can get an API token at: https://cloud.digitalocean.com/settings/api/tokens
Read-only tokens are sufficient.

Metrics

Name Type Cardinality Help
digitalocean_account_active gauge 1 The status of your account
digitalocean_account_balance gauge 1 Current balance of your most recent billing activity
digitalocean_account_droplet_limit gauge 1 The maximum number of droplet you can use
digitalocean_account_floating_ip_limit gauge 1 The maximum number of floating ips you can use
digitalocean_account_verified gauge 1 1 if your email address was verified
digitalocean_app gauge 5 A metric with a constant '1' value labeled by app id, name, tier, region, and app phase("BUILDING", "DEPLOYING", "ACTIVE", "SUPERSEDED")
digitalocean_balance_generated_at gauge 1 The time at which balances were most recently generated
digitalocean_build_info gauge 1 A metric with a constant '1' value labeled by version, revision, and branch from which the node_exporter was built.
digitalocean_database_status gauge 9 The status of the database, 1 if online, 0 otherwise
digitalocean_database_nodes gauge 9 The number of nodes in a database cluster
digitalocean_domain_record_port gauge 7 The port for SRV records
digitalocean_domain_record_priority gauge 7 The priority for SRV and MX records
digitalocean_domain_record_weight gauge 7 The weight for SRV records
digitalocean_domain_ttl_seconds gauge 1 Seconds that clients can cache queried information before a refresh should be requested
digitalocean_droplet_cpus gauge 4 Droplet's number of CPUs
digitalocean_droplet_disk_bytes gauge 4 Droplet's disk in bytes
digitalocean_droplet_memory_bytes gauge 4 Droplet's memory in bytes
digitalocean_droplet_price_hourly gauge 4 Price of the Droplet billed hourly in dollars
digitalocean_droplet_price_monthly gauge 4 Price of the Droplet billed monthly in dollars
digitalocean_droplet_up gauge 4 If 1 the droplet is up and running, 0 otherwise
digitalocean_floating_ipv4_active gauge 1 If 1 the floating ip used by a droplet, 0 otherwise
digitalocean_incidents gauge 1 Number of active regional incidents associated with digitalocean services
digitalocean_incidents_total gauge 0 Number of active total incidents associated with digitalocean services
digitalocean_key gauge 1 Information about keys in your digitalocean account
digitalocean_loadbalancer_droplets gauge 1 The number of droplets this load balancer is proxying to
digitalocean_loadbalancer_status gauge 1 The status of the load balancer, 1 if active
digitalocean_month_to_date_balance gauge 1 Balance as of the digitalocean_balance_generated_at time
digitalocean_month_to_date_usage gauge 1 Amount used in the current billing period as of the digitalocean_balance_generated_at time
digitalocean_snapshot_min_disk_size_bytes gauge 2 Minimum disk size for a droplet/volume to run this snapshot on in bytes
digitalocean_snapshot_size_bytes gauge 2 Snapshot's size in bytes
digitalocean_spaces_bucket gauge 2 Spaces bucket, will always be 1. Includes name and region labels
digitalocean_spaces_bucket_created gauge 2 Spaces bucket creation timestamp in unix epoch format. Includes name and region labels
digitalocean_start_time gauge 1 Unix timestamp of the start time
digitalocean_volume_size_bytes gauge 11 Volume's size in bytes

Alerts & Recording Rules

As example alerts and recording rules I have copied my .rules file to this repository.
Please check example.rules.yaml.

Development

You obviously should get the code

go get -u github.com/metalmatze/digitalocean_exporter

This should already put a binary called digitalocean_exporter into $GOPATH/bin.

Make sure you copy the .env.example to .env and change this one to your preferences.

Now during development I always run:

make install && digitalocean_exporter

Use make install which uses go install in the background to build faster during development.

More Repositories

1

alertmanager-bot

[deprecated] Bot for Prometheus' Alertmanager
Go
658
star
2

slo-libsonnet

Generate Prometheus alerting & recording rules and Grafana dashboards for your SLOs.
Jsonnet
120
star
3

transmission-exporter

Prometheus exporter for Transmission metrics, written in Go.
Go
96
star
4

prom-metric-viewer

Browse Prometheus metrics of apps and exporters more quickly.
Go
53
star
5

promtools.dev

Generate SLOs for Prometheus via HTTP with Jsonnet
JavaScript
39
star
6

kube-cockroachdb

Deploy CockroachDB on Kubernetes using YAML or an Operator
Go
28
star
7

awesome-jsonnet

A curated list of awesome Jsonnet projects and mixins
28
star
8

godep.org

Packages for Go - unofficial experimental next generation godoc.org
Go
20
star
9

loki-kube-prometheus

Grafana's Loki integrated with kube-prometheus monitoring stack
Jsonnet
16
star
10

krautreporter

[DEPRECATED] This is an android app for krautreporter.de with Material Design
Java
16
star
11

laravel-html-cachebusting

Extends laravel's HtmlBuilder with styleBust() & scriptBust() which insert the file's md5 to the url.
PHP
16
star
12

slo-dashboard

SLO dashboards scraping Prometheus for application performance
Go
14
star
13

githubql_exporter

Prometheus exporter for various metrics about your GitHub repositories, written in Go using GraphQL.
Go
8
star
14

archsecure

Check your machine for issues posted on https://security.archlinux.org
Go
7
star
15

drone-cron

Use cronjobs to trigger drone CI builds
Go
6
star
16

codeigniter-german

CodeIgniter german language translation
PHP
6
star
17

signal

Loosely coupled helper library for Observability Signals
Go
3
star
18

i3bargo

My simple i3bar status implementation written in Go.
Go
2
star
19

drone-kubectl

Go
1
star
20

cubbyhole

A TCP server for interacting with a cubbyhole
Go
1
star