Documentation
¶
Overview ¶
Package http provides an HTTP destination for logs.
Index ¶
Constants ¶
const ( TextContentType = "text/plain" JSONContentType = "application/json" ProtobufContentType = "application/x-protobuf" )
ContentType options,
const (
NoTimeoutOverride = -1
)
NoTimeoutOverride is a special value that tells the httpClientFactory to use the logs_config.http_timeout setting. This should generally be used for all HTTP destinations barring special cases like the HTTP connectivity check.
Variables ¶
This section is empty.
Functions ¶
func CheckConnectivity ¶
func CheckConnectivity(endpoint config.Endpoint, cfg pkgconfigmodel.Reader) config.HTTPConnectivity
CheckConnectivity check if sending logs through HTTP works
func CheckConnectivityDiagnose ¶
func CheckConnectivityDiagnose(endpoint config.Endpoint, cfg pkgconfigmodel.Reader) (url string, err error)
CheckConnectivityDiagnose checks HTTP connectivity to an endpoint and returns the URL and any errors for diagnostic purposes
Types ¶
type Destination ¶
type Destination struct {
// contains filtered or unexported fields
}
Destination sends a payload over HTTP.
func NewDestination ¶
func NewDestination(endpoint config.Endpoint, contentType string, destinationsContext *client.DestinationsContext, shouldRetry bool, destMeta *client.DestinationMetadata, cfg pkgconfigmodel.Reader, minConcurrency int, maxConcurrency int, pipelineMonitor metrics.PipelineMonitor, instanceID string) *Destination
NewDestination returns a new Destination. minConcurrency denotes the minimum number of concurrent http requests the pipeline will allow at once. maxConcurrency represents the maximum number of concurrent http requests, reachable when the client is experiencing a large latency in sends. TODO: add support for SOCKS5
func (*Destination) IsMRF ¶ added in v0.54.0
func (d *Destination) IsMRF() bool
IsMRF indicates that this destination is a Multi-Region Failover destination.
func (*Destination) Metadata ¶ added in v0.61.0
func (d *Destination) Metadata() *client.DestinationMetadata
Metadata returns the metadata of the destination
func (*Destination) Start ¶
func (d *Destination) Start(input chan *message.Payload, output chan *message.Payload, isRetrying chan bool) (stopChan <-chan struct{})
Start starts reading the input channel
func (*Destination) Target ¶
func (d *Destination) Target() string
Target is the address of the destination.
type SyncDestination ¶ added in v0.56.0
type SyncDestination struct {
// contains filtered or unexported fields
}
SyncDestination sends a payload over HTTP and does not retry. In Serverless, the retry and backoff logic is handled by the serverless flush strategy
func NewSyncDestination ¶ added in v0.56.0
func NewSyncDestination( endpoint config.Endpoint, contentType string, destinationsContext *client.DestinationsContext, senderDoneChan chan *sync.WaitGroup, destMeta *client.DestinationMetadata, cfg pkgconfigmodel.Reader, ) *SyncDestination
NewSyncDestination returns a new synchronous Destination.
func (*SyncDestination) IsMRF ¶ added in v0.56.0
func (d *SyncDestination) IsMRF() bool
IsMRF indicates that this destination is a Multi-Region Failover destination.
func (*SyncDestination) Metadata ¶ added in v0.61.0
func (d *SyncDestination) Metadata() *client.DestinationMetadata
Metadata returns the metadata of the destination
func (*SyncDestination) Start ¶ added in v0.56.0
func (d *SyncDestination) Start(input chan *message.Payload, output chan *message.Payload, _ chan bool) (stopChan <-chan struct{})
Start starts reading the input channel
func (*SyncDestination) Target ¶ added in v0.56.0
func (d *SyncDestination) Target() string
Target is the address of the destination.