Package codes.grow.packages.datadoglogs
Class DatadogLogEvent
java.lang.Object
codes.grow.packages.datadoglogs.DatadogLogEvent
One log event returned by the Datadog search API, flattened (
data[] of POST
/api/v2/logs/events/search). Immutable.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the custom attributes as returned (nested objects, for example{"dd":{"trace_id":"…"}}).host()Returns the reservedhost.id()Returns the Datadog log id.message()Returns the message text.service()Returns the reservedservice.status()Returns the reservedstatus.tags()Returns the tags.Returns the event time.Normalizes the event into a log record (seeDatadogLogMapping.eventToLogRecord(codes.grow.packages.datadoglogs.DatadogLogEvent)).toString()
-
Constructor Details
-
DatadogLogEvent
public DatadogLogEvent(String id, Instant timestamp, String host, String service, String status, String message, List<String> tags, Map<String, Object> attributes) Creates an event; collections are copied.- Parameters:
id- Datadog log idtimestamp- event time, may be nullhost- reservedhost, may be nullservice- reservedservice, may be nullstatus- reservedstatus, may be nullmessage- message texttags- tags such asenv:testattributes- custom attributes (data[].attributes.attributes), nested as returned
-
-
Method Details
-
id
Returns the Datadog log id.- Returns:
- the id (empty string when absent)
-
timestamp
Returns the event time.- Returns:
- the time, or empty when Datadog sent none
-
host
Returns the reservedhost.- Returns:
- the host, or empty
-
service
Returns the reservedservice.- Returns:
- the service, or empty
-
status
Returns the reservedstatus.- Returns:
- the status, or empty
-
message
Returns the message text.- Returns:
- the message
-
tags
Returns the tags.- Returns:
- immutable list
-
attributes
Returns the custom attributes as returned (nested objects, for example{"dd":{"trace_id":"…"}}).- Returns:
- immutable map
-
toLogRecord
Normalizes the event into a log record (seeDatadogLogMapping.eventToLogRecord(codes.grow.packages.datadoglogs.DatadogLogEvent)).- Returns:
- the record
-
toString
-