Datadog error


$ datadog-agent status | grep event
        Check event_example not found in Catalog
        unable to import module 'event_example': unexpected indent (, line 1)
    Traces: 0 payloads, 0 traces, 0 events, 0 bytes


Correct the indent of the python file as below;

file name –

from datadog_checks.base import AgentCheck

__version__ = "1.0.0"

class MyClass(AgentCheck):
        def check(self, instance):
                    "timestamp": time.time(),
                    "event_type": "Error",
                    "msg_title": "Example Event",
                    "msg_text": "This is an example event coming from Datadog.",
                    "alert_type": "error",

Another Error

    event_example (1.0.0)
      Instance ID: event_example:d884b5186b651429 [ERROR]
      Configuration Source: file:/etc/datadog-agent/conf.d/event_example.d/event_example.yaml
      Total Runs: 13
      Metric Samples: Last Run: 0, Total: 0
      Events: Last Run: 0, Total: 0
      Service Checks: Last Run: 0, Total: 0
      Average Execution Time : 4ms
      Last Execution Date : 2022-06-28 08:06:36 EDT / 2022-06-28 12:06:36 UTC (1656417996000)
      Last Successful Execution Date : Never
      Error: name 'time' is not defined
      Traceback (most recent call last):
        File "/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/base/checks/", line 1120, in run
        File "/etc/datadog-agent/checks.d/", line 9, in check
          "timestamp": time.time(),
      NameError: name 'time' is not defined