{"id":9811,"date":"2022-06-28T12:00:17","date_gmt":"2022-06-28T12:00:17","guid":{"rendered":"https:\/\/www.scmgalaxy.com\/tutorials\/?p=9811"},"modified":"2022-06-28T12:09:53","modified_gmt":"2022-06-28T12:09:53","slug":"datadog-error","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/datadog-error\/","title":{"rendered":"Datadog error"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Error<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>$ datadog-agent status | grep event\r\n    event_example\r\n        Check event_example not found in Catalog\r\n        unable to import module 'event_example': unexpected indent (event_example.py, line 1)\r\n    Traces: 0 payloads, 0 traces, 0 events, 0 bytes\r\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Solution<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Correct the indent of the python file as below;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">file name &#8211; event_example.py<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from datadog_checks.base import AgentCheck\r\n\r\n__version__ = \"1.0.0\"\r\n\r\nclass MyClass(AgentCheck):\r\n        def check(self, instance):\r\n                self.event(\r\n                {\r\n                    \"timestamp\": time.time(),\r\n                    \"event_type\": \"Error\",\r\n                    \"msg_title\": \"Example Event\",\r\n                    \"msg_text\": \"This is an example event coming from Datadog.\",\r\n                    \"alert_type\": \"error\",\r\n                }\r\n            )\r\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Another Error<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>    event_example (1.0.0)\r\n    ---------------------\r\n      Instance ID: event_example:d884b5186b651429 &#91;ERROR]\r\n      Configuration Source: file:\/etc\/datadog-agent\/conf.d\/event_example.d\/event_example.yaml\r\n      Total Runs: 13\r\n      Metric Samples: Last Run: 0, Total: 0\r\n      Events: Last Run: 0, Total: 0\r\n      Service Checks: Last Run: 0, Total: 0\r\n      Average Execution Time : 4ms\r\n      Last Execution Date : 2022-06-28 08:06:36 EDT \/ 2022-06-28 12:06:36 UTC (1656417996000)\r\n      Last Successful Execution Date : Never\r\n      Error: name 'time' is not defined\r\n      Traceback (most recent call last):\r\n        File \"\/opt\/datadog-agent\/embedded\/lib\/python3.8\/site-packages\/datadog_checks\/base\/checks\/base.py\", line 1120, in run\r\n          self.check(instance)\r\n        File \"\/etc\/datadog-agent\/checks.d\/event_example.py\", line 9, in check\r\n          \"timestamp\": time.time(),\r\n      NameError: name 'time' is not defined\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Error Solution Correct the indent of the python file as below; file name &#8211; event_example.py Another Error<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9811","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Datadog error - scmGalaxy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.scmgalaxy.com\/tutorials\/datadog-error\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Datadog error - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"Error Solution Correct the indent of the python file as below; file name &#8211; event_example.py Another Error\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/datadog-error\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-28T12:00:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-28T12:09:53+00:00\" \/>\n<meta name=\"author\" content=\"rajeshkumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"rajeshkumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/datadog-error\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/datadog-error\\\/\"},\"author\":{\"name\":\"rajeshkumar\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/a40e0dd38feee7c2779460a804d49361\"},\"headline\":\"Datadog error\",\"datePublished\":\"2022-06-28T12:00:17+00:00\",\"dateModified\":\"2022-06-28T12:09:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/datadog-error\\\/\"},\"wordCount\":21,\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/datadog-error\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/datadog-error\\\/\",\"name\":\"Datadog error - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"datePublished\":\"2022-06-28T12:00:17+00:00\",\"dateModified\":\"2022-06-28T12:09:53+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/a40e0dd38feee7c2779460a804d49361\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/datadog-error\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/datadog-error\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/datadog-error\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Datadog error\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/a40e0dd38feee7c2779460a804d49361\",\"name\":\"rajeshkumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g\",\"caption\":\"rajeshkumar\"},\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/rajeshkumar\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Datadog error - scmGalaxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.scmgalaxy.com\/tutorials\/datadog-error\/","og_locale":"en_US","og_type":"article","og_title":"Datadog error - scmGalaxy","og_description":"Error Solution Correct the indent of the python file as below; file name &#8211; event_example.py Another Error","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/datadog-error\/","og_site_name":"scmGalaxy","article_published_time":"2022-06-28T12:00:17+00:00","article_modified_time":"2022-06-28T12:09:53+00:00","author":"rajeshkumar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"rajeshkumar","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/datadog-error\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/datadog-error\/"},"author":{"name":"rajeshkumar","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/a40e0dd38feee7c2779460a804d49361"},"headline":"Datadog error","datePublished":"2022-06-28T12:00:17+00:00","dateModified":"2022-06-28T12:09:53+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/datadog-error\/"},"wordCount":21,"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/datadog-error\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/datadog-error\/","name":"Datadog error - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"datePublished":"2022-06-28T12:00:17+00:00","dateModified":"2022-06-28T12:09:53+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/a40e0dd38feee7c2779460a804d49361"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/datadog-error\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/datadog-error\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/datadog-error\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Datadog error"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/a40e0dd38feee7c2779460a804d49361","name":"rajeshkumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g","caption":"rajeshkumar"},"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/rajeshkumar\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/9811","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=9811"}],"version-history":[{"count":3,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/9811\/revisions"}],"predecessor-version":[{"id":9815,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/9811\/revisions\/9815"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=9811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=9811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=9811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}