Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
aranjans opened this issue Nov 11, 2024 · 1 comment
Open

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

aranjans opened this issue Nov 11, 2024 · 1 comment
Labels
Area: Server Includes Server, Streams and Server Options. P2 Status: Help Wanted Type: Bug

Comments

@aranjans
Copy link
Contributor

aranjans commented Nov 11, 2024

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 aranjans added the Area: Server Includes Server, Streams and Server Options. label Nov 11, 2024
@dfawley
Copy link
Member

dfawley commented Nov 11, 2024

The expected server-side stats event ordering is:

This is the current ordering.

We should also discuss options like:

  • Removing "Begin", since the start of every RPC on either side should include the initial headers
  • Omitting "InHeader"/"OutHeader" at RPC start, since the start of every RPC on either side should already include the headers
  • Reordering the events, since logically "Begin" sounds like it should happen first

I'm not wild about the current behavior. But changing things here may be difficult since the API has been around for a long time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Server Includes Server, Streams and Server Options. P2 Status: Help Wanted Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants