Documentation
¶
Index ¶
Constants ¶
const ( SchemaVersion20220701 = "2022-07-01" SchemaVersionLatest = SchemaVersion20220701 )
Variables ¶
var Logger *logrus.Entry
Functions ¶
This section is empty.
Types ¶
type BufferingCfg ¶
type BufferingCfg struct { // Maximum number of log events to be buffered in memory. (default: 10000, minimum: 1000, maximum: 10000) MaxItems uint32 `json:"maxItems"` // Maximum size in bytes of the log events to be buffered in memory. (default: 262144, minimum: 262144, maximum: 1048576) MaxBytes uint32 `json:"maxBytes"` // Maximum time (in milliseconds) for a batch to be buffered. (default: 1000, minimum: 100, maximum: 30000) TimeoutMS uint32 `json:"timeoutMs"` }
Configuration for receiving telemetry from the Telemetry API. Telemetry will be sent to your listener when one of the conditions below is met.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
The client used for subscribing to the Telemetry API
type Destination ¶
type Destination struct { Protocol HttpProtocol `json:"protocol"` URI URI `json:"URI"` HttpMethod HttpMethod `json:"method"` Encoding HttpEncoding `json:"encoding"` }
Configuration for listeners that would like to receive telemetry via HTTP
type HttpEncoding ¶
type HttpEncoding string
Denotes what the content is encoded in
const (
JSON HttpEncoding = "JSON"
)
type HttpMethod ¶
type HttpMethod string
HttpMethod represents the HTTP method used to receive logs from Logs API
const ( // Receive log events via POST requests to the listener HttpPost HttpMethod = "POST" // Receive log events via PUT requests to the listener HttpPut HttpMethod = "PUT" )
type HttpProtocol ¶
type HttpProtocol string
Used to specify the protocol when subscribing to Telemetry API for HTTP
const (
HttpProto HttpProtocol = "HTTP"
)
type SchemaVersion ¶
type SchemaVersion string
type SubscribeRequest ¶
type SubscribeRequest struct { SchemaVersion SchemaVersion `json:"schemaVersion"` EventTypes []EventType `json:"types"` BufferingCfg BufferingCfg `json:"buffering"` Destination Destination `json:"destination"` }
Request body that is sent to the Telemetry API on subscribe
type SubscribeResponse ¶
type SubscribeResponse struct {
// contains filtered or unexported fields
}
Response body that is received from the Telemetry API on subscribe
type TelemetryApiListener ¶
type TelemetryApiListener struct { // LogEventsQueue is a synchronous queue and is used to put the received log events to be dispatched later LogEventsQueue *queue.Queue // contains filtered or unexported fields }
Used to listen to the Telemetry API
func NewTelemetryApiListener ¶
func NewTelemetryApiListener(isSAMLocal bool) *TelemetryApiListener
func (*TelemetryApiListener) Shutdown ¶
func (s *TelemetryApiListener) Shutdown()
Terminates the HTTP server listening for logs
func (*TelemetryApiListener) Start ¶
func (s *TelemetryApiListener) Start() (string, error)
Starts the server in a goroutine where the log events will be sent