Giter Site home page Giter Site logo

gusto / aptible_datadog_postgres_monitor Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 2.0 14 KB

A docker container for Aptible containing the data dog agent to watch and provide metrics on Postgres instances.

License: Apache License 2.0

Shell 6.92% Python 93.08%

aptible_datadog_postgres_monitor's People

Contributors

alexevanczuk avatar

Stargazers

 avatar  avatar

Watchers

 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aptible_datadog_postgres_monitor's Issues

Disable default metric collection

There are a bunch of default metrics that the agent tries to collect that aren't relevant for collecting postgres metrics from Aptible. Many of these can apparently be turned off by removing the .default files in /etc/dd-agent/conf.d

For example:

root@deadbeef:/etc/dd-agent/conf.d# ls -l *.default
-rw-r--r-- 1 root root  525 Feb 13 19:30 agent_metrics.yaml.default
-rw-r--r-- 1 root root 2118 Feb 13 19:30 disk.yaml.default
-rw-r--r-- 1 root root  790 Feb 13 19:30 network.yaml.default
-rw-r--r-- 1 root root  329 Feb 13 19:30 ntp.yaml.default

Not a major concern, but just annoying to see irrelevant failures in the logs like:

IOError: [Errno 2] No such file or directory: '/host/proc/filesystems'

Look @ Flake8 and apply to entrypoint.py

Some things it will probably bring up:

  1. Remove re
  2. Make sure you understand where yaml is coming from (IIRC it's not a python stdlib thing)
  3. % should be replaced by .format
  4. don't need your own wrapper function for retrieving a key / value pair, see default values on .get:
>>> os.environ.get('BLASH_1', 'woof')
'woof'
  1. line 38 - can replace my_cond != None: with my_cond:
  2. Sort imports by alphabetically. Just doing alphabetically is fine for now. If you really want to be rigorous, https://github.com/PyCQA/flake8-import-order
  3. Use a if __name__ == '__main__': instead of just executing the script
  4. Should the shebang line be #!/usr/bin/env bash ? Dennis will be a better authority here

SSL mode hard-coded to false, prevents connection

I'm not sure if this is peculiar to the particular Postgres instances I'm looking at, but on my Aptible account, I cannot connect to the databases unless the ssl flag is set to true. The error I receive is:

InterfaceError: md5 password authentication failed

When I log into the built container (using something like aptible ssh) I can see configs are being properly written out to /etc/dd-agent/conf.d/postgres.yaml like:

- dbname: postgres
  host: db-blah-1234.aptible.in
  password: foo
  port: 12345
  ssl: false
  tags:
  - aptible_env:foo
  username: datadog

And when I test these configs, using python /opt/datadog-agent/agent/agent.py check postgres --profile in that container, I receive connection errors until I set the SSL flag to true (at which point everything works nicely again). It's currently hard-coded to false at

Perhaps Aptible have turned on SSL support for their database instances recently?

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.