Documentation ¶
Index ¶
Constants ¶
const ( // HTTPProtocol is the protocol that we receive logs over HTTPProtocol Protocol = "HTTP" // PlatformLog events originate from the Lambda Runtime PlatformLog LogType = "platform" // FunctionLog events originate from Lambda Functions FunctionLog LogType = "function" )
Variables ¶
This section is empty.
Functions ¶
func StartLogsReceiver ¶
func StartLogsReceiver(port int, client eventCreator)
StartLogsReceiver starts a small HTTP server on the specified port. The server receives log messages in AWS Lambda's Logs API message format (JSON array of messages) and the handler will send them to Honeycomb as events with the eventCreator provided as client.
When running in Lambda, the extension's subscription to log types will result in the Lambda Logs API publishing log messages to this receiver.
When running in localMode, the server will be started for manual posting of log messages to the specified port for testing.
Types ¶
type BufferingOptions ¶
type BufferingOptions struct { TimeoutMS uint `json:"timeoutMs"` MaxBytes uint64 `json:"maxBytes"` MaxItems uint64 `json:"maxItems"` }
BufferingOptions contains buffering configuration options for the lambda platform
type Client ¶
type Client struct { ExtensionID string // contains filtered or unexported fields }
Client is used to communicate with the Logs API
type Destination ¶
Destination is where the runtime should send logs to
type LogMessage ¶
type LogMessage struct { Type string `json:"type"` Time string `json:"time"` Record interface{} `json:"record"` }
LogMessage is a message sent from the Logs API
type LogType ¶
type LogType string
LogType represents the types of log messages that are supported by the logs API
type Protocol ¶
type Protocol string
Protocol represents the protocol that this extension should receive logs by
type SubscribeRequest ¶
type SubscribeRequest struct { Dest Destination `json:"destination"` Types []LogType `json:"types"` Buffering BufferingOptions `json:"buffering"` }
SubscribeRequest is the request to /logs
type SubscribeResponse ¶
type SubscribeResponse struct {
Message string
}
SubscribeResponse is the response from /logs subscribe message