grpc-go icon indicating copy to clipboard operation
grpc-go copied to clipboard

stats: document server-side stats event ordering and add tests

Open aranjans opened this issue 3 months ago • 6 comments

Description

Currently, the ordering of server-side stats events is not explicitly documented in the stats.Handler interface, nor verified through tests. This can lead to confusion for users implementing stats handlers, as seen in [link-to-user-question-if-available].

The current server-side stats event ordering is:

  1. InHeader (when processing incoming headers)
  2. Begin (when starting RPC processing)
  3. [message events during RPC]
  4. End (when RPC completes)

Proposed Changes

  1. Update the stats.Handler interface documentation to explicitly state the ordering of server-side stats events
  2. Add tests to verify this behavior remains consistent

The current behavior is correct and working as intended, but lacks documentation and test coverage to ensure it remains consistent. This will help users better understand and rely on the stats event ordering when implementing their stats handlers.

aranjans avatar Nov 11 '24 06:11 aranjans