Skip to content

refactor(telemetry): auth and the SDK share one client span, so they can't drift apart - #310

Merged
PiquelChips merged 2 commits into
fix/google-jwks-client-spanfrom
refactor/shared-client-span
Nov 2, 2026
Merged

PiquelChips merged 2 commits into
fix/google-jwks-client-spanfrom
refactor/shared-client-span

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

Stacked on #309.

#309 left two copies of the client span code: auth's SendTraced and the one the Rust SDK grew for itself. They can drift apart, and reviewing #309 showed they already had: both recorded the status code as a u16, which tracing-opentelemetry exports as a string. That's fixed in #309. This PR leaves a single copy so it can't happen again.

SendTraced now lives in piquel-common, behind a new client-spans feature, which both auth and the SDK already depend on. piquel-telemetry re-exports it, so auth's .send_traced() callers don't change. The SDK's Http::send now calls it too.

Changes in behavior:

  • The SDK's span now ends when the headers arrive, like every other provider call.
  • Apps using the SDK find its spans under the piquel_common target rather than piquel_auth. The SDK docs say so.
  • piquel-telemetry enables that target itself, so the piquel_auth=info filter that fix(auth): Google's signing-key fetch shows up in sign-in traces #309 added to auth is gone again.

Proof: the test from #309, google_key_fetch_is_a_client_span_of_its_request, now exercises the shared SendTraced. It checks that the span sits under its request, records method, host and status (as an integer), and contains no path or query. It passes. piquel-telemetry and piquel-auth tests pass, clippy is clean, and cargo doc with -D warnings is clean with and without the feature. The net change removes code: 60 lines added, 76 removed.

Reviewed with review-loop: 2 rounds with 2× GPT-6.1 Sol and Claude Opus 5.5. Verdict: approved

Note

Written by Claude Opus 5.5 in Claude Code and reviewed by GPT-6.1 Sol and Claude Opus 5.5 (via T3 Code)

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Clippy (1.99.0)

Clippy execution failed

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

PiquelChips and others added 2 commits November 2, 2026 19:00
Moves SendTraced into piquel-common behind a client-spans feature, so the
Rust SDK sends its requests through it instead of a copy of its span.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@PiquelChips
PiquelChips force-pushed the refactor/shared-client-span branch from 233d544 to 4ecd09c Compare November 2, 2026 18:04
@PiquelChips PiquelChips self-assigned this Nov 2, 2026
@PiquelChips
PiquelChips added this pull request to stack #311 November 2, 2026 20:53
@PiquelChips PiquelChips added apps/auth-service Origin Auth at auth.sourceorigin.dev, its settings and developer console, and the operator CLI sdk Rust and TypeScript SDKs refactor No behviour changes labels Nov 2, 2026
@PiquelChips PiquelChips added this to the 0.1 milestone Nov 2, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in sourceorigin.dev Nov 2, 2026
@PiquelChips PiquelChips moved this from Needs Triage to In Progress in sourceorigin.dev Nov 2, 2026
@PiquelChips
PiquelChips merged commit 1b4cfb8 into main Nov 2, 2026
8 of 16 checks passed
@PiquelChips
PiquelChips deleted the refactor/shared-client-span branch November 2, 2026 20:55
@github-project-automation github-project-automation Bot moved this from In Progress to Done in sourceorigin.dev Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apps/auth-service Origin Auth at auth.sourceorigin.dev, its settings and developer console, and the operator CLI refactor No behviour changes sdk Rust and TypeScript SDKs

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant