|
|
|
@ -43,20 +43,23 @@ class CallTracer { |
|
|
|
|
// arguments.
|
|
|
|
|
virtual void RecordSendInitialMetadata( |
|
|
|
|
grpc_metadata_batch* send_initial_metadata, uint32_t flags) = 0; |
|
|
|
|
virtual void RecordOnDoneSendInitialMetadata(gpr_atm* peer_string) = 0; |
|
|
|
|
virtual void RecordOnDoneSendInitialMetadata() = 0; |
|
|
|
|
virtual void RecordSendTrailingMetadata( |
|
|
|
|
grpc_metadata_batch* send_trailing_metadata) = 0; |
|
|
|
|
virtual void RecordSendMessage(const ByteStream* send_message) = 0; |
|
|
|
|
virtual void RecordSendMessage(const ByteStream& send_message) = 0; |
|
|
|
|
// The `RecordReceivedxx()` methods should only be invoked when the
|
|
|
|
|
// metadata/message was successfully received, i.e., without any error.
|
|
|
|
|
// TODO(yashkt): We are using gpr_atm here instead of absl::string_view
|
|
|
|
|
// since that's what the transport API uses, and performing an atomic load
|
|
|
|
|
// is unnecessary if the census tracer does not need it at present. Fix this
|
|
|
|
|
// when the transport API changes.
|
|
|
|
|
virtual void RecordReceivedInitialMetadata( |
|
|
|
|
grpc_metadata_batch* recv_initial_metadata, uint32_t flags, |
|
|
|
|
gpr_atm* peer_string) = 0; |
|
|
|
|
virtual void RecordReceivedMessage(const ByteStream* recv_message) = 0; |
|
|
|
|
virtual void RecordReceivedMessage(const ByteStream& recv_message) = 0; |
|
|
|
|
virtual void RecordReceivedTrailingMetadata( |
|
|
|
|
grpc_metadata_batch* recv_trailing_metadata) = 0; |
|
|
|
|
virtual void RecordCancel(grpc_error_handle cancel_error) = 0; |
|
|
|
|
// Records annotations if supported by the attached tracer library, no-op
|
|
|
|
|
// otherwise.
|
|
|
|
|
virtual void RecordAnnotation(absl::string_view annotation) = 0; |
|
|
|
|
// Should be the last API call to the object. Once invoked, the tracer
|
|
|
|
|
// library is free to destroy the object.
|
|
|
|
|
virtual void RecordEnd(const grpc_call_final_info& final_info) = 0; |
|
|
|
@ -66,11 +69,12 @@ class CallTracer { |
|
|
|
|
|
|
|
|
|
// Records a new attempt for the associated call. \a transparent denotes
|
|
|
|
|
// whether the attempt is being made as a transparent retry or as a
|
|
|
|
|
// non-transparent retry/heding attempt.
|
|
|
|
|
virtual CallAttemptTracer* RecordNewAttempt(bool is_transparent_retry) = 0; |
|
|
|
|
// Records annotations if supported by the attached tracer library, no-op
|
|
|
|
|
// otherwise.
|
|
|
|
|
virtual void RecordAnnotation(absl::string_view annotation) = 0; |
|
|
|
|
// non-transparent retry/heding attempt. (There will be at least one attempt
|
|
|
|
|
// even if the call is not being retried.) The `CallTracer` object retains
|
|
|
|
|
// ownership to the newly created `CallAttemptTracer` object. RecordEnd()
|
|
|
|
|
// serves as an indication that the call stack is done with all API calls, and
|
|
|
|
|
// the tracer library is free to destroy it after that.
|
|
|
|
|
virtual CallAttemptTracer* StartNewAttempt(bool is_transparent_retry) = 0; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
} // namespace grpc_core
|
|
|
|
|