GithubHelp home page GithubHelp logo

oliver006 / rethinkdb_exporter Goto Github PK

View Code? Open in Web Editor NEW
43.0 3.0 23.0 1.62 MB

Prometheus exporter for RethinkDB cluster and table metrics. Supports RethinkDB 2.x

License: MIT License

Go 87.45% Dockerfile 4.03% Makefile 3.18% Mustache 5.35%
rethinkdb rethinkdb-exporter prometheus-exporter prometheus rethinkdb-cluster metrics go

rethinkdb_exporter's Introduction

RethinkDB Prometheus Metrics Exporter

Build Status Coverage Status

Prometheus exporter for RethinkDB cluster, server and table metrics.
Supports RethinkDB 2.x

Building and running

Locally build and run:

    $ git clone https://github.com/oliver006/rethinkdb_exporter.git
    $ cd rethinkdb_exporter
    $ go build
    $ ./rethinkdb_exporter <flags>

Or via docker:

    $ docker pull oliver006/rethinkdb_exporter
    $ docker run -d --name rethinkdb_exporter -p 9123:9123 oliver006/rethinkdb_exporter

Deploying

A Helm chart is included under helm/ for installing the rethinkdb_exporter on Kubernetes clusters. You'll need one of these per RethinkDB cluster you run.

Installing it is as simple as:

$ cd helm/rethinkdb-exporter
$ helm install \
    --name=rethinkdb-exporter-for-clustername  \
    --set=rethinkdb_exporter.dbaddr=my-rethinkdb-server:28015  \
    --set=rethinkdb_exporter.dbpass=mypassword  \
    --set=rethinkdb_exporter.clustername=myclustername  \
    .

Flags

Name Description
db.addr Address of one or more nodes of the cluster, comma separated.
db.auth Auth key of the RethinkDB cluster (for versions < 2.3)
db.user Username for RethinkDB connection (for versions >= 2.3) (must be admin if used; see below)
db.pass Password for RethinkDB connection (for versions >= 2.3)
db.count-rows Count rows per table, turn off if you experience perf. issues with large tables
db.table-stats Get stats for all tables.
clustername Name of the cluster, if set it's added as a label to the metrics.
namespace Namespace for the metrics, defaults to "rethinkdb".
web.listen-address Address to listen on for web interface and telemetry, default :9123
web.telemetry-path Path under which to expose metrics.

What's exported?

All entries from the stats table of the internal database rethinkdb are exported, see http://rethinkdb.com/docs/system-stats/ for details.
In addition, for every table there is a gauge with the number of items of said table.
Metric name is rethinkdb_table_items_total{db="...",table="..."} There are also total counters for numer of servers, tables and replicas as well as number of errors returned from the stats table.
Metric names are rethinkdb_cluster_[servers|server_errors|tables|replicas]_total

What does it look like?

Grafana dashboard is available here:
rethink_exporter_dashboard

v2.3+ Auth

In v2.3 RethinkDB moved to a username/password authentication system. For compatibility with this use the --db.user and --db.pass options.

It would be good to use a dedicated read-only user for this but the RethinkDB docs say "the jobs table can only be accessed by the admin user account". Thus you'll have to use --db.user=admin.

What else?

Things that can/should be added

  • status metrics per shard
  • ...

Open an issue or PR if you have more suggestions or ideas about what to add.

rethinkdb_exporter's People

Contributors

alexmbird avatar danielheckrath avatar klatys avatar mzehrer avatar oliver006 avatar tommilligan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rethinkdb_exporter's Issues

Passing flags to docker

Hey so I am having a new issue, first time using Docker and I am unable to find how do I pass flags to my Docker so it successfully connect to the database?

rethinkdb_exporter image on Docker Hub

Perhaps related to #8 - for my use case (deploying to a k8s cluster via a Helm chart) it would be valuable to have a standard Docker image for rethinkdb_exporter published on Docker Hub.

If you can create a namespace/repository for it I'll be happy to contribute the plumbing for releases.

Compile error with alpine 3.2

Hi,
I got the same error reported in the following link during building:

bosun-monitor/bosun#1360

Looks like you need go 1.5 to compile it properly but that's not available for alpine 3.2. Trying to use alpine:latest won't work due to a regression in go 1.7.

I solved by using alpine 3.3

Multi-stage Dockerfile

https://docs.docker.com/engine/userguide/eng-image/multistage-build/


FROM golang:1.7 as builder

MAINTAINER Oliver [email protected]

WORKDIR /go/src/github.com/oliver006/rethinkdb_exporter
ENV GOPATH /go
COPY . /go/src/github.com/oliver006/rethinkdb_exporter

RUN go get
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o rethinkdb_exporter .

FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /go/src/github.com/oliver006/rethinkdb_exporter/rethinkdb_exporter .
ENTRYPOINT ["./rethinkdb_exporter"]

scrape err: gorethink: dial tcp [::1]:28015: connectex: No connection could be made because the target machine actively refused it.

Follow the git instructions and everything looks okay.

  1. git clone the repo
  2. import the dashboard panel json in grafana
  3. add the data source using http://localhost:9123
  4. after go build, when running "rethinkdb_exporter db.table-stats"
    It gives the following error message and no data shows in the grafana dashboard. When checking the localhost:9123/metrics the table stats refreshed and looked okay. I am not sure how to fix this issue. any ideas? Thanks in advance. This example is pretty cool.
    image
    image
    image

Please don't count my rows

res, err := r.DB(s.DB).Table(s.Table).Count().Run(sess)

Counting table rows is a horrible idea, as it's currently not very optimized in RethinkDB and can take several seconds for larger tables. (1s for 4M rows on 3 nodes - and that's all only since we have it all cached in memory.)

This should be optional, and turned off by default.

err: gorethink: Wrong password

I'm trying to deploy rethinkdb_exporter to monitor a cluster created with the Helm stable/rethinkdb chart. I've got rethinkdb_exporter installed and running, but whenever it attempts to connect to my configured node(s) it logs the error scrape err: gorethink: Wrong password.

I've tried setting the --db.auth flag to my admin password, and blank, but it makes no difference.

I know the README.md says "Supports RethinkDB 2.x" but is it definitely known to work with 2.3.x? If so, what's the right way to extract from my cluster the value for --db.auth?

grafana detects no data

able to connect with rethinkdb successfully.
however grafana keeps updating the query at localhost:9123 and not capable to get the data under localhost:9123/metrics

for example, trying to get
rethinkdb_server_client_connections{server="db01"}

the response from query is the webpage at localhost:9123

how to resolve this? any ideas?
image

Grafana displays nothing

Hey, I did all the steps to install and added grafana dahsboard and nothing works.

I can acceed to localhost:9123, everything is displayed and works but I can not acceed to it on grafana, any solution ?

Thanks

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.