Documentation ¶
Overview ¶
Package receiver defines components that allows the collector to receive metrics, traces and logs.
Receiver receives data from a source (either from a remote source via network or scrapes from a local host) and pushes the data to the pipelines it is attached to by calling the nextConsumer.Consume*() function.
Error Handling ¶
The nextConsumer.Consume*() function may return an error to indicate that the data was not accepted. There are 2 types of possible errors: Permanent and non-Permanent. The receiver must check the type of the error using IsPermanent() helper.
If the error is Permanent, then the nextConsumer.Consume*() call should not be retried with the same data. This typically happens when the data cannot be serialized by the exporter that is attached to the pipeline or when the destination refuses the data because it cannot decode it. The receiver must indicate to the source from which it received the data that the received data was bad, if the receiving protocol allows to do that. In case of OTLP/HTTP for example, this means that HTTP 400 response is returned to the sender.
If the error is non-Permanent then the nextConsumer.Consume*() call may be retried with the same data. This may be done by the receiver itself, however typically it is done by the original sender, after the receiver returns a response to the sender indicating that the Collector is currently overloaded and the request must be retried. In case of OTLP/HTTP for example, this means that HTTP 429 or 503 response is returned.
Acknowledgment Handling ¶
The receivers that receive data via a network protocol that support acknowledgments MUST follow this order of operations:
- Receive data from some sender (typically from a network).
- Push received data to the pipeline by calling nextConsumer.Consume*() function.
- Acknowledge successful data receipt to the sender if Consume*() succeeded or return a failure to the sender if Consume*() returned an error.
This ensures there are strong delivery guarantees once the data is acknowledged by the Collector.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MakeFactoryMap = component.MakeReceiverFactoryMap //nolint:staticcheck
MakeFactoryMap takes a list of receiver factories and returns a map with factory type as keys. It returns a non-nil error when more than one factories have the same type.
var NewFactory = component.NewReceiverFactory //nolint:staticcheck
NewFactory returns a ReceiverFactory.
var WithLogs = component.WithLogsReceiver //nolint:staticcheck
WithLogs overrides the default "error not supported" implementation for CreateLogsReceiver and the default "undefined" stability level.
var WithMetrics = component.WithMetricsReceiver //nolint:staticcheck
WithMetrics overrides the default "error not supported" implementation for CreateMetricsReceiver and the default "undefined" stability level.
var WithTraces = component.WithTracesReceiver //nolint:staticcheck
WithTraces overrides the default "error not supported" implementation for CreateTracesReceiver and the default "undefined" stability level.
Functions ¶
This section is empty.
Types ¶
type CreateLogsFunc ¶
type CreateLogsFunc = component.CreateLogsReceiverFunc //nolint:staticcheck
CreateLogsReceiverFunc is the equivalent of ReceiverFactory.CreateLogsReceiver().
type CreateMetricsFunc ¶
type CreateMetricsFunc = component.CreateMetricsReceiverFunc //nolint:staticcheck
CreateMetricsFunc is the equivalent of ReceiverFactory.CreateMetricsReceiver().
type CreateSettings ¶
type CreateSettings = component.ReceiverCreateSettings //nolint:staticcheck
CreateSettings configures Receiver creators.
type CreateTracesFunc ¶
type CreateTracesFunc = component.CreateTracesReceiverFunc //nolint:staticcheck
CreateTracesFunc is the equivalent of ReceiverFactory.CreateTracesReceiver().
type Factory ¶
type Factory = component.ReceiverFactory //nolint:staticcheck
Factory is factory interface for receivers.
This interface cannot be directly implemented. Implementations must use the NewReceiverFactory to implement it.
type FactoryOption ¶
type FactoryOption = component.ReceiverFactoryOption //nolint:staticcheck
FactoryOption apply changes to ReceiverOptions.
type Logs ¶
type Logs = component.LogsReceiver //nolint:staticcheck
A LogsReceiver receives logs. Its purpose is to translate data from any format to the collector's internal logs data format. LogsReceiver feeds a consumer.Logs with data.
For example a LogsReceiver can read syslogs and convert them into plog.Logs.
type Metrics ¶
type Metrics = component.MetricsReceiver //nolint:staticcheck
A MetricsReceiver receives metrics. Its purpose is to translate data from any format to the collector's internal metrics format. MetricsReceiver feeds a consumer.Metrics with data.
For example it could be Prometheus data source which translates Prometheus metrics into pmetric.Metrics.
type Traces ¶
type Traces = component.TracesReceiver //nolint:staticcheck
A TracesReceiver receives traces. Its purpose is to translate data from any format to the collector's internal trace format. TracesReceiver feeds a consumer.Traces with data.
For example it could be Zipkin data source which translates Zipkin spans into ptrace.Traces.
Directories ¶
Path | Synopsis |
---|---|
nopreceiver
module
|
|
otlpreceiver
module
|
|
receiverprofiles
module
|
|
Package scrapererror provides custom error types for scrapers.
|
Package scrapererror provides custom error types for scrapers. |
Package scraperhelper provides utilities for scrapers.
|
Package scraperhelper provides utilities for scrapers. |
xreceiver
module
|