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

add HDFS check using snakebite #551

Merged
merged 6 commits into from
Jul 5, 2013
Merged

add HDFS check using snakebite #551

merged 6 commits into from
Jul 5, 2013

Conversation

dcrosta
Copy link
Contributor

@dcrosta dcrosta commented Jun 22, 2013

snakebite is a direct client of the HDFS NameNode -- https://github.com/spotify/snakebite. Apache 2.0 License.

@@ -0,0 +1,46 @@
from checks import AgentCheck

import snakebite.client
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this import within the check method so it won't crash if the module is missing ?

Something like

try:
    import snakebite.client
except ImportError:
    raise Exception("Snake bite module is not installed. Please install it using easy install")

@dcrosta
Copy link
Contributor Author

dcrosta commented Jul 2, 2013

@remh updated pull request per your feedback.

self.gauge('hdfs.used', stats['used'])
self.gauge('hdfs.free', stats['remaining'])
self.gauge('hdfs.capacity', stats['capacity'])
self.gauge('hdfs.in_use', float(stats['used']) / float(stats['capacity']))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be surrounded by a try except to catch a possible ZeroDivisionError or the capacity will never be 0 ? (I don't really know hdfs)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do that if you like. It's very unlikely for the capacity (in bytes) to be 0 -- that would probably only happen if the hadoop cluster were seriously broken.

remh added a commit that referenced this pull request Jul 5, 2013
add HDFS check using snakebite
@remh remh merged commit c96d4fe into DataDog:master Jul 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants