From 2b52f3beec85432e2354ea25939f8954406fdf6e Mon Sep 17 00:00:00 2001 From: Dmitry Anoshin Date: Wed, 6 Mar 2024 14:36:10 -0800 Subject: [PATCH] [chore] [exporterhelper] Update notes for the experimental API --- exporter/exporterhelper/common.go | 2 +- exporter/exporterhelper/logs.go | 4 ++-- exporter/exporterhelper/metrics.go | 4 ++-- exporter/exporterhelper/request.go | 4 ++-- exporter/exporterhelper/traces.go | 4 ++-- exporter/exporterqueue/config.go | 6 +++--- exporter/exporterqueue/queue.go | 14 +++++++------- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/exporter/exporterhelper/common.go b/exporter/exporterhelper/common.go index 509570960e8..dc2070f36c3 100644 --- a/exporter/exporterhelper/common.go +++ b/exporter/exporterhelper/common.go @@ -110,7 +110,7 @@ func WithQueue(config QueueSettings) Option { // WithRequestQueue enables queueing for an exporter. // This option should be used with the new exporter helpers New[Traces|Metrics|Logs]RequestExporter. -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. func WithRequestQueue(cfg exporterqueue.Config, queueFactory exporterqueue.Factory[Request]) Option { return func(o *baseExporter) { diff --git a/exporter/exporterhelper/logs.go b/exporter/exporterhelper/logs.go index ce70230e321..30a73820f6d 100644 --- a/exporter/exporterhelper/logs.go +++ b/exporter/exporterhelper/logs.go @@ -87,7 +87,7 @@ func NewLogsExporter( } // RequestFromLogsFunc converts plog.Logs data into a user-defined request. -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. type RequestFromLogsFunc func(context.Context, plog.Logs) (Request, error) @@ -99,7 +99,7 @@ func requestFromLogs(pusher consumer.ConsumeLogsFunc) RequestFromLogsFunc { } // NewLogsRequestExporter creates new logs exporter based on custom LogsConverter and RequestSender. -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. func NewLogsRequestExporter( _ context.Context, diff --git a/exporter/exporterhelper/metrics.go b/exporter/exporterhelper/metrics.go index ab7d65dae65..596de71ae68 100644 --- a/exporter/exporterhelper/metrics.go +++ b/exporter/exporterhelper/metrics.go @@ -87,7 +87,7 @@ func NewMetricsExporter( } // RequestFromMetricsFunc converts pdata.Metrics into a user-defined request. -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. type RequestFromMetricsFunc func(context.Context, pmetric.Metrics) (Request, error) @@ -99,7 +99,7 @@ func requestFromMetrics(pusher consumer.ConsumeMetricsFunc) RequestFromMetricsFu } // NewMetricsRequestExporter creates a new metrics exporter based on a custom MetricsConverter and RequestSender. -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. func NewMetricsRequestExporter( _ context.Context, diff --git a/exporter/exporterhelper/request.go b/exporter/exporterhelper/request.go index 03276f9c19e..91d190f50a2 100644 --- a/exporter/exporterhelper/request.go +++ b/exporter/exporterhelper/request.go @@ -8,7 +8,7 @@ import ( ) // Request represents a single request that can be sent to an external endpoint. -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. type Request interface { // Export exports the request to an external endpoint. @@ -23,7 +23,7 @@ type Request interface { // temporary failures. For example, if some items failed to process and can be retried, this interface allows to // return a new Request that contains the items left to be sent. Otherwise, the original Request should be returned. // If not implemented, the original Request will be returned assuming the error is applied to the whole Request. -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. type RequestErrorHandler interface { Request diff --git a/exporter/exporterhelper/traces.go b/exporter/exporterhelper/traces.go index 778c0d63989..7c85ac6c536 100644 --- a/exporter/exporterhelper/traces.go +++ b/exporter/exporterhelper/traces.go @@ -87,7 +87,7 @@ func NewTracesExporter( } // RequestFromTracesFunc converts ptrace.Traces into a user-defined Request. -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. type RequestFromTracesFunc func(context.Context, ptrace.Traces) (Request, error) @@ -99,7 +99,7 @@ func requestFromTraces(pusher consumer.ConsumeTracesFunc) RequestFromTracesFunc } // NewTracesRequestExporter creates a new traces exporter based on a custom TracesConverter and RequestSender. -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. func NewTracesRequestExporter( _ context.Context, diff --git a/exporter/exporterqueue/config.go b/exporter/exporterqueue/config.go index ac888a0c227..fcc0e0e57b1 100644 --- a/exporter/exporterqueue/config.go +++ b/exporter/exporterqueue/config.go @@ -11,7 +11,7 @@ import ( // Config defines configuration for queueing requests before exporting. // It's supposed to be used with the new exporter helpers New[Traces|Metrics|Logs]RequestExporter. -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. type Config struct { // Enabled indicates whether to not enqueue batches before exporting. @@ -23,7 +23,7 @@ type Config struct { } // NewDefaultConfig returns the default Config. -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. func NewDefaultConfig() Config { return Config{ @@ -51,7 +51,7 @@ func (qCfg *Config) Validate() error { // The struct is provided to be added in the exporter configuration as one struct under the "sending_queue" key. // The exporter helper Go interface requires the fields to be provided separately to WithRequestQueue and // NewPersistentQueueFactory. -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. type PersistentQueueConfig struct { Config `mapstructure:",squash"` diff --git a/exporter/exporterqueue/queue.go b/exporter/exporterqueue/queue.go index 556dce9f9c2..d96bbd1455a 100644 --- a/exporter/exporterqueue/queue.go +++ b/exporter/exporterqueue/queue.go @@ -13,7 +13,7 @@ import ( // Queue defines a producer-consumer exchange which can be backed by e.g. the memory-based ring buffer queue // (boundedMemoryQueue) or via a disk-based queue (persistentQueue) -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. type Queue[T any] queue.Queue[T] @@ -24,22 +24,22 @@ type Settings struct { } // Marshaler is a function that can marshal a request into bytes. -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. type Marshaler[T any] func(T) ([]byte, error) // Unmarshaler is a function that can unmarshal bytes into a request. -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. type Unmarshaler[T any] func([]byte) (T, error) // Factory is a function that creates a new queue. -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. type Factory[T any] func(context.Context, Settings, Config) Queue[T] // NewMemoryQueueFactory returns a factory to create a new memory queue. -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. func NewMemoryQueueFactory[T itemsCounter]() Factory[T] { return func(_ context.Context, _ Settings, cfg Config) Queue[T] { @@ -51,7 +51,7 @@ func NewMemoryQueueFactory[T itemsCounter]() Factory[T] { } // PersistentQueueSettings defines developer settings for the persistent queue factory. -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. type PersistentQueueSettings[T any] struct { // Marshaler is used to serialize queue elements before storing them in the persistent storage. @@ -62,7 +62,7 @@ type PersistentQueueSettings[T any] struct { // NewPersistentQueueFactory returns a factory to create a new persistent queue. // If cfg.StorageID is nil then it falls back to memory queue. -// This API is at the early stage of development and may change without backward compatibility +// Experimental: This API is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. func NewPersistentQueueFactory[T itemsCounter](storageID *component.ID, factorySettings PersistentQueueSettings[T]) Factory[T] { if storageID == nil {