class_docstr: Uses datadog API to send metrics of practically anything measurable.
  
  It's possible to track # of db records inserted/deleted, records read
  from file and many other useful metrics.
  
  Depends on the datadog API, which has to be deployed on the same server where
  Airflow runs.
  
  :param datadog_conn_id: The connection to datadog, containing metadata for api keys.
class_docstr_tok: ["Uses","datadog","API","to","send","metrics","of","practically","anything","measurable",".","It","'s","possible","to","track","#","of","db","records","inserted\/deleted",",","records","read","from","file","and","many","other","useful","metrics",".","Depends","on","the","datadog","API",",","which","has","to","be","deployed","on","the","same","server","where","Airflow","runs",".",":","param","datadog_conn_id",":","The","connection","to","datadog",",","containing","metadata","for","api","keys","."]
docstr: Post an event to datadog (processing finished, potentially alerts, other issues).
  
  Think about this as a means to maintain persistence of alerts, rather than alerting itself.
  
  :param title: The title of the event
  :param text: The body of the event (more information)
  :param aggregation_key: Key that can be used to aggregate this event in a stream
  :param alert_type: The alert type for the event, one of
      ["error", "warning", "info", "success"]
  :param date_happened: POSIX timestamp of the event; defaults to now
  :handle: User to post the event as; defaults to owner of the application key used
      to submit.
  :param handle: str
  :param priority: Priority to post the event as. ("normal" or "low", defaults to "normal")
  :param related_event_id: Post event as a child of the given event
  :param tags: List of tags to apply to the event
  :param device_name: device_name to post the event with
docstr_tok: ["Post","an","event","to","datadog","(","processing","finished",",","potentially","alerts",",","other","issues",")",".","Think","about","this","as","a","means","to","maintain","persistence","of","alerts",",","rather","than","alerting","itself",".",":","param","title",":","The","title","of","the","event",":","param","text",":","The","body","of","the","event","(","more","information",")",":","param","aggregation_key",":","Key","that","can","be","used","to","aggregate","this","event","in","a","stream",":","param","alert_type",":","The","alert","type","for","the","event",",","one","of","[","``","error","''",",","``","warning","''",",","``","info","''",",","``","success","''","]",":","param","date_happened",":","POSIX","timestamp","of","the","event",";","defaults","to","now",":","handle",":","User","to","post","the","event","as",";","defaults","to","owner","of","the","application","key","used","to","submit",".",":","param","handle",":","str",":","param","priority",":","Priority","to","post","the","event","as",".","(","``","normal","''","or","``","low","''",",","defaults","to","``","normal","''",")",":","param","related_event_id",":","Post","event","as","a","child","of","the","given","event",":","param","tags",":","List","of","tags","to","apply","to","the","event",":","param","device_name",":","device_name","to","post","the","event","with"]
code: def post_event(
      self,
      title: str,
      text: str,
      aggregation_key: str | None = None,
      alert_type: str | None = None,
      date_happened: int | None = None,
      handle: str | None = None,
      priority: str | None = None,
      related_event_id: int | None = None,
      tags: list[str] | None = None,
      device_name: list[str] | None = None,
  ) -> dict[str, Any]:
      """
      Post an event to datadog (processing finished, potentially alerts, other issues).
  
      Think about this as a means to maintain persistence of alerts, rather than alerting itself.
  
      :param title: The title of the event
      :param text: The body of the event (more information)
      :param aggregation_key: Key that can be used to aggregate this event in a stream
      :param alert_type: The alert type for the event, one of
          ["error", "warning", "info", "success"]
      :param date_happened: POSIX timestamp of the event; defaults to now
      :handle: User to post the event as; defaults to owner of the application key used
          to submit.
      :param handle: str
      :param priority: Priority to post the event as. ("normal" or "low", defaults to "normal")
      :param related_event_id: Post event as a child of the given event
      :param tags: List of tags to apply to the event
      :param device_name: device_name to post the event with
      """
      response = api.Event.create(
          title=title,
          text=text,
          aggregation_key=aggregation_key,
          alert_type=alert_type,
          date_happened=date_happened,
          handle=handle,
          priority=priority,
          related_event_id=related_event_id,
          tags=tags,
          host=self.host,
          device_name=device_name,
          source_type_name=self.source_type_name,
      )
  
      self.validate_response(response)
      return response
  
file_path: airflow/airflow/providers/datadog/hooks/datadog.py
imports: from __future__ import annotations
  import time
  from typing import Any
  from datadog import api, initialize
  from airflow.exceptions import AirflowException
  from airflow.hooks.base import BaseHook
  from airflow.utils.log.logging_mixin import LoggingMixin
label_desc: Use image node_id 5 for calling the DatadogHook obj's underlying member method code with example usage: obj.post_event(title, text, aggregation_key, alert_type, date_happened, handle, priority, related_event_id, tags, device_name) and returns: response