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

[postgres] Always sent OK status, even with cached connection. #1273

Merged
merged 3 commits into from
Jan 2, 2015

Conversation

conorbranagan
Copy link
Contributor

We were incorrectly only sending an OK status when a connection was
first established. This means any monitors on this check would be in
a NODATA state after the first run of the check.

Now we'll send an OK once we have a working connection, even if the
connection had to be reset.

Also adds a message to the service check :)

We were incorrectly only sending an OK status when a connection was
first established. This means any monitors on this check would be in
a NODATA state after the first run of the check.

Now we'll send an OK once we have a working connection, even if the
connection had to be reset.
@remh
Copy link
Contributor

remh commented Dec 31, 2014

According to the test

Traceback (most recent call last):
  File "/home/travis/build/DataDog/dd-agent/checks/__init__.py", line 543, in run
    self.check(copy.deepcopy(instance))
  File "/home/travis/build/DataDog/dd-agent/checks.d/postgres.py", line 410, in check
    self.service_check(self.SERVICE_CHECK_NAME, AgentCheck.OK,
AttributeError: 'PostgreSql' object has no attribute 'SERVICE_CHECK_NAME'

Can you fix ? Otherwise it looks good!

@LeoCavaille LeoCavaille changed the title Always sent OK status with Postgres check, even with cached connection. [postgres] Always sent OK status, even with cached connection. Dec 31, 2014
@conorbranagan
Copy link
Contributor Author

Should be good to go now, @remh. Thanks for the review!

@LeoCavaille LeoCavaille added this to the 5.2.0 milestone Dec 31, 2014
LeoCavaille added a commit that referenced this pull request Jan 2, 2015
[postgres] Always sent OK status, even with cached connection.
@LeoCavaille LeoCavaille merged commit 9e89aaf into master Jan 2, 2015
@LeoCavaille LeoCavaille deleted the conor/pg-service-check branch January 2, 2015 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants