OpenTelemetryPartialSuccess Class
Collects the records rejected while handling an OTLP export request, so they can be reported back to the client through the OTLP partial_success response field.
public sealed class OpenTelemetryPartialSuccessRemarks
Samplers and handlers can call OpenTelemetryPartialSuccess.Reject to report that some records could not be accepted. Rejected records are aggregated across all samplers and handlers of a single request.
Calls made after the response has been sent are ignored. This happens when a trace is dispatched by OpenTelemetryTailSampler because the spans are buffered and dispatched after the originating request completed.
Constructors
| Name | Description |
|---|---|
| OpenTelemetryPartialSuccess() | Initializes an instance that collects rejected records. Handlers receive one from the receiver; this constructor exists so they can be unit tested. |
OpenTelemetryPartialSuccess()
OpenTelemetryPartialSuccess.csInitializes an instance that collects rejected records. Handlers receive one from the receiver; this constructor exists so they can be unit tested.
public OpenTelemetryPartialSuccess()Properties
| Name | Description |
|---|---|
| ErrorMessage | Gets the aggregated error message describing why records were rejected, or null when no message was reported. |
| RejectedCount | Gets the number of records rejected so far. |
ErrorMessage
OpenTelemetryPartialSuccess.csRejectedCount
OpenTelemetryPartialSuccess.csMethods
| Name | Description |
|---|---|
| Reject(long, string?) | Reports that count records were rejected. |
Reject(long, string?)
OpenTelemetryPartialSuccess.csReports that count records were rejected.
Parameters
countlong- The number of rejected records. Can be
0to report a warning without rejecting any record. errorMessagestring?- An optional human-readable message describing why the records were rejected.
Exceptions
ArgumentOutOfRangeExceptioncountis negative.