Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARNING | dd.collector | aggregator(aggregator.py:336) | Metric postgresql.commits has an interval of 0. Not flushing. #1211

Closed
ssbarnea opened this issue Nov 20, 2014 · 4 comments · Fixed by #1396
Labels
Milestone

Comments

@ssbarnea
Copy link

For some unclear reason datadog-agent is filling my logs with WARNING messages like these:

2014-11-20 13:38:19 GMT | WARNING | dd.collector | aggregator(aggregator.py:336) | Metric postgresql.commits has an interval of 0. Not flushing.
2014-11-20 13:38:19 GMT | WARNING | dd.collector | aggregator(aggregator.py:336) | Metric postgresql.rows_inserted has an interval of 0. Not flushing.
2014-11-20 13:38:19 GMT | WARNING | dd.collector | aggregator(aggregator.py:336) | Metric postgresql.rows_fetched has an interval of 0. Not flushing.
2014-11-20 13:38:19 GMT | WARNING | dd.collector | aggregator(aggregator.py:336) | Metric postgresql.rollbacks has an interval of 0. Not flushing.
2014-11-20 13:38:19 GMT | WARNING | dd.collector | aggregator(aggregator.py:336) | Metric postgresql.rows_updated has an interval of 0. Not flushing.
2014-11-20 13:38:19 GMT | WARNING | dd.collector | aggregator(aggregator.py:336) | Metric postgresql.rows_returned has an interval of 0. Not flushing.
2014-11-20 13:38:19 GMT | WARNING | dd.collector | aggregator(aggregator.py:336) | Metric postgresql.rows_fetched has an interval of 0. Not flushing.
2014-11-20 13:38:19 GMT | WARNING | dd.collector | aggregator(aggregator.py:336) | Metric postgresql.rows_deleted has an interval of 0. Not flushing.
2014-11-20 13:38:19 GMT | WARNING | dd.collector | aggregator(aggregator.py:336) | Metric postgresql.rollbacks has an interval of 0. Not flushing.
2014-11-20 13:38:19 GMT | WARNING | dd.collector | aggregator(aggregator.py:336) | Metric postgresql.rows_inserted has an interval of 0. Not flushing.
2014-11-20 13:38:19 GMT | WARNING | dd.collector | aggregator(aggregator.py:336) | Metric postgresql.commits has an interval of 0. Not flushing.
2014-11-20 13:38:19 GMT | WARNING | dd.collector | aggregator(aggregator.py:336) | Metric postgresql.rollbacks has an interval of 0. Not flushing.
2014-11-20 13:38:19 GMT | WARNING | dd.collector | aggregator(aggregator.py:336) | Metric postgresql.disk_read has an interval of 0. Not flushing.

The postgresql configuration is as simple as it can be:

init_config:

instances:
   -   host: localhost
       port: 5432
       username: confluence
       dbname: confluence
       password: xxx
   -   host: localhost
       port: 5432
       username: jira
       dbname: jira
       password: xxx
   -   host: localhost
       port: 5432
       username: crowd
       dbname: crowd
       password: xxx

Agent is version 5.0.5

@remh
Copy link
Contributor

remh commented Nov 20, 2014

Thanks for the feedback @ssbarnea .
This is indeed a bug when you are setting up multiple instances to the same server but to different databases.

However, if you don't need relation specific metrics (e.g. for a particular table) you shouldn't have to specify different instances to different tables.

By setting up just one instance you'll get the same exact metrics as if you were setting up an instance for each one of your database as we'll be querying "pg_stat_database" that will return metrics for all your database. (See: https://github.com/DataDog/dd-agent/blob/5.0.5/checks.d/postgres.py#L24-L28 )

So you should get rid of your last 2 instances in your postgres.yaml file and these warnings should go away and your metrics should get the proper values.

I agree that this behavior is not really clear and should be improved.
Thanks for pointing it to us!
Remi

@remh remh added this to the 5.2.0 milestone Nov 20, 2014
@remh remh added the bugfix label Nov 20, 2014
@remh
Copy link
Contributor

remh commented Jan 30, 2015

Adding this to triage for 5.3.0 release.

@ssbarnea
Copy link
Author

I need separate connections because I am counting the number of database connections for each of these databases. I do different limits for each of these databases and I need to know if I am running out of them.

@remh
Copy link
Contributor

remh commented Mar 25, 2015

@ssbarnea
We collect the number of connections to a database for each database, regardless if it's configured or not in the yaml file so you shouldn't configure the same host/port combination multiple times in the same yaml file if you don't want to use relation specific queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants