Skip to content

felipegfalcao/gocache-prometheus-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

felipegfalcao/gocache-prometheus-exporter

A GoCache API Exporter for Prometheus.


Table of Contents

  1. Introduction
  2. Usage
  3. Contributing
  4. License

Introduction

The gocache_exporter is a simple server that removes the GoCache API to obtain domain access statistics and exports them via HTTP for consumption by Prometheus.

First I would like to share with everyone that this was my first code using GO. I believe this will definitely not be the best code you will see. But it was the only alternative to capture metrics from the GoCache platform. I decided to publish this repository not only because I lack knowledge in the language but to be able to use the strength of a community to improve this code. I count on everyone's help.

Usage

The first step is to grab an API key from the GoCache site. Metrics are captured based on this doc. GoCache Api.

Important: Be advised to set a high scrape interval (e.g. 5min). Each scrape performs a direct API call and to frequent requests can lead to the deauthorization of your API key!

Note: Since gocache isn't a very handy word, the metric namespace is gocache.

Installation

TODO: The easiest way to run the gocache is by grabbing the latest binary from the [release page][release].

Building from source
git clone https://github.com/felipegfalcao/gocache-prometheus-exporter
cd gocache-prometheus-exporter
go build .

Using the application

./gocache-prometheus-exporter [flags]

Example ARGS "REQUIRED":

./gocache-prometheus-exporter -domain <DOMAIN> -token <token_GoCache>

At the moment we can pass another -host argument that allows filtering by subdomain. The value must be the complete subdomain (ex: www.yourdomain.com)

./gocache-prometheus-exporter -domain <DOMAIN> -token <TOKEN_GoCache> -host <host>

###We are currently with a fixed value in the range of capturing latest value

Contributing

Feel free to submit PRs or to fill Issues. Every kind of help is appreciated.

License

Distributed under Apache License (Apache License, Version 2.0).

See LICENSE for more information.