| 1 | // Copyright The OpenTelemetry Authors |
| 2 | // SPDX-License-Identifier: Apache-2.0 |
| 3 | |
| 4 | package xconsumererror // import "go.opentelemetry.io/collector/consumer/consumererror/xconsumererror" |
| 5 | |
| 6 | import ( |
| 7 | "go.opentelemetry.io/collector/consumer/consumererror/internal" |
| 8 | "go.opentelemetry.io/collector/pdata/pprofile" |
| 9 | ) |
| 10 | |
| 11 | // Profiles is an error that may carry associated Profile data for a subset of received data |
| 12 | // that failed to be processed or sent. |
| 13 | type Profiles struct { |
| 14 | internal.Retryable[pprofile.Profiles] |
| 15 | } |
| 16 | |
| 17 | // NewProfiles creates a Profiles that can encapsulate received data that failed to be processed or sent. |
| 18 | func NewProfiles(err error, data pprofile.Profiles) error { |
| 19 | return Profiles{ |
| 20 | Retryable: internal.Retryable[pprofile.Profiles]{ |
| 21 | Err: err, |
| 22 | Value: data, |
| 23 | }, |
| 24 | } |
| 25 | } |