GithubHelp home page GithubHelp logo

samitpal / influxdb-router Goto Github PK

View Code? Open in Web Editor NEW
14.0 5.0 3.0 1.03 MB

An InfluxDB proxy for centralized organization level monitoring

License: MIT License

Go 99.02% Makefile 0.87% Dockerfile 0.11%

influxdb-router's Introduction

Metric flow with influxdb-router (Typical use case)

alt text

Installation

To install the binary:

Go to the releases page and select the appropriate binary for your platform.

To build from source follow the steps below:
Install glide from http://glide.sh/.

$ go get github.com/samitpal/influxdb-router/...

$ glide install

Switch to the git tag, e.g if you want to build version 1.0

$ git checkout 1.0

$ make influxdb-router

Sample config.toml

# You can configure multiple customers.
[[customers]]
  # name must be unique across customers
  name = "servicex"
  email = "[email protected]"
  # api key. Should be a long random string. This is the value of the telegraf header (default header name is 'Service-API-Key')
  api_key = "7ba4e75a"
  # Name of the influxdb database where the metrics for this customer should be stored.
  influx_db_name = "telegraf1"
  # Max number of batches that will be kept in-memory for each of the 'influx_hosts'. Beyind that batches with be dropped
  outgoing_queue_cap = 7000
  # Influxdb-routed maintains a retry queue for batches that it fails to send to InfluxDB backends.
  # retry_queue_cap is the max number of batches that can be kept in the retry queue (in-memory).
  retry_queue_cap = 10
  # list of InfluxDB hosts.
  influx_hosts = ["http://127.0.0.1:9086", "http://127.0.0.1:8086"]
  # The auth section needs to come at the end. This should be populated only if you enabled auth in influx-router
  # and set auth-mode to 'from-config'. Additionally you need to enable authentication by setting the 'auth-enabled' option
  # to the in the [http] section of the InfluxDB config. 
  [customers.auth]
      # influxdb user. Yo need to grant privilege to user 'user1' to database 'telegraf1'
      username = "user1"
      # influxdb password for user user1
      password = "password1"

Influxdb-router Usage

  1. Without InfluxDB authentication enabled.
$./influxdb-router -config_file config.toml -api-listen-http-port 8080 -listen-http-port 8090
  1. With the InfluxDB creds in config.toml and with InfluxDB authentication enabled in the backends.
$./influxdb-router -auth-enabled -auth-mode from-config -config_file config.toml -api-listen-http-port 8080 -listen-http-port 8090
  1. config.toml with the InfluxDB creds not in config but in env and with InfluxDB authentication enabled in the backends. You can set the creds in environment in the following format.
$ export username_<name> = "user1"
$ export password_<name> = "password1"
<name> is the 'Name' attribute in the toml.


$ ./influxdb-router -auth-enabled -auth-mode from-env -config_file config.toml -api-listen-http-port 8090 -listen-http-port 8080
  1. With SSL
$ ./influxdb-router -secure -config_file config.toml -api-listen-http-port 8080 -listen-https-port 8443 -ssl-server-cert <path to server cert> -ssl-server-key <path to server key>
  1. With SSL and with ssl client cert authentication enabled (telegraf needs to be configured with client certs)
$ ./influxdb-router -secure -ssl-client-cert-auth -config_file config.toml -api-listen-http-port 8080 -listen-https-port 8443 -ssl-ca-server-cert <path to CA cert> -ssl-server-cert <path to server cert> -ssl-server-key <path to server key>

Example client side config (telegraf configuration)

alt text

influxdb-router's People

Contributors

samitpal avatar

Stargazers

 avatar Lee Azzarello avatar Patrick avatar Sesha Sendhil S avatar Pysaoke avatar tinycolds avatar Santa avatar João Carlos Martins avatar  avatar Abdul Gaffar avatar  avatar Dong Mingxin avatar  avatar  avatar

Watchers

João Carlos Martins avatar James Cloos avatar Toni Moreno avatar Abdul Gaffar avatar  avatar

influxdb-router's Issues

Don't use the api key to construct internal metrics

Use the service name instead of the api key to construct internal InfluxDB-router metrics.

i.e

influx_router.<api_key>.outgoing_queue...

should be replaced by

influx_router.<service_name>.outgoing_queue...

Limit rps per customer

Some kind of throttling per customer perhaps leveraging the /debug/requests InfluxDB end point

Goreleaser version, date, commit should be supported

In other words when somebody types
$influxdb-router -version
the version, date, commit should be displayed. Right now the version and buildtime gets displayed but only if some one builds the binary using the make command

Makefile with old version

Please update Makefile to use the lastest version
INFLUXDB-ROUTER_VERSION := 0.1.2

change to
INFLUXDB-ROUTER_VERSION := 0.1.3

Question - Example use-case

Dear Samit,

I have looked at your router and I'm trying to figure out if this would allow us to use it for a specific use-case.

We collect stats for a whole range of customers centrally influx but have the option give customers access to their own data using grafana. We want to segregate data to give customers access to their own data AND still have access to all data from an admin view-point.

I'm correct that your influxdb-router, would allow the option define as a "in-between" gateway/proxy that acts as a "filter" while inserting and/or fetching influx data?

Example:

  • "Customer X" has access to influxdata with tags "customer x"?
  • "Customer Y" has access to influxdata with tags "customer x" & "customer y"
  • "Admin" has access to all influxdata

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.