| 1 | // Copyright The OpenTelemetry Authors |
| 2 | // SPDX-License-Identifier: Apache-2.0 |
| 3 | |
| 4 | package xexporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper/xexporterhelper" |
| 5 | |
| 6 | import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/request" // Request represents a single request that can be sent to an external endpoint. |
| 7 | |
| 8 | // Request represents a single request that can be sent to an external endpoint. |
| 9 | // Experimental: This API is at the early stage of development and may change without backward compatibility |
| 10 | // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. |
| 11 | type Request = request.Request |
| 12 | |
| 13 | // RequestErrorHandler is an optional interface that can be implemented by Request to provide a way handle partial |
| 14 | // temporary failures. For example, if some items failed to process and can be retried, this interface allows to |
| 15 | // return a new Request that contains the items left to be sent. Otherwise, the original Request should be returned. |
| 16 | // If not implemented, the original Request will be returned assuming the error is applied to the whole Request. |
| 17 | // Experimental: This API is at the early stage of development and may change without backward compatibility |
| 18 | // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. |
| 19 | type RequestErrorHandler = request.ErrorHandler |
| 20 | |
| 21 | // RequestConverterFunc converts pdata telemetry into a user-defined Request. |
| 22 | // Experimental: This API is at the early stage of development and may change without backward compatibility |
| 23 | // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. |
| 24 | type RequestConverterFunc[T any] = request.RequestConverterFunc[T] |
| 25 | |
| 26 | // RequestConsumeFunc processes the request. After the function returns, the request is no longer accessible, |
| 27 | // and accessing it is considered undefined behavior. |
| 28 | type RequestConsumeFunc = request.RequestConsumeFunc |