{ "info": { "author": "Martin Kaberg", "author_email": "martin.kaberg@nordcloud.com", "bugtrack_url": null, "classifiers": [], "description": "# README #\n\n\n\n### What is this repository for? ###\n\n* To setup datadog monitoring via cloudformation\n\n### What does it do? ###\n\nIt setups a lambda function that communicate with the monitors resource\non the datadog api\n\nhttps://docs.datadoghq.com/api/#monitors\n\nThe lambda is invoked via cloudformation custom resource. This repo\nsupplies custom resource classes for all the 4 Monitor types.\nCustom resources have the same exact data structure as the DD api\n\nIt uses https://bitbucket.org/nordcloud/cfn_encrypt to securely store\ndatadog api credentials\n\n### How do I get set up? ###\n\n* clone this repo\n~~~~\ngit clone git@github.com.org:nordcloud/cfn-datadog.git\n~~~~\n\n* Build the lambda package\n~~~~\nchmod +x create_zip.sh && ./create_zip.sh\n~~~~\n\n* upload `datadog_lambda.zip` to an s3 bucket\n* get your api and application keys from Datadog\n* generate the lambda template\n~~~~\npython lambda-template.py > /tmp/lambda.template\n~~~~\n* If you have not already set up your encrypt stack do that now ( https://bitbucket.org/nordcloud/cfn_encrypt )\n* create a stack from your `lambda.template` file\n* The lambda is now set up and ready to use.\n\n\n### How do i use it to monitor resources created in other stacks? ###\n\nInstall the cfn_datadog library\n~~~~\npip install cfn-encrypt\n~~~~\n\nImport the custom resource classes you want to use\n~~~~\nfrom cfn_datadog import (\n MetricAlert, MetricAlertOptions, Composite, CompositeOptions,\n EventAlert, EvenAlertOptions, ServiceCheck, ServiceCheckOptions\n)\n~~~~\n\nAdd a parameter so that you can reference your lambda stack\n~~~~\ndatadog_lambda_stackname = t.add_parameter(Parameter(\n \"DatadogLambdaStackname\",\n Type=\"String\",\n Description=\"Datadog lambda stackname\",\n))\n~~~~\n\nAdd the custom resource to the template: For documentation see datadog api\n~~~~\nt.add_resource(MetricAlert(\n 'Alert2',\n query=Join(\"\",[\"avg(last_1h):avg:system.net.bytes_rcvd{host:\",Ref(my_instance),\"} < 40\"]),\n ServiceToken=ImportValue(\n Sub(\"${DatadogLambdaStackname}-LambdaArn\")),\n name=\"Bytes received on mytesthost\",\n message=\"Some Message @MyDDHandle\",\n tags=[\"tag1\", \"tag2\"],\n options=MetricAlertOptions(\n notify_no_data= True,\n no_data_timeframe=50\n )\n))\n~~~~\n\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nordcloud/cfn-datadog", "keywords": "", "license": "Apache Common 2.0", "maintainer": "", "maintainer_email": "", "name": "cfn-datadog", "package_url": "https://pypi.org/project/cfn-datadog/", "platform": "", "project_url": "https://pypi.org/project/cfn-datadog/", "project_urls": { "Homepage": "https://github.com/nordcloud/cfn-datadog" }, "release_url": "https://pypi.org/project/cfn-datadog/0.0.12/", "requires_dist": [ "awacs (>=0.7.0)", "boto3 (>=1.4.6)", "cfn-encrypt (>=0.0.10)", "cfn-response (>=0.0.4)", "datadog (>=0.16.0)", "troposphere (>=1.9.5)" ], "requires_python": "", "summary": "Lambda cloudformation custom resource that sets up datadog alerts", "version": "0.0.12" }, "last_serial": 3537918, "releases": { "0.0.10": [ { "comment_text": "", "digests": { "md5": "aa2fe53bfb0e0a717814d67f7c2b6551", "sha256": "b16b96f8f8f7cd2d7729209514ccc10ce31272ca773f016ed082a65250005e53" }, "downloads": -1, "filename": "cfn_datadog-0.0.10-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "aa2fe53bfb0e0a717814d67f7c2b6551", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4535, "upload_time": "2018-01-15T14:50:48", "url": "https://files.pythonhosted.org/packages/0a/23/bd64924487415502a9ea5c635a669989c2543f0c15714de21802bfe70dc2/cfn_datadog-0.0.10-py2.py3-none-any.whl" } ], "0.0.11": [ { "comment_text": "", "digests": { "md5": "fb3aa9c0815da6cce68dd02bd8310236", "sha256": "bdcf0f710405c2302ccbad8a671d59b28480b84e2c29ee9a93362e9d08ed624a" }, "downloads": -1, "filename": "cfn_datadog-0.0.11-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "fb3aa9c0815da6cce68dd02bd8310236", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8071, "upload_time": "2018-01-16T13:40:48", "url": "https://files.pythonhosted.org/packages/ea/38/6f6e05d00d27e596ae4b1669b0e2129785b5c9832dc96e41f60343023a4d/cfn_datadog-0.0.11-py2.py3-none-any.whl" } ], "0.0.12": [ { "comment_text": "", "digests": { "md5": "11a794bdebe3260dc9a93a373f59db71", "sha256": "eccb26f028f3b3179146d947c792dc286f6ac841b2c6fc27f74d3ec7492f6c98" }, "downloads": -1, "filename": "cfn_datadog-0.0.12-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "11a794bdebe3260dc9a93a373f59db71", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8070, "upload_time": "2018-01-31T10:14:30", "url": "https://files.pythonhosted.org/packages/81/6b/7ea054a635617034530f22bcce11ba3e61914807d37ba8242ca9379403a2/cfn_datadog-0.0.12-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "11a794bdebe3260dc9a93a373f59db71", "sha256": "eccb26f028f3b3179146d947c792dc286f6ac841b2c6fc27f74d3ec7492f6c98" }, "downloads": -1, "filename": "cfn_datadog-0.0.12-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "11a794bdebe3260dc9a93a373f59db71", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8070, "upload_time": "2018-01-31T10:14:30", "url": "https://files.pythonhosted.org/packages/81/6b/7ea054a635617034530f22bcce11ba3e61914807d37ba8242ca9379403a2/cfn_datadog-0.0.12-py2.py3-none-any.whl" } ] }