{"id":18866307,"url":"https://github.com/nordcloud/cfn-datadog","last_synced_at":"2025-04-14T14:31:05.391Z","repository":{"id":62561523,"uuid":"117558764","full_name":"nordcloud/cfn-datadog","owner":"nordcloud","description":"🐕⚙️Cloudformation custom resources that integrate with datadog","archived":false,"fork":false,"pushed_at":"2018-10-01T11:50:00.000Z","size":16,"stargazers_count":10,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T03:24:53.400Z","etag":null,"topics":["cloudformation","datadog","monitoring"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nordcloud.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-15T14:56:16.000Z","updated_at":"2021-11-11T15:45:04.000Z","dependencies_parsed_at":"2022-11-03T15:16:10.072Z","dependency_job_id":null,"html_url":"https://github.com/nordcloud/cfn-datadog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fcfn-datadog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fcfn-datadog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fcfn-datadog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fcfn-datadog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nordcloud","download_url":"https://codeload.github.com/nordcloud/cfn-datadog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647255,"owners_count":21139081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudformation","datadog","monitoring"],"created_at":"2024-11-08T05:06:13.248Z","updated_at":"2025-04-14T14:31:05.134Z","avatar_url":"https://github.com/nordcloud.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 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 and timeboard resource\non the datadog api\n\nhttps://docs.datadoghq.com/api/#monitors\nhttps://docs.datadoghq.com/api/#timeboards\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://github.com/nordcloud/cfn-encrypt to securely store\ndatadog api credentials\n\nThis repository makes use of [Troposphere](https://github.com/cloudtools/troposphere)\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 \u0026\u0026 ./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 \u003e /tmp/lambda.template\n~~~~\n* If you have not already set up your encrypt stack do that now ( https://github.com/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    Timeboard\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\n##### Example MetricAlert\n~~~~\nt.add_resource(MetricAlert(\n    'Alert2',\n    query=Join(\"\",[\"avg(last_1h):avg:system.net.bytes_rcvd{host:\",Ref(my_instance),\"} \u003c 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##### Example Timeboard\n\n~~~~\nt.add_resource(Timeboard(\n    'ExampleTimeBoard',\n    ServiceToken=ImportValue(Sub(\"${DatadogLambdaStackname}-TimeboardLambdaArn\")),\n    TimeboardTitle=\"testboard\",\n    description=\"Sample testboard\",\n    graphs=[Graph(\n        definition=Definition(\n            events=[],\n            requests=[Request(\n                q=\"avg:system.mem.free{*}\"\n            )],\n            viz=\"timeseries\"\n        ),\n        title=\"Average Memory Free\"\n    )],\n    template_variables=[TemplateVariable(\n        name=\"host1\",\n        prefix=\"host\",\n        default=\"host:my-host\"\n    )],\n    read_only=True\n))\n~~~~\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnordcloud%2Fcfn-datadog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnordcloud%2Fcfn-datadog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnordcloud%2Fcfn-datadog/lists"}