Documentation ¶
Index ¶
Constants ¶
const ( DefaultBatchWorkers = 1 DefaultBatchSize = 900 DefaultBatchTimeout = 60 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchConfigOption ¶
func BatchConfigQueueSize ¶
func BatchConfigQueueSize(size int) BatchConfigOption
BatchConfigQueueSize is how many logs to queue before sending to New Relic. If this limit is hit before the Timeout, the queue is flushed.
func BatchConfigTimeout ¶
func BatchConfigTimeout(seconds int) BatchConfigOption
BatchConfigTimeout is the maximum amount of time to queue logs before sending to New Relic. If this is reached before the Size limit, the queue is flushed.
func BatchConfigWorkers ¶
func BatchConfigWorkers(count int) BatchConfigOption
BatchConfigWorkers sets how many background workers will process logs as they are queued
type Logs ¶
type Logs struct {
// contains filtered or unexported fields
}
func (*Logs) BatchMode ¶
BatchMode enables the Logs client to accept, queue, and post Logs on behalf of the consuming application
func (*Logs) CreateLogEntry ¶
CreateLogEntry reports a log entry to New Relic. It's up to the caller to send a valid Log API payload, no checking done here
func (*Logs) EnqueueLogEntry ¶
EnqueueLogEntry handles the queueing. Only works in batch mode. If you wish to be able to avoid blocking forever until the log can be queued, provide a ctx with a deadline or timeout as this function will bail when ctx.Done() is closed and return and error.