gusto / aptible_datadog_postgres_monitor Goto Github PK
View Code? Open in Web Editor NEWA docker container for Aptible containing the data dog agent to watch and provide metrics on Postgres instances.
License: Apache License 2.0
A docker container for Aptible containing the data dog agent to watch and provide metrics on Postgres instances.
License: Apache License 2.0
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'
Hi there "Gusto"!
I just have a question: when you booted up your container in Aptible, did the dd-agent report all the metrics as is seen here: https://datadog-prod.imgix.net/img/blog/postgresql-monitoring/postgresql-monitoring-dashboard-pt1v2.png?fit=max
I'm only seeing a small subset of these metrics being reported.
Any info and advice is greatly appreciated!
M
The dockerfile CMD
is only used if you're running the docker image locally not in interactive mode. Similarly, the postgres package isn't used in production. Might want to consider at some point having a Dockerfile.development
to reflect this.
Some things it will probably bring up:
re
yaml
is coming from (IIRC it's not a python stdlib thing)%
should be replaced by .format
.get
:>>> os.environ.get('BLASH_1', 'woof')
'woof'
my_cond != None:
with my_cond:
if __name__ == '__main__':
instead of just executing the script#!/usr/bin/env bash
? Dennis will be a better authority hereIf using 2.7, lock that in the dockerfile and call with it explicitly. if already explicitly version locked in root dockerfile, should be good to go.
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.