Documentation ¶
Index ¶
- Constants
- Variables
- func StatusToSeverity(status string) []byte
- type Lambda
- type Message
- func NewMessage(content []byte, origin *Origin, status string, ingestionTimestamp int64) *Message
- func NewMessageFromLambda(content []byte, origin *Origin, status string, utcTime time.Time, ...) *Message
- func NewMessageWithSource(content []byte, status string, source *logsconfig.LogSource, ...) *Message
- type Origin
- func (o *Origin) Service() string
- func (o *Origin) SetService(service string)
- func (o *Origin) SetSource(source string)
- func (o *Origin) SetTags(tags []string)
- func (o *Origin) Source() string
- func (o *Origin) Tags() []string
- func (o *Origin) TagsPayload() []byte
- func (o *Origin) TagsToJsonString() string
- func (o *Origin) TagsToString() string
Constants ¶
const ( StatusEmergency = "emergency" StatusAlert = "alert" StatusCritical = "critical" StatusError = "error" StatusWarning = "warn" StatusNotice = "notice" StatusInfo = "info" StatusDebug = "debug" )
Status values
Variables ¶
var ( SevEmergency = []byte("<40>") SevAlert = []byte("<41>") SevCritical = []byte("<42>") SevError = []byte("<43>") SevWarning = []byte("<44>") SevNotice = []byte("<45>") SevInfo = []byte("<46>") SevDebug = []byte("<47>") )
Syslog severity levels
Functions ¶
func StatusToSeverity ¶
StatusToSeverity transforms a severity into a status.
Types ¶
type Lambda ¶
Lambda is a struct storing information about the Lambda function and function execution.
type Message ¶
type Message struct { Content []byte Origin *Origin IngestionTimestamp int64 // Optional. Must be UTC. If not provided, time.Now().UTC() will be used // Used in the Serverless Agent Timestamp time.Time // Optional. // Used in the Serverless Agent Lambda *Lambda // contains filtered or unexported fields }
Message represents a log line sent to datadog, with its metadata
func NewMessage ¶
NewMessage constructs message with content, status, origin and the ingestion timestamp.
func NewMessageFromLambda ¶
func NewMessageFromLambda(content []byte, origin *Origin, status string, utcTime time.Time, ARN, reqID string, ingestionTimestamp int64) *Message
NewMessageFromLambda construts a message with content, status, origin and with the given timestamp and Lambda metadata
func NewMessageWithSource ¶
func NewMessageWithSource(content []byte, status string, source *logsconfig.LogSource, ingestionTimestamp int64) *Message
NewMessageWithSource constructs message with content, status and log source.
func (*Message) GetHostname ¶
GetHostname returns the hostname to applied the given log message
func (*Message) GetLatency ¶
GetLatency returns the latency delta from ingestion time until now
type Origin ¶
type Origin struct { Identifier string LogSource *logsconfig.LogSource Offset string // contains filtered or unexported fields }
Origin represents the Origin of a message
func NewOrigin ¶
func NewOrigin(source *logsconfig.LogSource) *Origin
NewOrigin returns a new Origin
func (*Origin) Service ¶
Service returns the service of the configuration if set or the service of the message, if none are defined, returns an empty string by default.
func (*Origin) SetService ¶
SetService sets the service of the origin.
func (*Origin) Source ¶
Source returns the source of the configuration if set or the source of the message, if none are defined, returns an empty string by default.
func (*Origin) TagsPayload ¶
TagsPayload returns the raw tag payload of the origin.
func (*Origin) TagsToJsonString ¶
func (*Origin) TagsToString ¶
TagsToString encodes tags to a single string, in a comma separated format