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 ¶ added in v0.39.0
func BatchConfigQueueSize ¶ added in v0.39.0
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 ¶ added in v0.39.0
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 ¶ added in v0.39.0
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 ¶ added in v0.39.0
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 ¶ added in v0.39.0
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.