refactor(rivetkit): make traces server only lib#4051
refactor(rivetkit): make traces server only lib#4051jog1t wants to merge 1 commit intographite-base/4051from
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR Review: refactor(rivetkit): make traces server only libSummaryThis PR refactors the ✅ Code Quality & Best PracticesStrong Points:
Code Style Issues:
While this is a TypeScript PR (not Rust), the same principle applies - formatting changes should ideally be separated or avoided unless necessary. 🐛 Potential Issues1. Dependency Management Concern
|
More templates
@rivetkit/cloudflare-workers
@rivetkit/db
@rivetkit/framework-base
@rivetkit/next-js
@rivetkit/react
rivetkit
@rivetkit/sql-loader
@rivetkit/traces
@rivetkit/workflow-engine
@rivetkit/virtual-websocket
@rivetkit/engine-runner
@rivetkit/engine-runner-protocol
commit: |
Graphite Automations"Test" took an action on this PR • (01/27/26)1 assignee was added to this PR based on Kacper Wojciechowski's automation. |
| async list( | ||
| prefix: Uint8Array, | ||
| ): Promise<Array<{ key: Uint8Array; value: Uint8Array }>> { |
There was a problem hiding this comment.
The function parameter formatting should be consistent with the project's style guide. Run Biome linter with --apply to automatically format this function declaration.
Spotted by Graphite Agent (based on CI logs)
Is this helpful? React 👍 or 👎 to let us know.
| "@rivetkit/bare-ts": "^0.6.2", | ||
| "cbor-x": "^1.6.0", | ||
| "fdb-tuple": "^1.0.0", | ||
| "@rivetkit/fdb-tuple": "https://pkg.pr.new/rivet-dev/fdb-tuple/@rivetkit/fdb-tuple@32f95e2", |
There was a problem hiding this comment.
The custom URL dependency '@rivetkit/fdb-tuple': 'https://pkg.pr.new/rivet-dev/fdb-tuple/@rivetkit/fdb-tuple@32f95e2' is causing TypeScript compilation errors during CI. Consider using a standard npm package, a GitHub URL (github:rivet-dev/fdb-tuple#commit-hash), or adding a resolution in the root package.json to help resolve this URL correctly.
Spotted by Graphite Agent (based on CI logs)
Is this helpful? React 👍 or 👎 to let us know.
| "@rivetkit/bare-ts": "^0.6.2", | ||
| "cbor-x": "^1.6.0", | ||
| "fdb-tuple": "^1.0.0", | ||
| "@rivetkit/fdb-tuple": "https://pkg.pr.new/rivet-dev/fdb-tuple/@rivetkit/fdb-tuple@32f95e2", |
There was a problem hiding this comment.
The custom URL dependency '@rivetkit/fdb-tuple': 'https://pkg.pr.new/rivet-dev/fdb-tuple/@rivetkit/fdb-tuple@32f95e2' is causing TypeScript compilation errors during CI. Consider using a standard npm package, a GitHub URL (github:rivet-dev/fdb-tuple#commit-hash), or adding a resolution in the root package.json to help resolve this URL correctly.
Spotted by Graphite Agent (based on CI logs)
Is this helpful? React 👍 or 👎 to let us know.
4189086 to
3c7fabc
Compare
471f2e8 to
63d40ba
Compare
63d40ba to
d77a4fc
Compare
3c7fabc to
0232d12
Compare
| @@ -26,6 +25,7 @@ import { | |||
| type SpanUpdate, | |||
| type StringId, | |||
| type TraceId, | |||
| type Record as TraceRecord, | |||
There was a problem hiding this comment.
The imports from schemas/versioned.js are not properly grouped and ordered. Constants like CHUNK_VERSIONED and CURRENT_VERSION should be grouped together, not interspersed with type imports. This violates Biome's import organization rules.
Spotted by Graphite Agent (based on CI logs)
Is this helpful? React 👍 or 👎 to let us know.
| // Browser stub for @rivetkit/traces | ||
| // This file is used as the browser entry point to prevent Node.js-specific code from being bundled | ||
|
|
||
| import type { | ||
| OtlpAnyValue, | ||
| OtlpExportTraceServiceRequestJson, | ||
| OtlpInstrumentationScope, | ||
| OtlpKeyValue, | ||
| OtlpResource, | ||
| OtlpResourceSpans, | ||
| OtlpScopeSpans, | ||
| OtlpSpan, | ||
| OtlpSpanEvent, | ||
| OtlpSpanLink, | ||
| OtlpSpanStatus, | ||
| } from "./otlp.js"; | ||
| import type { | ||
| EndSpanOptions, | ||
| EventOptions, | ||
| ReadRangeOptions, | ||
| ReadRangeResult, | ||
| ReadRangeWire, | ||
| SpanHandle, | ||
| SpanStatusInput, | ||
| StartSpanOptions, | ||
| Traces, | ||
| TracesDriver, | ||
| TracesOptions, | ||
| UpdateSpanOptions, | ||
| } from "./types.js"; | ||
|
|
||
| function notSupported(name: string): never { | ||
| throw new Error( | ||
| `@rivetkit/traces: ${name} is not supported in the browser. Traces are only available on the server.`, | ||
| ); | ||
| } | ||
|
|
||
| export function createTraces( | ||
| _options: TracesOptions<OtlpResource>, | ||
| ): Traces<OtlpExportTraceServiceRequestJson> { | ||
| notSupported("createTraces"); | ||
| } | ||
|
|
||
| export function encodeReadRangeWire(_wire: ReadRangeWire): Uint8Array { | ||
| notSupported("encodeReadRangeWire"); | ||
| } | ||
|
|
||
| export function decodeReadRangeWire(_bytes: Uint8Array): ReadRangeWire { | ||
| notSupported("decodeReadRangeWire"); | ||
| } | ||
|
|
||
| export function readRangeWireToOtlp( | ||
| _wire: ReadRangeWire, | ||
| _resource?: OtlpResource, | ||
| ): { otlp: OtlpExportTraceServiceRequestJson; clamped: boolean } { | ||
| notSupported("readRangeWireToOtlp"); | ||
| } | ||
|
|
||
| // Re-export types (these are safe for browsers) | ||
| export type { | ||
| EndSpanOptions, | ||
| EventOptions, | ||
| ReadRangeOptions, | ||
| ReadRangeResult, | ||
| ReadRangeWire, | ||
| SpanHandle, | ||
| SpanStatusInput, | ||
| StartSpanOptions, | ||
| Traces, | ||
| TracesDriver, | ||
| TracesOptions, | ||
| UpdateSpanOptions, | ||
| OtlpAnyValue, | ||
| OtlpExportTraceServiceRequestJson, | ||
| OtlpInstrumentationScope, | ||
| OtlpKeyValue, | ||
| OtlpResource, | ||
| OtlpResourceSpans, | ||
| OtlpScopeSpans, | ||
| OtlpSpan, | ||
| OtlpSpanEvent, | ||
| OtlpSpanLink, | ||
| OtlpSpanStatus, | ||
| }; |
There was a problem hiding this comment.
This new file likely has formatting issues throughout. Since it's a completely new file, it should be formatted according to Biome's rules. Run 'biome format --write' on this file to ensure proper formatting.
Spotted by Graphite Agent (based on CI logs)
Is this helpful? React 👍 or 👎 to let us know.

No description provided.