• This repository has been archived on 20/Sep/2022
  • Stars
    star
    99
  • Rank 343,315 (Top 7 %)
  • Language
    Go
  • License
    MIT License
  • Created about 9 years ago
  • Updated about 2 years ago

Reviews

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

Repository Details

Exposes Rancher metrics to Prometheus

prometheus-rancher-exporter

Exposes the health of Stacks / Services and Hosts from the Rancher API, to a Prometheus compatible endpoint.

!!!!This repository is now deprecated, feel free to fork.!!!

Description

The application can be run in a number of ways, the main consumption is the Docker hub image infinityworks/prometheus-rancher-exporter.

The application requires at a minimum, the URL of the Rancher API. If you have authentication enabled on your Rancher server, the application will require a RANCHER_ACCESS_KEY and a RANCHER_SECRET_KEY providing.

If you are running the application in a Rancher managed container, you can make use of Rancher labels to obtain an API key and auto-provision all of this information, details of this can be seen in the Docker Compose section.

If you are using this externally to Rancher, or without the use of the labels to obtain an API key, you can update these values yourself, using environment variables.

Required

  • CATTLE_URL // Either provisioned through labels, or set by the user. Should be in a format similar to http://<YOUR_IP>:8080/v2-beta.

Optional

  • CATTLE_ACCESS_KEY // Rancher API access Key, if supplied this will be used when authentication is enabled.
  • CATTLE_SECRET_KEY // Rancher API secret Key, if supplied this will be used when authentication is enabled.
  • METRICS_PATH // Path under which to expose metrics.
  • LISTEN_ADDRESS // Port on which to expose metrics.
  • HIDE_SYS // If set to true then this hides any of Ranchers internal system services from being shown. *If used, ensure false is encapsulated with quotes e.g. HIDE_SYS="false".
  • LABELS_FILTER // Optional regular expression for filtering service and host labels, defaults to ^io.prometheus.
  • LOG_LEVEL // Optional - Set the logging level, defaults to Info.
  • API_LIMIT // Optional - Rancher API resource limit (default: 100)

Compatibility

Along with the release of Rancher 1.2, a new API was introduced, the oppertunity was taken to re-write the exporter into Golang, so it's more comparible to the platforms it's interacting with. Testing has focused on the v1 and v2-beta available with Rancher 1.2. The v1 support should in theory work on older versions of Rancher Server but testing has been limited.

If you find any issues, bug reports or PR's are more than welcome.

Install and deploy

Run manually from Docker Hub:

docker run -d -e CATTLE_ACCESS_KEY="XXXXXXXX" -e CATTLE_SECRET_KEY="XXXXXXX" -e CATTLE_URL="http://<YOUR_IP>:8080/v2-beta" -p 9173:9173 infinityworks/prometheus-rancher-exporter

Build a docker image:

docker build -t <image-name> .
docker run -d -e CATTLE_ACCESS_KEY="XXXXXXXX" -e CATTLE_SECRET_KEY="XXXXXXX" -e CATTLE_URL="http://<YOUR_IP>:8080/v2-beta" -p 9173:9173 <image-name>

Docker compose

For users running the container within a Rancher managed environment:

prometheus-rancher-exporter:
    tty: true
    stdin_open: true
    labels:
      io.rancher.container.create_agent: true
      io.rancher.container.agent.role: environment
    expose:
      - 9173:9173
    image: infinityworks/prometheus-rancher-exporter:latest

For users running the container outside a Rancher managed environment:

prometheus-rancher-exporter:
    tty: true
    stdin_open: true
    environment:
      - CATTLE_ACCESS_KEY="xxxx"
      - CATTLE_SECRET_KEY="xxxxxx"
      - CATTLE_URL="http://<YOUR_IP>:8080/v2-beta"
      - HIDE_SYS=true
    expose:
      - 9173:9173
    image: infinityworks/prometheus-rancher-exporter:latest

Metrics

Metrics will be made available on port 9173 by default, or you can pass environment variable LISTEN_ADDRESS to override this. An example printout of the metrics you should expect to see can be found in METRICS.md.

Metadata

Go Report Card GoDoc

More Repositories

1

prometheus-example-queries

Simple place for people to provide examples of queries they've found useful.
857
star
2

github-exporter

:octocat: Prometheus exporter for github metrics
Go
343
star
3

Guide_Rancher_Monitoring

Easy to follow guide on how to deploy and make the best use of the Rancher community catalog template for Prometheus.
113
star
4

docker-hub-exporter

Prometheus exporter for the Docker Hub
Go
76
star
5

101-Sessions

Documentation and support material for IW 101 Sessions
JavaScript
52
star
6

hpilo-exporter

Prometheus HP iLO exporter
Python
47
star
7

snow-cannon

An infrastructure as code approach to deploying Snowflake using Terraform
HCL
23
star
8

gar-exporter

Google Analytics Reporting API V4
Python
16
star
9

music

A REST api demo project that generates sequence diagrams from tests
Go
13
star
10

moby-container-stats

Prometheus Exporter - container stats exposed directly from the moby stats API
Go
12
star
11

docker-cloud-exporter

Prometheus Exporter for Docker Cloud
Go
8
star
12

graf-db

Pre-Configured data container for Grafana dashboards based upon Prometheus & Rancher.
8
star
13

prom-conf

Prometheus config container
7
star
14

terraform-canary

HCL
7
star
15

data-academy-serverless-example

A repository to demonstrate a simple serverless repo for the data academy.
Shell
7
star
16

ranch-eye

Simple container stats using Rancher as the source.
6
star
17

serverless

Serverless Application Template
JavaScript
6
star
18

kubehack

Kubernetes Hack Night
5
star
19

iw-tech-test

Infinity Works Tech Test - Starter Projects
Java
4
star
20

academy-tech-test

Python
4
star
21

iw-tech-test-py

Infinity Works Tech Test - Python Starter Project
Python
4
star
22

iw-data-test-python

Infinity Works Data Test - Starter Project
Python
4
star
23

generation-academy-tech-test

A sample tech test repo for the Generation Data Academy
Python
4
star
24

data-academy-cloudformation-example

A repository to demonstrate a simple CloudFormation repo for the data academy.
Python
3
star
25

iw-tech-test-dotnet

Infinity Works Tech Test - Starter Projects for .NET Core
C#
3
star
26

iw-data-test-python-pandas

Python
3
star
27

iw-tech-test-terraform-azure

Technical test for Engineers using azure terraform
Shell
3
star
28

aws-decryption-go

Decrypt AWS Encryption SDK formatted blobs using a custom private key
Go
2
star
29

iw-tech-test-platform

Infinity Works Platform Tech Test
Makefile
2
star
30

autovault

This project generates a raw vault model from metadata
Python
2
star
31

iw-tech-test-snowflake

Python
2
star
32

sample-jenkins-pipeline-job

Java
2
star
33

Bamboo-api-exporter

Open source toolkit for exporting data via bambooHR's API
Python
2
star
34

pact-demo

An example repo that shows a consumer of an api and the provider of that API being integrated with a locally hosted Pact Broker.
TypeScript
2
star
35

rsgo

ReadySteadyGo
2
star
36

email-signature-generator

A simple email signature generator
HTML
2
star
37

node-app-base

Basic utilities for running node microservices
JavaScript
2
star
38

awscli-terraform-snowflake

A docker image containing awscli, terraform and snowflake
Dockerfile
2
star
39

snailx_api

SnailX external team API.
Python
1
star
40

snailx_dev_env

Development environment repo for SnailX external team.
Makefile
1
star
41

iw-tech-test-terraform

Dockerfile
1
star
42

spike-aws-batch

Go
1
star
43

javascript-academy-tech-test

HTML
1
star
44

iw-tech-test-nodejs

Infinity Works Node.js Engineering Tech Test
JavaScript
1
star
45

go-workshop-practical

Go
1
star
46

go-common

Some small common go libs and utils
Go
1
star
47

bamboo-contact-sheet

A quick and dirty way to create an office contact sheet from Bamboo HR
Python
1
star
48

aws-sso-google-sync

Populate AWS SSO directly with your G Suite users and groups using either a CLI or AWS Lambda
Go
1
star
49

amazon-connect-flow-sync

Automated syncing of contact flows between a local directory and an amazon connect instance
JavaScript
1
star