DATADOG Library
The DATADOG Library is an importable library containing functions for working with Datadog's log APIs in Lua. The logs can be subsequently searched, monitored, and archived on Datadog. This library is used in the Datadog Sender and Datadog Heartbeat components.
On import, typically only the DATADOGclient module needs to be required in order to create the client and access the API methods.
require "DATADOG.DATADOGclient"
The DATADOG Library:
Use the Translator's built in help to review how to use each function:
DATADOGclient - sets up the adapter framework
Sets up the Datadog Adapter framework, adding the method modules to a metatable and storing the configurations from the custom fields in a table to call the API.
DATADOGcustom - makes API requests and returns the response
DATADOGcustom takes in any API requests and parameters to make the API call and return the response.
-
Uses the passed configurations API request parameters - the method (ex. post), Datadog API endpoint (ex. 'api/v2/logs') and parameters for the call (ex. the log message) - to build and carry out the appropriate HTTP request.
methods/DATADOGaggregateEvents - aggregate events into buckets and compute metrics and timeseries
DATADOGaggregateEvents prepares the arguments and calls DATADOGcustom to aggregate events in Datadog into buckets and compute metrics and timeseries via HTTP POST request.
methods/DATADOGsearchLogs - search Datadog logs using defined log search query parameters
DATADOGsearchLogs prepares the arguments and calls DATADOGcustom to search Datadog logs using defined log search query parameters via HTTP POST request.
methods/DATADOGsendLogs - send logs to Datadog
DATADOGsendLogs prepares the arguments and calls DATADOGcustom to send logs to Datadog via HTTP POST request.