Giter Club home page Giter Club logo

telegraf-pgbouncer's Introduction

telegraph-pgbouncer

Poll pgBouncer for stats to submit to Telegraf using the Exec Input Plugin.

Version License

Usage

The application is meant to be used via the Exec Input Plugin

Example Telegraf Configuration

[[inputs.exec]]
  ## Commands array
  commands = [
    "telegraf-pgbouncer -h localhost -p 6432 -U monitor all"
  ]
  timeout = "5s"
  name_suffix = "_pgbouncer"
  data_format = "json"

CLI Usage

$ telegraf-pgbouncer --help
usage: pgBouncer Stats Collector for Telegraf

positional arguments:
  COMMAND               The SHOW command to run for extracting stats. Choices:
                        all, lists, databases, mem, pools, stats

optional arguments:
  -h HOST, --host HOST  database server host or socket directory (default: localhost)
  -p PORT, --port PORT  database server port number (default: 5432)
  -U USERNAME, --username USERNAME
                        The PostgreSQL username to operate as (default: pgbouncer)
  -W, --password        Force password prompt (should happen automatically)
                        (default: False)
  -v, --version         output version information, then exit
  -?, --help            show this help, then exit

Authentication

Specify the password in a .pgpass file for the application to connect properly without specifying a password.

telegraf-pgbouncer's People

Contributors

gmr avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

telegraf-pgbouncer's Issues

question on input

Thanks for your work on this. It looks cool. Got a question.

How does the input (like for stats) which is output as dictionary...end up in influxdb? I don't see where you are identifying a key as described in the JSON doc. I was assuming the output should be an array where tag_keys = ["database"] and then the output for stats is:

[
{"database": "test",
  "avg_query_count": 8,
   "avg_query_time": 3309
},
{"database": "another_db",
  "avg_query_count": 4,
   "avg_query_time": 809
}
]

and the telegraf.conf file would be something like:

[[inputs.exec]]
  commands = ["<command to output stats here>"]
  data_format = "json"
  name_override = "stats_pgbouncer"
  tag_keys = ["database"]
  timeout = "5s"

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.