package internal
import "go.opentelemetry.io/otel/exporters/otlp/internal"
Package internal contains common functionality for all OTLP exporters.
Package internal contains common functionality for all OTLP exporters.
Index ¶
- func CleanPath(urlPath string, defaultPath string) string
- func GetUserAgentHeader() string
- func PartialSuccessToError(kind PartialSuccessDropKind, itemsRejected int64, errorMessage string) error
- type PartialSuccess
- type PartialSuccessDropKind
Functions ¶
func CleanPath ¶
CleanPath returns a path with all spaces trimmed and all redundancies removed. If urlPath is empty or cleaning it results in an empty string, defaultPath is returned instead.
func GetUserAgentHeader ¶
func GetUserAgentHeader() string
GetUserAgentHeader return an OTLP header value form "OTel OTLP Exporter Go/{{ .Version }}" https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#user-agent
func PartialSuccessToError ¶
func PartialSuccessToError(kind PartialSuccessDropKind, itemsRejected int64, errorMessage string) error
PartialSuccessToError produces an error suitable for passing to `otel.Handle()` out of the fields in a partial success response, independent of which signal produced the outcome.
Types ¶
type PartialSuccess ¶
type PartialSuccess struct { ErrorMessage string RejectedItems int64 RejectedKind PartialSuccessDropKind }
PartialSuccess represents the underlying error for all handling OTLP partial success messages. Use `errors.Is(err, PartialSuccess{})` to test whether an error passed to the OTel error handler belongs to this category.
func (PartialSuccess) Error ¶
func (ps PartialSuccess) Error() string
Error implements the error interface.
func (PartialSuccess) Is ¶
func (ps PartialSuccess) Is(err error) bool
Is supports the errors.Is() interface.
type PartialSuccessDropKind ¶
type PartialSuccessDropKind string
PartialSuccessDropKind indicates the kind of partial success error received by an OTLP exporter, which corresponds with the signal being exported.
const ( // TracingPartialSuccess indicates that some spans were rejected. TracingPartialSuccess PartialSuccessDropKind = "spans" // MetricsPartialSuccess indicates that some metric data points were rejected. MetricsPartialSuccess PartialSuccessDropKind = "metric data points" )
Source Files ¶
config.go header.go partialsuccess.go
Directories ¶
Path | Synopsis |
---|---|
exporters/otlp/internal/envconfig |
- Version
- v1.11.1
- Published
- Oct 19, 2022
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 5 seconds ago –
Tools for package owners.