main
1import { atIndex, chainGet, fromNullable, mapGet, recordGet } from '../../src/absent.ts'
2import { orElse, unwrapOr } from '../../src/option.ts'
3import { verdict, type CanaryVerdict } from '../canary-verdict.mjs'
4import { CF_RAY_HEX_LENGTH, JOIN_MIN_LOGGED, JOIN_MIN_SHARE, QUERY_SLACK_MS, TELEMETRY_PAGE, type LatencyCeiling } from './baseline.ts'
5import { asRecord } from './json.ts'
6import { DEFAULT_MAX_LOSS_RATE, type RolloutGates } from './policy.ts'
7import type { V1Request } from './slo.ts'
9/** One property. A null receiver, a missing key, and a null property are null. */
10function field(value: unknown, key: string): unknown {
11 return unwrapOr(chainGet(value, key), null)
12}
14/** Preferred value, or the fallback when preferred is null. 0 and '' stay. */
15function coalesce(preferred: ReturnType<typeof chainGet>, fallback: unknown): unknown {
16 return unwrapOr(orElse(preferred, fromNullable(fallback)), null)
17}
19/** First record that is present. Both absent is an empty record. */
20function recordOrEmpty(first: Record<string, unknown> | null, second: Record<string, unknown> | null): Record<string, unknown> {
21 if (first !== null) return first
22 if (second !== null) return second
23 return {}
24}
26/** First non-empty string. Null and '' fall through. */
27function firstString(...values: readonly unknown[]): string | null {
28 for (const value of values) {
29 const text = stringField(value)
30 if (text !== null) return text
31 }
32 return null
33}
35/** Workers outcome ADT: client-caused probe loss vs worker fault. Unknown non-ok fails closed as worker_fault. */
36export type WorkersOutcome =
37 | { readonly kind: 'ok' }
38 | { readonly kind: 'client_caused'; readonly outcome: 'canceled' | 'clientDisconnected' | 'responseStreamDisconnected' }
39 | { readonly kind: 'worker_fault'; readonly outcome: 'exception' | 'exceededCpu' | 'exceededMemory' | 'scriptNotFound' | 'loadShed' | 'overload' | 'unknown'; readonly value: string }
41function classifyWorkersOutcome(workers: Record<string, unknown> | null): WorkersOutcome {
42 const got = recordGet(workers, 'outcome')
43 if (got.tag !== 'some') return { kind: 'ok' }
44 const value = String(got.value)
45 switch (value) {
46 case 'ok':
47 return { kind: 'ok' }
48 case 'canceled':
49 case 'clientDisconnected':
50 case 'responseStreamDisconnected':
51 return { kind: 'client_caused', outcome: value }
52 case 'exception':
53 case 'exceededCpu':
54 case 'exceededMemory':
55 case 'scriptNotFound':
56 case 'loadShed':
57 case 'overload':
58 return { kind: 'worker_fault', outcome: value, value }
59 default:
60 // Fail closed on any unknown non-ok string
61 return { kind: 'worker_fault', outcome: 'unknown', value }
62 }
63}
65/**
66 * An observed bad value. This union has no missing-sample or shape variant:
67 * a check the harness could not evaluate cannot be stored as a worker fault.
68 */
69export type ObservedFault =
70 | { readonly kind: 'exception'; readonly detail: string }
71 | { readonly kind: 'unexpected-status'; readonly id: string; readonly status: number }
72 | { readonly kind: 'log-error'; readonly detail: string }
73 | { readonly kind: 'fivexx'; readonly detail: string }
74 | { readonly kind: 'non-ok'; readonly detail: string }
75 | { readonly kind: 'latency'; readonly metric: string; readonly p: 'p50' | 'p99'; readonly value: number; readonly ceiling: number }
76 | { readonly kind: 'other-version'; readonly detail: string }
78/** Missing data, a query-shape mismatch, or zero samples where samples are required. Not a worker fault. */
79export type UnevaluableCheck =
80 | { readonly kind: 'missing'; readonly detail: string }
81 | { readonly kind: 'shape'; readonly detail: string }
82 | { readonly kind: 'telemetry-loss'; readonly detail: string }
83 | { readonly kind: 'join'; readonly detail: string }
85export type SmokeRequest = {
86 readonly id: string
87 readonly version: string | null
88 readonly step: string
89 readonly status: number
90 readonly expected: readonly number[]
91 /** cf-ray of the smoke response. Span events join on this. Null when the response had none. */
92 readonly ray: string | null
93}
95/** A telemetry query that threw. The type has no worker variant: a query failure is the harness. */
96export type QueryFault = { readonly kind: 'harness_fault'; readonly reason: string }
98export function queryFault(reason: string): QueryFault {
99 return { kind: 'harness_fault', reason }
100}
102export type Filter = {
103 readonly key: string
104 readonly operation: string
105 readonly type: string
106 readonly value: string
107}
109export function telemetryQuery(
110 view: 'events' | 'traces',
111 from: number,
112 to: number,
113 filters: readonly Filter[],
114 offset: string | null,
115) {
116 return {
117 queryId: 'ply-cd',
118 timeframe: { from, to },
119 view,
120 limit: TELEMETRY_PAGE,
121 ...(offset ? { offset } : {}),
122 parameters: { filters: [...filters] },
123 }
124}
126export function queryTo(now: number): number {
127 return now + QUERY_SLACK_MS
128}
130export function serviceFilter(worker: string): Filter {
131 return { key: '$metadata.service', operation: 'eq', type: 'string', value: worker }
132}
134export function versionFilter(version: string): Filter {
135 return { key: '$workers.scriptVersion.id', operation: 'eq', type: 'string', value: version }
136}
138/** Child spans. The traces view does not return them; this events filter does. */
139export function spanTypeFilter(): Filter {
140 return { key: '$metadata.type', operation: 'eq', type: 'string', value: 'span' }
141}
143/** Workers Observability wraps the page as events.events or traces.traces. */
144export function unwrapEvents(payload: unknown): unknown[] {
145 const rec = asRecord(payload)
146 if (!rec) return []
147 const events = asRecord(rec.events)
148 if (events && Array.isArray(events.events)) return events.events
149 if (Array.isArray(rec.events)) return rec.events
150 const traces = asRecord(rec.traces)
151 if (traces && Array.isArray(traces.traces)) return traces.traces
152 if (traces && Array.isArray(traces.events)) return traces.events
153 if (Array.isArray(rec.traces)) return rec.traces
154 return []
155}
157function metaId(row: unknown): string | null {
158 const id = field(asRecord(field(asRecord(row), '$metadata')), 'id')
159 return typeof id === 'string' && id !== '' ? id : null
160}
162/**
163 * Next page's `offset`: the last id on this page that differs from the page's final id, or null when the page has no such id.
164 *
165 * Rows come back newest first, ordered by `$metadata.id`, and `offset` returns only ids strictly below it. The id is a
166 * millisecond plus a per-invocation row position, so rows of different invocations can share it. Using the final id as the
167 * cursor would drop the rest of a same-id group the page boundary split: on 2026-11-08T17-17-40-415Z's 10% step at limit 37
168 * and 100 this lost 4 and 2 of 4,531 rows. Stepping back one id re-reads that group; callers remove the repeats with `dedupeRows`.
169 */
170export function pageCursor(page: readonly unknown[]): string | null {
171 const last = metaId(unwrapOr(atIndex(page, page.length - 1), null))
172 if (last === null) return null
173 for (let index = page.length - 2; index >= 0; index -= 1) {
174 const id = metaId(unwrapOr(atIndex(page, index), null))
175 if (id !== null && id !== last) return id
176 }
177 return null
178}
180/**
181 * Identity of one event row, or null when it has no `$metadata.id` (kept, never compared).
182 *
183 * `$metadata.id` alone is not unique: invocations in the same millisecond with the same row position share it. Adding
184 * `requestId` separates invocation and log rows, but a span row has a null `requestId`, and id + requestId still merged 355
185 * distinct spans of 9,908 rows (run 2026-11-08T17-17-40-415Z). Id + requestId + traceId + spanId had no collisions there.
186 */
187export function rowKey(row: unknown): string | null {
188 const id = metaId(row)
189 if (id === null) return null
190 const meta = asRecord(field(asRecord(row), '$metadata'))
191 return JSON.stringify([id, field(meta, 'requestId'), field(meta, 'traceId'), field(meta, 'spanId')])
192}
194/** Rows without repeats of the same row (overlapping pages or slices). Order is kept; rows with no id all stay. */
195export function dedupeRows(rows: readonly unknown[]): unknown[] {
196 const seen = new Set<string>()
197 const out: unknown[] = []
198 for (const row of rows) {
199 const key = rowKey(row)
200 if (key !== null) {
201 if (seen.has(key)) continue
202 seen.add(key)
203 }
204 out.push(row)
205 }
206 return out
207}
209/** Same percentile as scripts/canary-o11y.mjs: sorted[floor((n - 1) * p)], null when empty. */
210export function percentile(values: readonly number[], p: number): number | null {
211 const sorted = values.filter(value => Number.isFinite(value)).sort((a, b) => a - b)
212 if (sorted.length === 0) return null
213 return unwrapOr(atIndex(sorted, Math.floor((sorted.length - 1) * p)), null)
214}
216/** Percentile text. An empty series prints `-`; 0 prints `0`. */
217function percentileLabel(values: readonly number[], p: number): string {
218 const value = percentile(values, p)
219 return value === null ? '-' : `${value}`
220}
222/** Duration in milliseconds. `durationMS` is already milliseconds. A bare `duration` above 1e6 is nanoseconds. */
223export function spanDurationMs(span: Record<string, unknown>): number | null {
224 const source = asRecord(span.source)
225 const attrs = recordOrEmpty(asRecord(span.attributes), asRecord(span.attrs))
226 const millis = [
227 span.durationMs, span.durationMS, span.duration_ms,
228 field(source, 'durationMs'), field(source, 'durationMS'), field(source, 'duration_ms'),
229 attrs.duration_ms, attrs.durationMs, attrs.durationMS,
230 ]
231 for (const candidate of millis) {
232 if (typeof candidate === 'number' && Number.isFinite(candidate) && candidate >= 0) return candidate
233 }
234 const raw = typeof span.duration === 'number' ? span.duration : coalesce(chainGet(source, 'duration'), attrs.duration)
235 if (typeof raw !== 'number' || !Number.isFinite(raw) || raw < 0) return null
236 return raw > 1_000_000 ? raw / 1_000_000 : raw
237}
239/** One traces-view row: a span count and a root name, and no child spans. */
240export function isTraceSummary(row: Record<string, unknown>): boolean {
241 return typeof row.spans === 'number' && typeof row.rootSpanName === 'string' && typeof row.traceId === 'string'
242}
244const ARTIFACTS_FETCH_SUFFIXES = ['/git-upload-pack', '/git-receive-pack', '/info/refs'] as const
246export function isArtifactsFetchPath(path: string): boolean {
247 return ARTIFACTS_FETCH_SUFFIXES.some(suffix => path.endsWith(suffix))
248}
250export type FetchSample = {
251 readonly durationMs: number
252 readonly path: string
253 readonly status: number | null
254 readonly version: string | null
255 readonly traceId: string | null
256 readonly rayId: string | null
257 readonly artifacts: boolean
258}
260export function spanNameOf(event: Record<string, unknown>): string | null {
261 const source = asRecord(event.source)
262 const meta = asRecord(event.$metadata)
263 return firstString(field(source, 'name'), field(meta, 'spanName'), event.name)
264}
266function urlPathOf(event: Record<string, unknown>): string | null {
267 const source = asRecord(event.source)
268 const url = coalesce(chainGet(source, 'url'), event.url)
269 if (typeof url === 'string' && url !== '') return url
270 const rec = asRecord(url)
271 return firstString(field(rec, 'path'), field(rec, 'full'))
272}
274function httpStatusOf(event: Record<string, unknown>): number | null {
275 const source = asRecord(event.source)
276 const http = asRecord(field(source, 'http'))
277 const response = asRecord(field(http, 'response'))
278 const status = coalesce(chainGet(response, 'status_code'), field(response, 'statusCode'))
279 return typeof status === 'number' ? status : null
280}
282function scriptVersionOf(event: Record<string, unknown>): string | null {
283 const source = asRecord(event.source)
284 const cloudflare = asRecord(field(source, 'cloudflare'))
285 const script = asRecord(field(cloudflare, 'script_version'))
286 const id = field(script, 'id')
287 if (typeof id === 'string' && id !== '') return id
288 const faas = asRecord(field(source, 'faas'))
289 const version = field(faas, 'version')
290 return typeof version === 'string' && version !== '' ? version : null
291}
293/** An outbound `fetch` span. Trace summaries and root spans (GET, POST, DELETE) are not samples. */
294export function fetchSample(event: unknown): FetchSample | null {
295 const rec = asRecord(event)
296 if (!rec || isTraceSummary(rec)) return null
297 if (spanNameOf(rec) !== 'fetch') return null
298 const durationMs = spanDurationMs(rec)
299 if (durationMs === null) return null
300 const found = urlPathOf(rec)
301 const path = found === null ? '' : found
302 return {
303 durationMs,
304 path,
305 status: httpStatusOf(rec),
306 version: scriptVersionOf(rec),
307 traceId: traceIdOf(rec),
308 rayId: rayIdOf(rec),
309 artifacts: isArtifactsFetchPath(path),
310 }
311}
313function versionOf(event: Record<string, unknown>): string | null {
314 const workers = asRecord(event.$workers)
315 const script = asRecord(field(workers, 'scriptVersion'))
316 const id = field(script, 'id')
317 return typeof id === 'string' ? id : null
318}
320/** `$workers.scriptVersion.id` on a telemetry event, or null. The ramp partitions one query with this. */
321export function scriptVersionId(event: unknown): string | null {
322 const rec = asRecord(event)
323 return rec ? versionOf(rec) : null
324}
326function stringField(value: unknown): string | null {
327 return typeof value === 'string' && value !== '' ? value : null
328}
330function requestIdOf(event: Record<string, unknown>): string | null {
331 const meta = asRecord(event.$metadata)
332 return firstString(field(meta, 'requestId'), event.requestId)
333}
335export function traceIdOf(event: Record<string, unknown>): string | null {
336 const meta = asRecord(event.$metadata)
337 return firstString(event.traceId, event.trace_id, field(meta, 'traceId'), field(meta, 'trace_id'))
338}
340export function rayIdOf(event: Record<string, unknown>): string | null {
341 const meta = asRecord(event.$metadata)
342 return firstString(event.rayId, event.ray_id, field(meta, 'rayId'), field(meta, 'ray_id'))
343}
345type JoinKey = {
346 readonly requestId: string | null
347 readonly traceId: string | null
348 readonly rayId: string | null
349}
351function joinKeyOf(event: Record<string, unknown>): JoinKey {
352 return { requestId: requestIdOf(event), traceId: traceIdOf(event), rayId: rayIdOf(event) }
353}
355/** The 16-hex body of a cf-ray, or null when `ray` is not that shape. */
356function rayBody(ray: string): string | null {
357 const dash = ray.indexOf('-')
358 const body = dash === -1 ? ray : ray.slice(0, dash)
359 if (body.length !== CF_RAY_HEX_LENGTH || !/^[0-9a-f]+$/i.test(body)) return null
360 return body.toLowerCase()
361}
363/** A cf-ray as a join key: its 16-hex body lowercased ("a585f4159ae599a2-IAD" and "A585F4159AE599A2" are one key). */
364export function rayKey(ray: string): string {
365 const body = rayBody(ray)
366 return body === null ? ray : body
367}
369export function sameRay(left: string, right: string): boolean {
370 if (left === right) return true
371 const a = rayBody(left)
372 const b = rayBody(right)
373 return a !== null && a === b
374}
376type TraceMarks = {
377 readonly rays: readonly string[]
378 readonly traces: readonly string[]
379 readonly strings: ReadonlySet<string>
380}
382function traceMarks(trace: unknown): TraceMarks {
383 const rays: string[] = []
384 const traces: string[] = []
385 const strings = new Set<string>()
386 walk(trace, rec => {
387 const ray = rayIdOf(rec)
388 const traceId = traceIdOf(rec)
389 if (ray) rays.push(ray)
390 if (traceId) traces.push(traceId)
391 for (const value of Object.values(rec)) {
392 if (typeof value === 'string' && value !== '') strings.add(value)
393 }
394 }, new Set())
395 return { rays, traces, strings }
396}
398function rayHit(rays: readonly string[], want: string): boolean {
399 for (const ray of rays) if (sameRay(ray, want)) return true
400 return false
401}
403/**
404 * Span events carry `rayId` and `traceId`. `$metadata.requestId` is null on those events,
405 * so it is only a last resort for a span that still has one.
406 */
407function keysMatch(marks: TraceMarks, keys: readonly JoinKey[]): boolean {
408 for (const key of keys) if (key.rayId && rayHit(marks.rays, key.rayId)) return true
409 for (const key of keys) if (key.traceId && marks.traces.includes(key.traceId)) return true
410 for (const key of keys) if (key.requestId && marks.strings.has(key.requestId)) return true
411 return false
412}
414type SmokeKeys = {
415 rays: string[]
416 traces: string[]
417 requestIds: string[]
418}
420function smokeKeys(): SmokeKeys {
421 return { rays: [], traces: [], requestIds: [] }
422}
424function addKey(into: SmokeKeys, key: JoinKey): void {
425 const rayId = key.rayId
426 const traceId = key.traceId
427 const requestId = key.requestId
428 if (rayId && !into.rays.some(ray => sameRay(ray, rayId))) into.rays.push(rayId)
429 if (traceId && !into.traces.includes(traceId)) into.traces.push(traceId)
430 if (requestId && !into.requestIds.includes(requestId)) into.requestIds.push(requestId)
431}
433function smokeMatched(marks: TraceMarks, keysBySmoke: ReadonlyMap<string, SmokeKeys>, smokeIds: ReadonlySet<string>, platformToSmoke: ReadonlyMap<string, string>): Set<string> {
434 const matched = new Set<string>()
435 for (const [id, keys] of keysBySmoke) {
436 if (keys.rays.some(ray => rayHit(marks.rays, ray))) matched.add(id)
437 }
438 if (matched.size > 0) return matched
439 for (const [id, keys] of keysBySmoke) {
440 if (keys.traces.some(traceId => marks.traces.includes(traceId))) matched.add(id)
441 }
442 if (matched.size > 0) return matched
443 for (const value of marks.strings) {
444 if (smokeIds.has(value)) matched.add(value)
445 const smoke = platformToSmoke.get(value)
446 if (smoke) matched.add(smoke)
447 }
448 return matched
449}
451function isLog(event: Record<string, unknown>): boolean {
452 const source = asRecord(event.source)
453 return field(source, 'msg') === 'ply.request' || event.msg === 'ply.request'
454}
456function smokeIdOf(event: Record<string, unknown>): string | null {
457 const source = asRecord(event.source)
458 const id = field(source, 'id')
459 if (typeof id === 'string') return id
460 return typeof event.id === 'string' ? event.id : null
461}
463function statusOf(event: Record<string, unknown>): number | null {
464 const source = asRecord(event.source)
465 const status = coalesce(chainGet(source, 'status'), event.status)
466 return typeof status === 'number' ? status : null
467}
469/** Workers names the internet-facing fetch handler this. A missing entrypoint is that handler. */
470export const DEFAULT_ENTRYPOINT = 'default'
472const FETCH_EVENT = 'cf-worker-event'
473const FETCH_TYPE = 'fetch'
474const fetchBrand = Symbol('FetchInvocation')
476/**
477 * A fetch handler invocation. `external` is the default entrypoint, the traffic
478 * the ramp routes. `internal` is a named entrypoint (`FlagsCache`, `GitCache`):
479 * `ctx.exports` calls it, and it carries its own ray and request id.
480 */
481export type FetchInvocation =
482 | { readonly [fetchBrand]: 'FetchInvocation'; readonly kind: 'external' }
483 | { readonly [fetchBrand]: 'FetchInvocation'; readonly kind: 'internal'; readonly entrypoint: string }
485/** Null when the event is not a fetch invocation. */
486export function fetchInvocation(event: Record<string, unknown>): FetchInvocation | null {
487 const meta = asRecord(event.$metadata)
488 const workers = asRecord(event.$workers)
489 if (workers === null || field(meta, 'type') !== FETCH_EVENT || field(workers, 'eventType') !== FETCH_TYPE) return null
490 const entrypoint = workers.entrypoint
491 if (typeof entrypoint !== 'string' || entrypoint === '' || entrypoint === DEFAULT_ENTRYPOINT) {
492 return { [fetchBrand]: 'FetchInvocation', kind: 'external' }
493 }
494 return { [fetchBrand]: 'FetchInvocation', kind: 'internal', entrypoint }
495}
497function isExternalFetch(event: Record<string, unknown>): boolean {
498 const invocation = fetchInvocation(event)
499 return invocation !== null && invocation.kind === 'external'
500}
502function exceptionCount(event: Record<string, unknown>): number {
503 const workers = asRecord(event.$workers)
504 const exceptions = field(workers, 'exceptions')
505 if (Array.isArray(exceptions) && exceptions.length > 0) return exceptions.length
506 if (field(workers, 'outcome') === 'exception') return 1
507 return 0
508}
510function walk(node: unknown, visit: (rec: Record<string, unknown>) => void, seen: Set<object>): void {
511 if (node === null || typeof node !== 'object') return
512 if (seen.has(node)) return
513 seen.add(node)
514 if (Array.isArray(node)) {
515 for (const item of node) walk(item, visit, seen)
516 return
517 }
518 const rec = node as Record<string, unknown>
519 visit(rec)
520 for (const value of Object.values(rec)) walk(value, visit, seen)
521}
523/** Named-entrypoint fetches on one version. Recorded, never gated. */
524export type InternalEntrypoint = {
525 readonly entrypoint: string
526 readonly count: number
527}
529export type VersionStats = {
530 readonly requests: number
531 /** External fetch invocations. `requests` falls back to log rows when this is 0. Named entrypoints are `internal`. */
532 readonly invocations: number
533 readonly exceptions: number
534 readonly errors: number
535 readonly fivexx: number
536 readonly errorLogs: number
537 readonly wallMs: readonly number[]
538 readonly cpuMs: readonly number[]
539 readonly fetchMs: readonly number[]
540 readonly v1: readonly V1Request[]
541 readonly internal: readonly InternalEntrypoint[]
542}
544function internalCounts(counts: ReadonlyMap<string, number>): InternalEntrypoint[] {
545 return [...counts.entries()]
546 .sort((left, right) => (left[0] < right[0] ? -1 : left[0] > right[0] ? 1 : 0))
547 .map(([entrypoint, count]) => ({ entrypoint, count }))
548}
550function methodOf(event: Record<string, unknown>): V1Request['method'] {
551 const source = asRecord(event.source)
552 const method = coalesce(chainGet(source, 'method'), event.method)
553 if (method === 'GET' || method === 'POST') return method
554 return 'OTHER'
555}
557function pathOf(event: Record<string, unknown>): string | null {
558 const source = asRecord(event.source)
559 const path = coalesce(chainGet(source, 'path'), event.path)
560 if (typeof path !== 'string' || path === '') return null
561 const bare = path.split('?')[0]
562 return bare || null
563}
565function v1From(events: readonly unknown[]): V1Request[] {
566 const invocations = new Map<string, { wall: number | null; exception: boolean }>()
567 for (const item of events) {
568 const event = asRecord(item)
569 if (!event || !isExternalFetch(event)) continue
570 const id = requestIdOf(event)
571 if (!id) continue
572 const workers = asRecord(event.$workers)
573 const wallTime = field(workers, 'wallTimeMs')
574 invocations.set(id, {
575 wall: typeof wallTime === 'number' ? wallTime : null,
576 exception: exceptionCount(event) > 0,
577 })
578 }
579 const out: V1Request[] = []
580 for (const item of events) {
581 const event = asRecord(item)
582 if (!event || !isLog(event)) continue
583 const path = pathOf(event)
584 if (!path || (path !== '/v1' && !path.startsWith('/v1/'))) continue
585 const loggedStatus = statusOf(event)
586 const status = loggedStatus === null ? 0 : loggedStatus
587 const id = requestIdOf(event)
588 const linked = id ? unwrapOr(mapGet(invocations, id), null) : null
589 const source = asRecord(event.source)
590 const logged = field(source, 'ms')
591 const loggedMs = typeof logged === 'number' ? logged : null
592 out.push({
593 method: methodOf(event),
594 path,
595 status,
596 exception: linked === null ? false : linked.exception,
597 wallMs: linked !== null && linked.wall !== null ? linked.wall : loggedMs,
598 expected4xx: status >= 400 && status < 500,
599 })
600 }
601 return out
602}
604/** Fetch spans have no `$workers.scriptVersion.id`. Join on rayId, then traceId, then a request id the span still carries. */
605function fetchMsJoined(events: readonly unknown[], spans: readonly unknown[]): number[] {
606 const keys: JoinKey[] = []
607 for (const item of events) {
608 const event = asRecord(item)
609 if (!event) continue
610 const invocation = fetchInvocation(event)
611 if (invocation !== null && invocation.kind === 'internal') continue
612 const key = joinKeyOf(event)
613 if (key.requestId || key.traceId || key.rayId) keys.push(key)
614 }
615 const fetchMs: number[] = []
616 for (const span of spans) {
617 if (!keysMatch(traceMarks(span), keys)) continue
618 const sample = fetchSample(span)
619 if (sample) fetchMs.push(sample.durationMs)
620 }
621 return fetchMs
622}
624/** All traffic on one version during a ramp step, not just the smoke ids. `spans` are child span events, not traces-view rows. */
625export function statsFromEvents(events: readonly unknown[], spans: readonly unknown[]): VersionStats {
626 let requests = 0
627 let exceptions = 0
628 let errors = 0
629 let fivexx = 0
630 let errorLogs = 0
631 let logs = 0
632 const wallMs: number[] = []
633 const cpuMs: number[] = []
634 const internal = new Map<string, number>()
635 for (const item of events) {
636 const event = asRecord(item)
637 if (!event) continue
638 if (isLog(event)) {
639 logs += 1
640 const status = statusOf(event)
641 if (status !== null && status >= 500) fivexx += 1
642 const meta = asRecord(event.$metadata)
643 if (field(meta, 'level') === 'error') errorLogs += 1
644 }
645 const fetch = fetchInvocation(event)
646 if (!fetch) continue
647 if (fetch.kind === 'internal') {
648 internal.set(fetch.entrypoint, unwrapOr(mapGet(internal, fetch.entrypoint), 0) + 1)
649 continue
650 }
651 requests += 1
652 exceptions += exceptionCount(event)
653 const workers = asRecord(event.$workers)
654 if (classifyWorkersOutcome(workers).kind === 'worker_fault') errors += 1
655 const wall = field(workers, 'wallTimeMs')
656 if (typeof wall === 'number') wallMs.push(wall)
657 const cpu = field(workers, 'cpuTimeMs')
658 if (typeof cpu === 'number') cpuMs.push(cpu)
659 }
660 return {
661 requests: requests > 0 ? requests : logs,
662 invocations: requests,
663 exceptions,
664 errors,
665 fivexx,
666 errorLogs,
667 wallMs,
668 cpuMs,
669 fetchMs: fetchMsJoined(events, spans),
670 v1: v1From(events),
671 internal: internalCounts(internal),
672 }
673}
675export type SmokeSummary = {
676 readonly loggedBy: ReadonlyMap<string, ReadonlySet<string>>
677 readonly health: { readonly nonOk: number; readonly fivexx: number; readonly errorLogs: number; readonly exceptions: number }
678 readonly wallMs: readonly number[]
679 readonly cpuMs: readonly number[]
680 readonly fetchMs: readonly number[]
681 readonly tracedIds: ReadonlySet<string>
682 /** External fetch invocations of this version in the window. The span join is compared with this. */
683 readonly invocations: number
684 /**
685 * `events` is a child-span query. `summaries` is the traces view (a count and a root name).
686 * `empty` means the span query returned nothing.
687 */
688 readonly spanShape: 'events' | 'summaries' | 'empty'
689}
691/**
692 * Reduce a version's logs, traces-view rows, and child span events to the smoke-id view the gate judges.
693 * `spans` defaults to `traces` so a caller that already holds span events can pass them once.
694 * A traces-view row is not a child span: it cannot supply a fetch duration.
695 */
696export function summarizeTelemetry(
697 version: string,
698 requests: readonly SmokeRequest[],
699 events: readonly unknown[],
700 traces: readonly unknown[],
701 spans: readonly unknown[] = traces,
702): SmokeSummary {
703 const want = new Set(requests.map(request => request.id))
704 const loggedBy = new Map<string, Set<string>>()
705 const platformToSmoke = new Map<string, string>()
706 const keysBySmoke = new Map<string, SmokeKeys>()
707 const keysFor = (id: string): SmokeKeys => {
708 const existing = keysBySmoke.get(id)
709 if (existing) return existing
710 const created = smokeKeys()
711 keysBySmoke.set(id, created)
712 return created
713 }
714 for (const request of requests) {
715 if (request.ray) keysFor(request.id).rays.push(request.ray)
716 }
717 let fivexx = 0
718 let errorLogs = 0
719 let nonOk = 0
720 let exceptions = 0
721 let invocations = 0
722 const smokePlatform = new Set<string>()
723 for (const item of events) {
724 const event = asRecord(item)
725 if (!event) continue
726 const saw = versionOf(event)
727 if (isLog(event)) {
728 const id = smokeIdOf(event)
729 if (id && want.has(id)) {
730 const versions = unwrapOr(mapGet(loggedBy, id), new Set<string>())
731 if (saw) versions.add(saw)
732 loggedBy.set(id, versions)
733 addKey(keysFor(id), joinKeyOf(event))
734 const platform = requestIdOf(event)
735 if (platform && saw === version) {
736 platformToSmoke.set(platform, id)
737 smokePlatform.add(platform)
738 }
739 }
740 if (saw === version) {
741 const status = statusOf(event)
742 if (status !== null && status >= 500) fivexx += 1
743 const meta = asRecord(event.$metadata)
744 if (field(meta, 'level') === 'error') errorLogs += 1
745 }
746 }
747 if (saw !== version || !isExternalFetch(event)) continue
748 invocations += 1
749 if (exceptionCount(event) > 0) exceptions += 1
750 const workers = asRecord(event.$workers)
751 if (classifyWorkersOutcome(workers).kind === 'worker_fault') nonOk += 1
752 }
753 const wallMs: number[] = []
754 const cpuMs: number[] = []
755 for (const item of events) {
756 const event = asRecord(item)
757 if (!event || versionOf(event) !== version || !isExternalFetch(event)) continue
758 const platform = requestIdOf(event)
759 if (!platform || !smokePlatform.has(platform)) continue
760 const workers = asRecord(event.$workers)
761 const wall = field(workers, 'wallTimeMs')
762 if (typeof wall === 'number') wallMs.push(wall)
763 const cpu = field(workers, 'cpuTimeMs')
764 if (typeof cpu === 'number') cpuMs.push(cpu)
765 }
766 for (const item of events) {
767 const event = asRecord(item)
768 if (!event) continue
769 const key = joinKeyOf(event)
770 const requestId = key.requestId
771 let smoke = requestId ? unwrapOr(mapGet(platformToSmoke, requestId), null) : null
772 const rayId = key.rayId
773 if (!smoke && rayId) {
774 for (const [id, keys] of keysBySmoke) {
775 if (keys.rays.some(ray => sameRay(ray, rayId))) {
776 smoke = id
777 break
778 }
779 }
780 }
781 if (smoke) addKey(keysFor(smoke), key)
782 }
783 const tracedIds = new Set<string>()
784 for (const trace of traces) {
785 const matched = smokeMatched(traceMarks(trace), keysBySmoke, want, platformToSmoke)
786 for (const id of matched) tracedIds.add(id)
787 }
788 let summaries = 0
789 let spanEvents = 0
790 const fetchMs: number[] = []
791 for (const span of spans) {
792 const rec = asRecord(span)
793 if (!rec) continue
794 if (isTraceSummary(rec)) {
795 summaries += 1
796 const matched = smokeMatched(traceMarks(rec), keysBySmoke, want, platformToSmoke)
797 for (const id of matched) tracedIds.add(id)
798 continue
799 }
800 spanEvents += 1
801 const matched = smokeMatched(traceMarks(rec), keysBySmoke, want, platformToSmoke)
802 if (matched.size === 0) continue
803 for (const id of matched) tracedIds.add(id)
804 const sample = fetchSample(rec)
805 if (sample) fetchMs.push(sample.durationMs)
806 }
807 const spanShape = spanEvents > 0 ? 'events' as const : summaries > 0 ? 'summaries' as const : 'empty' as const
808 return {
809 loggedBy,
810 health: { nonOk, fivexx, errorLogs, exceptions },
811 wallMs,
812 cpuMs,
813 fetchMs,
814 tracedIds,
815 invocations,
816 spanShape,
817 }
818}
820/**
821 * A join or query failure is `harness_fault` and has no worker label.
822 * A version that answered badly is `worker`. Those two cannot be confused.
823 */
824export type SmokeJudge =
825 | { readonly kind: 'pass'; readonly line: string; readonly failures: readonly []; readonly verdict: CanaryVerdict }
826 | { readonly kind: 'worker'; readonly line: string; readonly failures: readonly ObservedFault[]; readonly verdict: CanaryVerdict }
827 | { readonly kind: 'harness_fault'; readonly line: string; readonly reason: string; readonly checks: readonly UnevaluableCheck[]; readonly verdict: CanaryVerdict }
829function faultIsHard(fault: ObservedFault, gates: RolloutGates): boolean {
830 switch (fault.kind) {
831 case 'exception':
832 return gates.exceptions === 'hard'
833 case 'fivexx':
834 return gates.fivexx === 'hard'
835 case 'log-error':
836 return gates.errorLogs === 'hard'
837 case 'non-ok':
838 return gates.nonOk === 'hard'
839 case 'latency':
840 return gates.latency.mode === 'gate'
841 case 'unexpected-status':
842 case 'other-version':
843 return gates.smoke === 'hard'
844 }
845}
847function latencyGap(check: UnevaluableCheck): boolean {
848 return check.kind === 'missing' && /^(wall|cpu|fetch) has no samples$/.test(check.detail)
849}
851function faultText(fault: ObservedFault): string {
852 if (fault.kind === 'unexpected-status') return `unexpected-status ${fault.id} ${fault.status}`
853 if (fault.kind === 'latency') return `latency ${fault.metric} ${fault.p} ${fault.value} > ${fault.ceiling}`
854 return `${fault.kind}: ${fault.detail}`
855}
857/**
858 * Drop signals the policy does not treat as hard. A latency series with no samples
859 * is a harness fault only when latency mode is `gate`.
860 */
861export function applyGates(judge: SmokeJudge, gates: RolloutGates): SmokeJudge {
862 if (judge.kind === 'harness_fault') {
863 if (gates.latency.mode === 'gate') return judge
864 const checks = judge.checks.filter(check => !latencyGap(check))
865 if (checks.length === judge.checks.length) return judge
866 if (checks.length > 0) {
867 const reason = checks.map(check => `${check.kind}: ${check.detail}`).join('; ')
868 return { kind: 'harness_fault', line: `telemetry: harness_fault: ${reason}`, reason, checks, verdict: judge.verdict }
869 }
870 return { kind: 'pass', failures: [], line: `${judge.verdict.line} latency=${gates.latency.mode}`, verdict: judge.verdict }
871 }
872 if (judge.kind !== 'worker') return judge
873 const kept = judge.failures.filter(fault => faultIsHard(fault, gates))
874 const dropped = judge.failures.filter(fault => !faultIsHard(fault, gates))
875 if (dropped.length === 0) return judge
876 if (kept.length > 0) return { kind: 'worker', failures: kept, line: judge.line, verdict: judge.verdict }
877 return {
878 kind: 'pass',
879 failures: [],
880 line: `${judge.verdict.line} informational: ${dropped.map(faultText).join('; ')}`,
881 verdict: judge.verdict,
882 }
883}
885/** Below half of the invocations the worker logged, the span join is the harness, not the version. */
886export function implausibleJoin(input: { readonly smoke: number; readonly invocations: number; readonly joined: number }): boolean {
887 const compared = Math.min(input.invocations, input.smoke)
888 if (compared < JOIN_MIN_LOGGED) return false
889 return input.joined / compared < JOIN_MIN_SHARE
890}
892function latencyChecks(
893 metric: string,
894 values: readonly number[],
895 ceiling: LatencyCeiling,
896): readonly (ObservedFault | UnevaluableCheck)[] {
897 const p50 = percentile(values, 0.5)
898 const p99 = percentile(values, 0.99)
899 if (p50 === null || p99 === null) return [{ kind: 'missing', detail: `${metric} has no samples` }]
900 const failures: ObservedFault[] = []
901 if (p50 > ceiling.p50Ms) failures.push({ kind: 'latency', metric, p: 'p50', value: p50, ceiling: ceiling.p50Ms })
902 if (p99 > ceiling.p99Ms) failures.push({ kind: 'latency', metric, p: 'p99', value: p99, ceiling: ceiling.p99Ms })
903 return failures
904}
906function isObserved(check: ObservedFault | UnevaluableCheck): check is ObservedFault {
907 switch (check.kind) {
908 case 'exception':
909 case 'unexpected-status':
910 case 'log-error':
911 case 'fivexx':
912 case 'non-ok':
913 case 'latency':
914 case 'other-version':
915 return true
916 case 'missing':
917 case 'shape':
918 case 'telemetry-loss':
919 case 'join':
920 return false
921 }
922}
924/** One smoke id telemetry did not return: no ply.request log from any version, no trace, or both. */
925export type LostId = { readonly id: string; readonly step: string; readonly log: boolean; readonly trace: boolean }
927/** Informational loss metric. `rate` is `ids.length / total`; zero when there were no smoke requests. */
928export type TelemetryLoss = {
929 readonly total: number
930 readonly count: number
931 readonly rate: number
932 readonly maxLossRate: number
933 readonly exceeded: boolean
934 readonly ids: readonly LostId[]
935}
937/**
938 * Smoke ids missing from telemetry. A request logged by another version is a routing fault, not loss,
939 * and is not counted here.
940 */
941export function telemetryLoss(
942 requests: readonly SmokeRequest[],
943 summary: Pick<SmokeSummary, 'loggedBy' | 'tracedIds'>,
944 maxLossRate: number,
945): TelemetryLoss {
946 const ids: LostId[] = []
947 const counted = new Set<string>()
948 for (const request of requests) {
949 if (counted.has(request.id)) continue
950 counted.add(request.id)
951 const logged = mapGet(summary.loggedBy, request.id)
952 const log = (logged.tag === 'some' ? logged.value.size : 0) === 0
953 const trace = !summary.tracedIds.has(request.id)
954 if (log || trace) ids.push({ id: request.id, step: request.step, log, trace })
955 }
956 const total = counted.size
957 const rate = total === 0 ? 0 : ids.length / total
958 return { total, count: ids.length, rate, maxLossRate, exceeded: rate > maxLossRate, ids }
959}
961export function lossLine(loss: TelemetryLoss): string {
962 return `telemetry loss ${loss.count}/${loss.total} (${(loss.rate * 100).toFixed(1)}%, max ${(loss.maxLossRate * 100).toFixed(1)}%)`
963}
965export function judgeSmokeTelemetry(input: {
966 readonly version: string
967 readonly requests: readonly SmokeRequest[]
968 readonly summary: SmokeSummary
969 readonly ceilings: { readonly cpuMs: LatencyCeiling; readonly wallMs: LatencyCeiling; readonly fetchMs: LatencyCeiling }
970 /** Policy `telemetry.maxLossRate`. Null uses the default. Loss at or below it is informational. */
971 readonly maxLossRate: number | null
972}): SmokeJudge {
973 const { version, requests, summary, ceilings } = input
974 const maxLossRate = input.maxLossRate === null ? DEFAULT_MAX_LOSS_RATE : input.maxLossRate
975 const loss = telemetryLoss(requests, summary, maxLossRate)
976 const decided = verdict({
977 version,
978 requests: requests.map(request => ({ id: request.id, version: request.version, step: request.step })),
979 loggedBy: summary.loggedBy,
980 health: { nonOk: summary.health.nonOk, fivexx: summary.health.fivexx, errorLogs: summary.health.errorLogs },
981 })
982 const checks: (ObservedFault | UnevaluableCheck)[] = []
983 for (const request of requests) {
984 if (!request.expected.includes(request.status)) {
985 checks.push({ kind: 'unexpected-status', id: request.id, status: request.status })
986 }
987 }
988 if (summary.health.exceptions > 0) checks.push({ kind: 'exception', detail: `${summary.health.exceptions} exceptions` })
989 if (summary.health.fivexx > 0) checks.push({ kind: 'fivexx', detail: `${summary.health.fivexx} 5xx logs` })
990 if (summary.health.nonOk > 0) checks.push({ kind: 'non-ok', detail: `${summary.health.nonOk} non-ok outcomes` })
991 if (summary.health.errorLogs > 0) checks.push({ kind: 'log-error', detail: `${summary.health.errorLogs} error logs` })
992 if (decided.otherVersion.length > 0) {
993 checks.push({ kind: 'other-version', detail: `${decided.otherVersion.length} logged by another version` })
994 }
995 if (requests.length === 0 || decided.matched === 0) {
996 checks.push({ kind: 'missing', detail: requests.length === 0 ? 'smoke recorded no requests' : 'zero invocations matched the smoke' })
997 } else {
998 if (loss.exceeded) checks.push({ kind: 'telemetry-loss', detail: lossLine(loss) })
999 checks.push(...latencyChecks('wall', summary.wallMs, ceilings.wallMs))
1000 checks.push(...latencyChecks('cpu', summary.cpuMs, ceilings.cpuMs))
1001 if (summary.spanShape === 'summaries') {
1002 checks.push({ kind: 'shape', detail: 'span query returned trace summaries with no child spans' })
1003 } else {
1004 checks.push(...latencyChecks('fetch', summary.fetchMs, ceilings.fetchMs))
1005 }
1006 }
1007 // Lost ids are counted by `loss`. An id no response proved the version for still cannot be judged.
1008 if (decided.unconfirmed.length > 0) {
1009 checks.push({ kind: 'missing', detail: `${decided.unconfirmed.length} lost without x-ply-version ${version} recorded by the smoke` })
1010 }
1011 const observed = checks.filter(isObserved)
1012 const unevaluable = checks.filter((check): check is UnevaluableCheck => !isObserved(check))
1013 const line = checks.length === 0 && decided.pass
1014 ? decided.line
1015 : `${decided.line}${checks.length ? `; ${checks.map(check => check.kind).join(', ')}` : ''}`
1016 let fromLogs = 0
1017 for (const request of requests) {
1018 const logged = mapGet(summary.loggedBy, request.id)
1019 if (logged.tag === 'some' && logged.value.has(version)) fromLogs += 1
1020 }
1021 const joined = summary.tracedIds.size
1022 const join = { smoke: requests.length, invocations: Math.max(summary.invocations, fromLogs), joined }
1023 if (observed.length > 0) return { kind: 'worker', failures: observed, line, verdict: decided }
1024 if (implausibleJoin(join)) {
1025 const compared = Math.min(join.invocations, join.smoke)
1026 const reason = `span join matched ${joined}/${compared} invocations the worker logged`
1027 return {
1028 kind: 'harness_fault',
1029 line: `telemetry: harness_fault: ${reason}`,
1030 reason,
1031 checks: [{ kind: 'join', detail: reason }, ...unevaluable],
1032 verdict: decided,
1033 }
1034 }
1035 // `decided.pass` also fails on lost > allowance. That is loss, judged above against maxLossRate.
1036 const decidedFault = decided.otherVersion.length > 0 || decided.unconfirmed.length > 0
1037 if (unevaluable.length > 0 || decidedFault) {
1038 const reason = unevaluable.map(check => `${check.kind}: ${check.detail}`).join('; ') || decided.line
1039 return { kind: 'harness_fault', line: `telemetry: harness_fault: ${reason}`, reason, checks: unevaluable, verdict: decided }
1040 }
1041 return { kind: 'pass', failures: [], line: loss.count > 0 ? `${line}; ${lossLine(loss)} informational` : line, verdict: decided }
1042}
1044export function telemetryMarkdown(input: {
1045 readonly version: string
1046 readonly from: number
1047 readonly to: number
1048 readonly judge: SmokeJudge
1049 readonly summary: SmokeSummary
1050 readonly loss: TelemetryLoss
1051}): string {
1052 const { version, from, to, judge, summary, loss } = input
1053 const lines = [
1054 `# Telemetry ${version}`,
1055 '',
1056 `Window ${new Date(from).toISOString()} .. ${new Date(to).toISOString()}`,
1057 '',
1058 judge.line,
1059 '',
1060 `- invocations matched: ${judge.verdict.matched}/${judge.verdict.total}`,
1061 `- ${lossLine(loss)}${loss.exceeded ? ' EXCEEDED' : ' informational'}`,
1062 `- non-ok ${summary.health.nonOk}, 5xx ${summary.health.fivexx}, error logs ${summary.health.errorLogs}, exceptions ${summary.health.exceptions}`,
1063 `- wall p50/p99 ${percentileLabel(summary.wallMs, 0.5)} / ${percentileLabel(summary.wallMs, 0.99)} ms`,
1064 `- cpu p50/p99 ${percentileLabel(summary.cpuMs, 0.5)} / ${percentileLabel(summary.cpuMs, 0.99)} ms`,
1065 `- fetch p50/p99 ${percentileLabel(summary.fetchMs, 0.5)} / ${percentileLabel(summary.fetchMs, 0.99)} ms`,
1066 `- traces for ${summary.tracedIds.size} smoke requests; ${summary.invocations} invocations logged by the worker`,
1067 ]
1068 if (loss.count > 0) {
1069 lines.push('', '## Telemetry loss', '', '| id | step | log | trace |', '| --- | --- | --- | --- |')
1070 for (const lost of loss.ids) lines.push(`| ${lost.id} | ${lost.step} | ${lost.log ? 'missing' : 'ok'} | ${lost.trace ? 'missing' : 'ok'} |`)
1071 }
1072 if (judge.kind === 'harness_fault') {
1073 lines.push('', '## Harness fault', '', judge.reason)
1074 } else if (judge.failures.length) {
1075 lines.push('', '## Failures', '')
1076 for (const failure of judge.failures) lines.push(`- ${failure.kind}: ${'detail' in failure ? failure.detail : JSON.stringify(failure)}`)
1077 }
1078 return lines.join('\n') + '\n'
1079}
Diagnostics4 git calls · 445 ms
CallStatusSizeTime0445 ms
discover200152 B4 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=4 git.response.bytes=152 git.server.agent=gitty/1.0 git.server.object_format=sha1 git.server.caps=agent ls-refs fetch object-format git.server.fetch=shallow filter sideband-all git.protocol.version=2 git.pkt.frames=8 git.pkt.data=6 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=152 git.pkt.payload.max=34
ls-refs200145 B · hit4 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=4 git.response.bytes=145 git.response.cache=HIT git.response.duration_ms=4 git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=145 git.pkt.payload.max=76 git.ls_refs.count=2 git.ls_refs.head=refs/heads/main
fetchblob:none · deepen 1020040 KiB · hit4 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=4 git.response.bytes=41349 git.response.cache=HIT git.response.duration_ms=4 git.fetch.filter=blob:none git.fetch.filter.requested=tree:0 git.fetch.filter.fallback=blob:none git.fetch.filter.learned=false git.fetch.wants=526b305930b8ef382f2d7a1f9c0238730a585921 git.fetch.haves.count=0 git.fetch.deepen=10 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=6 git.pkt.data=4 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=41349 git.pkt.payload.max=41254 git.sideband.band1.bytes=41253 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=61 git.pack.bytes=41253 git.pack.ofs_delta=0 git.pack.ref_delta=0 git.pack.chain.max=0 git.pack.trailer=ab60efef4b7243678c75de64a4386986ee885c1c git.pack.full=61Open pack map
fetch20011 KiB437 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=437 git.response.bytes=11413 git.response.cache=MISS git.response.duration_ms=437 git.fetch.wants=ce094d86a4876aaeb1db1c14d186832d734dd239 git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=11413 git.pkt.payload.max=11392 git.sideband.band1.bytes=11391 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0
Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.
- Remote
- https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/ply-web.git
- Ref
- refs/heads/main
- Commit
- 526b305930b8ef382f2d7a1f9c0238730a585921
- cf-ray
- a5e2bc691cabcfc3
- Request
- 9356831a…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format