diff --git a/.kitchen.yml b/.kitchen.yml index 0a942e1f..2c39ab64 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -57,3 +57,13 @@ suites: datadog: api_key: somethingnotnil application_key: alsonotnil +- name: mongo + run_list: ["recipe[datadog::dd-handler]", "recipe[datadog::dd-agent]", "recipe[datadog::mongo]"] + attributes: + datadog: + api_key: somethingnotnil + application_key: alsonotnil + mongo: + instances: + - host: localhost + port: 27017 diff --git a/recipes/mongo.rb b/recipes/mongo.rb index 52115520..203eb462 100644 --- a/recipes/mongo.rb +++ b/recipes/mongo.rb @@ -1,5 +1,18 @@ include_recipe "datadog::dd-agent" +# Monitor mongo +# +# node.set['datadog']['mongo']['instances'] = [ +# { +# 'host' => 'localhost', +# 'port' => '27017' +# } +# ] + +package "python-setuptools" + +easy_install_package "pymongo" + datadog_monitor "mongo" do instances node["datadog"]["mongo"]["instances"] end diff --git a/test/integration/mongo/bats/pymongo_installed.bats b/test/integration/mongo/bats/pymongo_installed.bats new file mode 100644 index 00000000..053c3d45 --- /dev/null +++ b/test/integration/mongo/bats/pymongo_installed.bats @@ -0,0 +1,4 @@ +@test "pymongo is installed and imports ok" { + run python -c "import pymongo" + [ "$status" -eq 0 ] +}