From 5b004ba32c4e477707b58442c0d8909f57d084c0 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 22 Nov 2022 16:25:10 -0800 Subject: [PATCH] Remove deprecated func/types from component (#6606) Signed-off-by: Bogdan Drutu Signed-off-by: Bogdan Drutu --- .chloggen/rmdepcomp.yaml | 11 +++++++++++ component/component.go | 3 --- component/exporter.go | 3 --- component/processor.go | 3 --- component/receiver.go | 41 ---------------------------------------- receiver/doc.go | 39 ++++++++++++++++++++++++++++++++++++-- 6 files changed, 48 insertions(+), 52 deletions(-) create mode 100755 .chloggen/rmdepcomp.yaml diff --git a/.chloggen/rmdepcomp.yaml b/.chloggen/rmdepcomp.yaml new file mode 100755 index 00000000000..1492d6f41dc --- /dev/null +++ b/.chloggen/rmdepcomp.yaml @@ -0,0 +1,11 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: component + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Remove deprecated func/types from component + +# One or more tracking issues or pull requests related to the change +issues: [6606] diff --git a/component/component.go b/component/component.go index e651f56595f..06fc2be9387 100644 --- a/component/component.go +++ b/component/component.go @@ -122,9 +122,6 @@ const ( StabilityLevelStable ) -// Deprecated: [0.65.0] Use StabilityLevelDevelopment instead. -const StabilityLevelInDevelopment = StabilityLevelDevelopment - func (sl StabilityLevel) String() string { switch sl { case StabilityLevelUndefined: diff --git a/component/exporter.go b/component/exporter.go index 01fc3fc1e07..acc6078260f 100644 --- a/component/exporter.go +++ b/component/exporter.go @@ -34,9 +34,6 @@ func UnmarshalExporterConfig(conf *confmap.Conf, cfg ExporterConfig) error { return unmarshal(conf, cfg) } -// Deprecated: [v0.65.0] unnecessary interface, will be removed. -type Exporter = Component - // TracesExporter is an Exporter that can consume traces. type TracesExporter interface { Component diff --git a/component/processor.go b/component/processor.go index 7c8e878fb5b..a7512246dea 100644 --- a/component/processor.go +++ b/component/processor.go @@ -34,9 +34,6 @@ func UnmarshalProcessorConfig(conf *confmap.Conf, cfg ProcessorConfig) error { return unmarshal(conf, cfg) } -// Deprecated: [v0.65.0] unnecessary interface, will be removed. -type Processor = Component - // TracesProcessor is a processor that can consume traces. type TracesProcessor interface { Component diff --git a/component/receiver.go b/component/receiver.go index 874823d25e4..914b89aeb5b 100644 --- a/component/receiver.go +++ b/component/receiver.go @@ -34,47 +34,6 @@ func UnmarshalReceiverConfig(conf *confmap.Conf, cfg ReceiverConfig) error { return unmarshal(conf, cfg) } -// Receiver 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. -// Deprecated: [v0.65.0] unnecessary interface, will be removed. -type Receiver = Component - // 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. diff --git a/receiver/doc.go b/receiver/doc.go index 86ff181ebff..37c230eab9d 100644 --- a/receiver/doc.go +++ b/receiver/doc.go @@ -12,7 +12,42 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package receiver contains implementations of Receiver components. +// Package receiver defines components that allows the collector to receive metrics, traces and logs. // -// A receiver must be added as a default component to be included in the collector. +// 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. package receiver // import "go.opentelemetry.io/collector/receiver"