Skip to content

Add River RPC span classification attributes#383

Closed
daweifeng-replit wants to merge 1 commit into
mainfrom
zerg/river-rpc-kind-tracing
Closed

Add River RPC span classification attributes#383
daweifeng-replit wants to merge 1 commit into
mainfrom
zerg/river-rpc-kind-tracing

Conversation

@daweifeng-replit

Copy link
Copy Markdown
Contributor

Why

River spans already identify procedure type through river.method.kind, but the attribute is easy to miss when building Datadog queries and does not include standard RPC semantic fields. Adding explicit RPC classification attributes makes it easier to distinguish unary calls from subscriptions and streams in trace analysis and span-based metrics.

What changed

  • Added shared procedure span attributes for both client and server River spans.
  • Preserved the existing river.method.* attributes for compatibility.
  • Added rpc.system, rpc.service, and rpc.method semantic attributes.
  • Added river.rpc.kind with the River procedure kind: rpc, upload, subscription, or stream.
  • Added river.rpc.streaming so callers can filter streaming procedures with one low-cardinality boolean.
  • Covered client and server span attributes in tracing tests.

Test plan

Verified by CI (no reviewer action needed):

  • npm run test:single -- tracing/tracing.test.ts passes locally and validates the emitted client/server span attributes.

For the reviewer to verify:

  • Confirm the new attribute names work for Datadog span queries and future span-based metrics.

Versioning

  • Breaking protocol change
  • Breaking ts/js API change

Revertibility

Safe to revert. This only adds span attributes and a test; it does not change protocol behavior or public TypeScript APIs.

~ written by Zerg 👾 (mutated-zealot-0503)

@daweifeng-replit daweifeng-replit added the zergling-authored PRs authored by Zerg label Jun 9, 2026
@daweifeng-replit daweifeng-replit marked this pull request as ready for review June 9, 2026 23:45
@daweifeng-replit daweifeng-replit requested a review from a team as a code owner June 9, 2026 23:45
@daweifeng-replit daweifeng-replit requested review from wernst and removed request for a team June 9, 2026 23:45
@daweifeng-replit daweifeng-replit removed the zergling-authored PRs authored by Zerg label Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants