open-telemetry / otel-arrow

Protocol and libraries for sending and receiving OpenTelemetry data using Apache Arrow
Apache License 2.0
68 stars 13 forks source link

Use gRPC Status codes in the Arrow exporter #211

Closed jmacd closed 3 months ago

jmacd commented 3 months ago

Part of #210.

Mainly, changes the use of fmt.Errorf() and bare context.Context.Err() values, uses gRPC-Go's status.Errorf() to wrap the error with a code that gRPC and its consumers recognize. The code was out-of-line with the design of the top-level directory. Whereas the OTel-Arrow exporter had been inserting consumererror.NewPermanent() wrappers, it is the Exporter module which supports standard OTLP and Arrow one layer up that is responsible for permanent error labeling. Returning gRPC status errors is always preferred to fmt.Errorf in gRPC components.

Secondly, re-order and rename of the fields passed to the "arrow stream error" log statement, so that it matches the Reciever. This is used as the basis of a test for logging consistency and was otherwise an unintentional disagreement ("which" and "where").