@downtrace/protocol 0.7.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/dist/index.d.ts +435 -20
- package/dist/index.js +325 -23
- package/package.json +1 -1
- package/schema/v0/aggregates.schema.json +108 -13
- package/schema/v0/capture-evidence.schema.json +159 -4
- package/schema/v0/fixtures/evidence/invalid/coarse-second-without-its-calls.json +20 -0
- package/schema/v0/fixtures/evidence/invalid/dependencies-truncated-negative.json +14 -0
- package/schema/v0/fixtures/evidence/invalid/dependencies-truncated-not-a-boolean.json +24 -0
- package/schema/v0/fixtures/evidence/invalid/operation-of-an-unknown-kind.json +33 -0
- package/schema/v0/fixtures/evidence/invalid/shed-with-an-extra-field.json +14 -0
- package/schema/v0/fixtures/evidence/invalid/shed-with-unknown-reason.json +14 -0
- package/schema/v0/fixtures/evidence/invalid/shed-with-zero-ms.json +14 -0
- package/schema/v0/fixtures/evidence/valid/with-coarse.json +40 -0
- package/schema/v0/fixtures/evidence/valid/with-dependencies-truncated.json +32 -0
- package/schema/v0/fixtures/evidence/valid/with-operation-kinds.json +57 -0
- package/schema/v0/fixtures/evidence/valid/with-shed.json +31 -0
- package/schema/v0/fixtures/invalid/a-running-total-of-nothing.json +27 -0
- package/schema/v0/fixtures/invalid/an-ending-nobody-declared.json +46 -0
- package/schema/v0/fixtures/invalid/call-with-a-path.json +38 -0
- package/schema/v0/fixtures/invalid/call-with-a-query-string.json +38 -0
- package/schema/v0/fixtures/invalid/command-with-its-key.json +38 -0
- package/schema/v0/fixtures/invalid/context-that-is-not-flat.json +40 -0
- package/schema/v0/fixtures/invalid/error-sources-with-a-call.json +49 -0
- package/schema/v0/fixtures/invalid/error-sources-with-a-query.json +49 -0
- package/schema/v0/fixtures/invalid/error-sources-with-a-repeat.json +49 -0
- package/schema/v0/fixtures/invalid/error-sources-with-an-unknown-value.json +49 -0
- package/schema/v0/fixtures/invalid/operation-of-an-unknown-kind.json +37 -0
- package/schema/v0/fixtures/valid/calls-and-commands.json +59 -0
- package/schema/v0/fixtures/valid/dropped-exceptions.json +56 -0
- package/schema/v0/fixtures/valid/error-sources.json +49 -0
- package/schema/v0/fixtures/valid/exceptions-with-a-running-total.json +38 -0
- package/schema/v0/fixtures/valid/exceptions-without-intervals.json +37 -0
- package/schema/v0/fixtures/valid/reported-errors.json +97 -0
- package/schema/v0/fixtures/valid/the-last-batch-of-a-process.json +59 -0
- package/schema/v0/fixtures/valid/triggers-without-intervals.json +28 -0
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"properties": {
|
|
11
11
|
"protocol": {
|
|
12
12
|
"type": "string",
|
|
13
|
-
"enum": ["0.1.0", "0.2.0", "0.3.0", "0.4.0", "0.5.0", "0.6.0", "0.7.0"],
|
|
13
|
+
"enum": ["0.1.0", "0.2.0", "0.3.0", "0.4.0", "0.5.0", "0.6.0", "0.7.0", "0.8.0", "0.9.0"],
|
|
14
14
|
"description": "Protocol version this batch conforms to. Every published minor of v0 stays acceptable."
|
|
15
15
|
},
|
|
16
16
|
"agent": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"items": {
|
|
30
30
|
"$ref": "#/$defs/Interval"
|
|
31
31
|
},
|
|
32
|
-
"description": "The intervals this batch carries. May be empty
|
|
32
|
+
"description": "The intervals this batch carries. May be empty whenever the batch carries anything else: a process that serves no requests closes no interval, and nothing else a batch carries hangs off one — tying delivery to an interval lost the profile at every shutdown (gh-375) and every exception of a process with no traffic (gh-627). A batch that carries nothing at all is refused by the cloud with a reason, which the schema cannot say without making the generated types unusable."
|
|
33
33
|
},
|
|
34
34
|
"profile": {
|
|
35
35
|
"$ref": "#/$defs/Profile"
|
|
@@ -56,7 +56,11 @@
|
|
|
56
56
|
"items": {
|
|
57
57
|
"$ref": "#/$defs/LocalTrigger"
|
|
58
58
|
},
|
|
59
|
-
"description": "Local signals that ask for a capture. `product.md:124` gives the instrumentation «
|
|
59
|
+
"description": "Local signals that ask for a capture. `product.md:124` gives the instrumentation «trigger on local signals»: it sees a process in trouble before any aggregate crosses the cloud, and asking in the batch costs no channel of its own — the answer already carries the orders (ADR 0071). Absent from every sender that predates it and from every batch with nothing to ask. The cloud decides: the same budget, cooldown and concurrency as any other capture (`product.md:122`), and a refusal is silence, because there is nothing the instrumentation would do differently."
|
|
60
|
+
},
|
|
61
|
+
"ending": {
|
|
62
|
+
"enum": ["signal", "exit", "idle"],
|
|
63
|
+
"description": "This batch is the last one: the process is leaving deliberately and has already been handed everything the instrumentation was holding. `signal`, a SIGTERM or SIGINT the instrumentation's own handler saw; `exit`, an application that awaited `shutdown()` before calling `process.exit()`; `idle`, an event loop that emptied. Absent means **this sender did not say**, the same reading as `observers` \u2014 never that it ended badly: an instrumentation older than this never says it, and a process an exception killed says nothing because it cannot. It is the half of ERR-04 the cloud cannot infer \u2014 from outside, every ending looks like batches stopping \u2014 and it carries no instant, because the one that matters is when the batch arrived, which the cloud measures."
|
|
60
64
|
}
|
|
61
65
|
},
|
|
62
66
|
"$defs": {
|
|
@@ -94,10 +98,50 @@
|
|
|
94
98
|
},
|
|
95
99
|
"resources": {
|
|
96
100
|
"$ref": "#/$defs/AgentResources",
|
|
97
|
-
"description": "What the instrumentation costs and what it has lost, measured by itself. Absent means **this sender did not say**, the same reading as `observers` and `withholding`. `product.md:239` asks for it by name: «
|
|
101
|
+
"description": "What the instrumentation costs and what it has lost, measured by itself. Absent means **this sender did not say**, the same reading as `observers` and `withholding`. `product.md:239` asks for it by name: «measured internal resources»."
|
|
102
|
+
},
|
|
103
|
+
"errorSources": {
|
|
104
|
+
"$ref": "#/$defs/ErrorSources",
|
|
105
|
+
"description": "Which of the sources of error this process has connected, as of the moment this batch is sealed. A source is on its list when the process has, at that moment, the instrumentation that produces it installed; the application calling `captureException` does not make it one without the hook connected. Absent means **this sender did not say**, the same reading as `observers` and `resources`: an instrumentation older than protocol 0.9.0 says nothing, and the two lists left empty are not the same thing, because they are a statement — the sender says it has connected no source of error."
|
|
98
106
|
}
|
|
99
107
|
}
|
|
100
108
|
},
|
|
109
|
+
"ErrorSources": {
|
|
110
|
+
"title": "ErrorSources",
|
|
111
|
+
"type": "object",
|
|
112
|
+
"additionalProperties": false,
|
|
113
|
+
"required": ["inRequest", "outsideRequest"],
|
|
114
|
+
"properties": {
|
|
115
|
+
"inRequest": {
|
|
116
|
+
"type": "array",
|
|
117
|
+
"uniqueItems": true,
|
|
118
|
+
"items": {
|
|
119
|
+
"$ref": "#/$defs/InRequestErrorSource"
|
|
120
|
+
},
|
|
121
|
+
"description": "The sources of the errors this process sees inside a request, by the value of `Operation.kind` they arrive as, among the values `x-error` marks as errors: `error`, an instrumented operation failed; `framework`, the exception reached the framework's error path and was turned into a 5xx; `explicit`, the application handed it over itself. No value appears twice."
|
|
122
|
+
},
|
|
123
|
+
"outsideRequest": {
|
|
124
|
+
"type": "array",
|
|
125
|
+
"uniqueItems": true,
|
|
126
|
+
"items": {
|
|
127
|
+
"$ref": "#/$defs/OutsideRequestErrorSource"
|
|
128
|
+
},
|
|
129
|
+
"description": "The sources of the errors this process sees outside any request, by the value of `ProcessException.kind`: `uncaught`, an exception nothing caught; `unhandled-rejection`, a promise rejected with nothing to handle it; `framework`, one that reached a framework's error path; `explicit`, one the application handed over itself. No value appears twice."
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"InRequestErrorSource": {
|
|
134
|
+
"title": "InRequestErrorSource",
|
|
135
|
+
"type": "string",
|
|
136
|
+
"enum": ["error", "framework", "explicit"],
|
|
137
|
+
"description": "A value of `Operation.kind` that its `x-error` marks as an error: the ways an error inside a request arrives, and so the sources that can produce one. A query, an outgoing call and a Redis command are things a route ran, never a source of error."
|
|
138
|
+
},
|
|
139
|
+
"OutsideRequestErrorSource": {
|
|
140
|
+
"title": "OutsideRequestErrorSource",
|
|
141
|
+
"type": "string",
|
|
142
|
+
"enum": ["uncaught", "unhandled-rejection", "framework", "explicit"],
|
|
143
|
+
"description": "A value of `ProcessException.kind`: the ways an error outside any request arrives, and so the sources that can produce one."
|
|
144
|
+
},
|
|
101
145
|
"InstanceInfo": {
|
|
102
146
|
"title": "InstanceInfo",
|
|
103
147
|
"type": "object",
|
|
@@ -460,8 +504,24 @@
|
|
|
460
504
|
"required": ["kind", "hash", "count", "totalMs"],
|
|
461
505
|
"properties": {
|
|
462
506
|
"kind": {
|
|
463
|
-
"enum": ["query", "error"],
|
|
464
|
-
"
|
|
507
|
+
"enum": ["query", "error", "framework", "explicit", "call", "command"],
|
|
508
|
+
"x-since": {
|
|
509
|
+
"query": "0.6.0",
|
|
510
|
+
"error": "0.6.0",
|
|
511
|
+
"framework": "0.9.0",
|
|
512
|
+
"explicit": "0.9.0",
|
|
513
|
+
"call": "0.9.0",
|
|
514
|
+
"command": "0.9.0"
|
|
515
|
+
},
|
|
516
|
+
"x-error": {
|
|
517
|
+
"query": false,
|
|
518
|
+
"error": true,
|
|
519
|
+
"framework": true,
|
|
520
|
+
"explicit": true,
|
|
521
|
+
"call": false,
|
|
522
|
+
"command": false
|
|
523
|
+
},
|
|
524
|
+
"description": "What kind of operation this is. Three are things the route ran: `query`, a query to a database; `call`, an outgoing HTTP call, identified by its method and its host; `command`, a Redis command, identified by its name and its server. The other three are errors, and which one it is says how the instrumentation came to see it: `error`, an instrumented operation failed; `framework`, the exception reached the framework's error path and was turned into a 5xx; `explicit`, the application handed it over itself (ERR-02). `x-since` says which minor first carries each value, which is how a reader tells a kind a sender cannot send from one it did not; `x-error` says which values are errors, which is what a list of errors takes and the rest never reach (ERR-01)."
|
|
465
525
|
},
|
|
466
526
|
"hash": {
|
|
467
527
|
"type": "string",
|
|
@@ -472,7 +532,7 @@
|
|
|
472
532
|
"text": {
|
|
473
533
|
"type": "string",
|
|
474
534
|
"maxLength": 1024,
|
|
475
|
-
"description": "Normalised text, e.g. `SELECT id FROM products WHERE id =
|
|
535
|
+
"description": "Normalised text, e.g. `SELECT id FROM products WHERE id = ?` for a query, `POST api.stripe.com` for a call and `HGETALL cache:6379` for a command. A call's and a command's are a word and the place it went — the method and the host, the command's name and its server — and never a path, a query string, a key or an argument (invariant 5): the schema refuses one with anything after the place, or a slash, a question mark or a hash in it. Optional: a user who would rather not send it keeps the whole analysis, only without the label, and a sender in minimal mode, or one withholding the name of the dependency, sends none."
|
|
476
536
|
},
|
|
477
537
|
"count": {
|
|
478
538
|
"type": "integer",
|
|
@@ -494,9 +554,12 @@
|
|
|
494
554
|
"minimum": 0,
|
|
495
555
|
"description": "Only on the `(other)` bucket: how many distinct operations it merges, so a cap does not become a lie by omission."
|
|
496
556
|
},
|
|
557
|
+
"context": {
|
|
558
|
+
"$ref": "#/$defs/ReportedContext"
|
|
559
|
+
},
|
|
497
560
|
"class": {
|
|
498
561
|
"enum": ["select", "insert", "update", "delete", "other"],
|
|
499
|
-
"description": "What kind of statement this is, when the sender could not normalise it safely. Its presence is the reason the text is absent: `product.md:104` says a query the normaliser does not understand travels «
|
|
562
|
+
"description": "What kind of statement this is, when the sender could not normalise it safely. Its presence is the reason the text is absent: `product.md:104` says a query the normaliser does not understand travels «only as hash and class», and this is the class. Never sent together with `text` — they are two answers to the same question. Our word and not the service's: it is decided from the first keyword, which is all that can be told without understanding the rest (gh-344)."
|
|
500
563
|
}
|
|
501
564
|
},
|
|
502
565
|
"not": {
|
|
@@ -505,6 +568,16 @@
|
|
|
505
568
|
"class": {},
|
|
506
569
|
"text": {}
|
|
507
570
|
}
|
|
571
|
+
},
|
|
572
|
+
"if": {
|
|
573
|
+
"properties": {
|
|
574
|
+
"kind": { "enum": ["call", "command"] }
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
"then": {
|
|
578
|
+
"properties": {
|
|
579
|
+
"text": { "type": "string", "pattern": "^[A-Z][A-Z0-9._-]* [^\\s/?#]+$" }
|
|
580
|
+
}
|
|
508
581
|
}
|
|
509
582
|
},
|
|
510
583
|
"ObserverState": {
|
|
@@ -580,11 +653,12 @@
|
|
|
580
653
|
"type": "object",
|
|
581
654
|
"additionalProperties": false,
|
|
582
655
|
"required": ["kind", "hash", "count"],
|
|
583
|
-
"description": "Something thrown outside any instrumented operation: an exception nobody caught, or a promise rejected with no `catch`. `product.md:77` asks for «
|
|
656
|
+
"description": "Something thrown outside any instrumented operation: an exception nobody caught, or a promise rejected with no `catch`. `product.md:77` asks for «errors and exceptions», and these are the two the word «excepciones» names. They live on the batch and not in the profile because they have **no route** — they happen outside a request's life, or after it ended — and filing them under a route that is not theirs would be worse than not having them (gh-341, ADR 0102).",
|
|
584
657
|
"properties": {
|
|
585
658
|
"kind": {
|
|
586
|
-
"enum": ["uncaught", "unhandled-rejection"],
|
|
587
|
-
"
|
|
659
|
+
"enum": ["uncaught", "unhandled-rejection", "framework", "explicit"],
|
|
660
|
+
"x-since": { "uncaught": "0.7.0", "unhandled-rejection": "0.7.0", "framework": "0.9.0", "explicit": "0.9.0" },
|
|
661
|
+
"description": "How the process came to see it. `uncaught` and `unhandled-rejection` are two different failures with two different fixes, and counting them together hides which one is happening. `explicit` is an error the application handed over while no request was being served, and `framework` one that reached a framework's error path outside any observed request — a process that is not opening request contexts at all (ERR-02). `x-since` says which minor first carries each value."
|
|
588
662
|
},
|
|
589
663
|
"hash": {
|
|
590
664
|
"type": "string",
|
|
@@ -600,10 +674,26 @@
|
|
|
600
674
|
"count": {
|
|
601
675
|
"type": "integer",
|
|
602
676
|
"minimum": 1,
|
|
603
|
-
"description": "How many times this signature happened. An instant per occurrence would be a row per crash of a process that crashes in a loop; what a reader asks is how many."
|
|
677
|
+
"description": "How many times this signature happened since the last delivery this sender heard land. An instant per occurrence would be a row per crash of a process that crashes in a loop; what a reader asks is how many."
|
|
678
|
+
},
|
|
679
|
+
"total": {
|
|
680
|
+
"type": "integer",
|
|
681
|
+
"minimum": 1,
|
|
682
|
+
"description": "Since 0.9.0: how many times this signature has happened in this instance since it started, a running total every delivery of the signature carries again. It is what lets the cloud tell a delivery it already applied from one that happened again (gh-625): `total - count` is what the sender knows was applied, the cloud keeps the largest total it applied per instance and signature, and it counts only what this delivery adds beyond both — so a delivery sent again after its answer was lost, sent twice, or overtaken by a later one adds nothing, and one that never arrived is counted by the next. It never goes down while `instance.id` stays the same, which is why that id is generated once per process. Absent from every sender older than this, and from a signature past the number a sender keeps totals for: the cloud then counts `count` as delivered, and says so."
|
|
683
|
+
},
|
|
684
|
+
"context": {
|
|
685
|
+
"$ref": "#/$defs/ReportedContext"
|
|
604
686
|
}
|
|
605
687
|
}
|
|
606
688
|
},
|
|
689
|
+
"ReportedContext": {
|
|
690
|
+
"title": "ReportedContext",
|
|
691
|
+
"type": "object",
|
|
692
|
+
"maxProperties": 8,
|
|
693
|
+
"propertyNames": { "maxLength": 32 },
|
|
694
|
+
"additionalProperties": { "type": "string", "maxLength": 64 },
|
|
695
|
+
"description": "The structural context an application attached to an error it reported (ERR-02, since 0.9.0). Flat and small on purpose: what travels is the shape of the failure, never its contents (invariant 5). Every value has been through the same sanitising as an error message before it got here, so anything that looked like a value is already a `?`, and there is nothing per user in it (IMP-01). It is the context of the **first** occurrence of the signature in this window, because what travels is counted per signature and not per occurrence. Absent is the normal case: an error nobody attached a context to carries none."
|
|
696
|
+
},
|
|
607
697
|
"LocalTrigger": {
|
|
608
698
|
"type": "object",
|
|
609
699
|
"title": "LocalTrigger",
|
|
@@ -664,6 +754,11 @@
|
|
|
664
754
|
"minimum": 0,
|
|
665
755
|
"description": "Errors inside the instrumentation itself, since the previous batch. It disables itself after enough of them, and a sender that has gone quiet with these climbing is not a quiet service."
|
|
666
756
|
},
|
|
757
|
+
"droppedExceptions": {
|
|
758
|
+
"type": "integer",
|
|
759
|
+
"minimum": 0,
|
|
760
|
+
"description": "Exception events the instrumentation discarded because they did not fit in its caps of distinct signatures — the register's window, and the sender's accumulation while batches do not land — since the previous batch. An occurrence, never a signature: the sender cannot name what it did not admit without remembering it, and remembering is the growth the cap exists to stop. This is what happened and is gone, the same kind of number as droppedBatches, for the errors a process throws outside any request: a batch that says 32 and was handed 35 must not leave the other 3 to be read as errors that did not happen (COB-01, invariant 14)."
|
|
761
|
+
},
|
|
667
762
|
"bufferBytes": {
|
|
668
763
|
"type": "integer",
|
|
669
764
|
"minimum": 0,
|
|
@@ -677,7 +772,7 @@
|
|
|
677
772
|
"shed": {
|
|
678
773
|
"type": "string",
|
|
679
774
|
"enum": ["nothing", "fine", "profile"],
|
|
680
|
-
"description": "What the instrumentation has given up because it was costing too much, cheapest loss first. `product.md:241` asks for both halves —«
|
|
775
|
+
"description": "What the instrumentation has given up because it was costing too much, cheapest loss first. `product.md:241` asks for both halves —«it throttles itself» and «records it as a loss of coverage»— and this is the second. An enum and not free text: it is ours, and it has to be comparable between senders."
|
|
681
776
|
},
|
|
682
777
|
"shedReason": {
|
|
683
778
|
"type": "string",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://downtrace.io/schema/v0/capture-evidence.schema.json",
|
|
4
4
|
"title": "CaptureEvidence",
|
|
5
|
-
"description": "What an instrumentation sends back for a capture the cloud asked for (POST /v0/captures/{id}/evidence). It is the contents of the black box
|
|
5
|
+
"description": "What an instrumentation sends back for a capture the cloud asked for (POST /v0/captures/{id}/evidence). It is the contents of the black box, frozen: the fine register's requests with their operations, in order, with starts and ends, and the coarse summary of the previous minutes, second by second. Hashes only — the text of a query never travels here (invariant 5). Its own path and not the aggregates batch, because a batch is what goes out every ten seconds and this is a rare event several orders of magnitude larger.",
|
|
6
6
|
"x-evidence-path": "/v0/captures/{id}/evidence",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"additionalProperties": false,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"protocol": {
|
|
12
12
|
"type": "string",
|
|
13
13
|
"description": "Protocol version this payload conforms to. Same enum as a batch: every published minor of v0 stays acceptable.",
|
|
14
|
-
"enum": ["0.1.0", "0.2.0", "0.3.0", "0.4.0", "0.5.0", "0.6.0", "0.7.0"]
|
|
14
|
+
"enum": ["0.1.0", "0.2.0", "0.3.0", "0.4.0", "0.5.0", "0.6.0", "0.7.0", "0.8.0", "0.9.0"]
|
|
15
15
|
},
|
|
16
16
|
"instance": {
|
|
17
17
|
"type": "object",
|
|
@@ -57,6 +57,9 @@
|
|
|
57
57
|
},
|
|
58
58
|
"reference": {
|
|
59
59
|
"$ref": "#/$defs/Reference"
|
|
60
|
+
},
|
|
61
|
+
"coarse": {
|
|
62
|
+
"$ref": "#/$defs/CoarseSummary"
|
|
60
63
|
}
|
|
61
64
|
},
|
|
62
65
|
"$defs": {
|
|
@@ -86,6 +89,33 @@
|
|
|
86
89
|
"type": "integer",
|
|
87
90
|
"minimum": 0,
|
|
88
91
|
"description": "Requests that ran more operations than the register keeps per request. Their count is real and their list is not complete."
|
|
92
|
+
},
|
|
93
|
+
"shed": {
|
|
94
|
+
"$ref": "#/$defs/Shed"
|
|
95
|
+
},
|
|
96
|
+
"dependenciesTruncated": {
|
|
97
|
+
"type": "integer",
|
|
98
|
+
"minimum": 0,
|
|
99
|
+
"description": "Requests whose list of dependencies was truncated. Their count is real and their list is not complete."
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"Shed": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"title": "Shed",
|
|
106
|
+
"additionalProperties": false,
|
|
107
|
+
"required": ["ms", "reason"],
|
|
108
|
+
"description": "The time inside [startedAt, endedAt] when the instrumentation was not writing the fine detail — neither the register's ring nor the reserve — because it was shedding it. Present when some part of the window was shed, absent when there was no shedding, when the shedding came from configuration (`DOWNTRACE_SHED`, the benchmark) and so the instrumentation never decided it, or when the instrumentation predates the field: a sender older than the field sends nothing, and the cloud stores the absence as such (ADR 0008). The capture is still taken, not refused: the window can end before the shedding does, the coarse register keeps measuring, and the protocol has no way for an instance to refuse an order — saying it in the evidence is what CAP-01 asks for.",
|
|
109
|
+
"properties": {
|
|
110
|
+
"ms": {
|
|
111
|
+
"type": "integer",
|
|
112
|
+
"minimum": 1,
|
|
113
|
+
"description": "How long the shedding lasted, in whole milliseconds, rounded up: one millisecond of shedding is still shedding, and the field says so rather than rounding it into silence."
|
|
114
|
+
},
|
|
115
|
+
"reason": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"enum": ["latency", "memory"],
|
|
118
|
+
"description": "The last reason in force inside the window, the same enum as `agent.resources.shedReason` in the batch: why it gave ground. One value and not a list: a window that shed for two reasons is read as the one in force when it ended, which is the one still changing what arrives."
|
|
89
119
|
}
|
|
90
120
|
}
|
|
91
121
|
},
|
|
@@ -118,6 +148,11 @@
|
|
|
118
148
|
"type": "number",
|
|
119
149
|
"minimum": 0
|
|
120
150
|
},
|
|
151
|
+
"poolWaitMs": {
|
|
152
|
+
"type": "number",
|
|
153
|
+
"minimum": 0,
|
|
154
|
+
"description": "How long this request waited for a connection from a pool before it could talk to the dependency at all. **Absent means this request asked no pool**, which is not a wait of zero: zero is a request that asked and was served at once. The pool-saturation trigger compares wait per request, so a route that never queues must not read as one that queues for nothing (invariant 14)."
|
|
155
|
+
},
|
|
121
156
|
"operations": {
|
|
122
157
|
"type": "array",
|
|
123
158
|
"maxItems": 256,
|
|
@@ -133,6 +168,10 @@
|
|
|
133
168
|
"detailLost": {
|
|
134
169
|
"type": "boolean",
|
|
135
170
|
"description": "This request's operations were overwritten before they were read. Absent means false. Its timing is still true."
|
|
171
|
+
},
|
|
172
|
+
"dependenciesTruncated": {
|
|
173
|
+
"type": "boolean",
|
|
174
|
+
"description": "This request's list of dependencies did not fit and was truncated to what the register keeps per request. A dependency not in the list is not proven not to have been used (invariant 14). Absent means false."
|
|
136
175
|
}
|
|
137
176
|
}
|
|
138
177
|
},
|
|
@@ -143,6 +182,10 @@
|
|
|
143
182
|
"required": ["hash", "startMs", "endMs"],
|
|
144
183
|
"description": "One operation inside a request. Starts and ends and not durations, because the whole reason for capturing detail is order and overlap, which a duration cannot express (ADR 0068).",
|
|
145
184
|
"properties": {
|
|
185
|
+
"kind": {
|
|
186
|
+
"enum": ["query", "error", "framework", "explicit", "call", "command"],
|
|
187
|
+
"description": "What kind of operation this is, in the words of the batch's `Operation.kind`, whose enum this borrows: a query, an outgoing call or a Redis command the request ran, or one of the kinds of error recorded in it beside what failed. Since 0.9.0. **Absent means the sender did not say**, never a query: an instrumentation older than the field wrote every operation it recorded here without one, the error signatures beside a failed query among them, and a reader that took them for queries would be naming what it was not told."
|
|
188
|
+
},
|
|
146
189
|
"hash": {
|
|
147
190
|
"type": "string",
|
|
148
191
|
"minLength": 1,
|
|
@@ -165,7 +208,7 @@
|
|
|
165
208
|
"title": "ReferenceSamples",
|
|
166
209
|
"additionalProperties": false,
|
|
167
210
|
"required": ["selection", "population", "samples"],
|
|
168
|
-
"description": "A few requests of each endpoint kept as something to compare the captured ones against. `product.md:100`: «
|
|
211
|
+
"description": "A few requests of each endpoint kept as something to compare the captured ones against. `product.md:100`: «Comparing degraded requests against reference requests requires keeping both; the fine detail of an hour ago no longer exists». Being earlier does not certify health, which is why every field here is about how they were chosen and none of them says «healthy».",
|
|
169
212
|
"properties": {
|
|
170
213
|
"selection": {
|
|
171
214
|
"type": "string",
|
|
@@ -180,7 +223,7 @@
|
|
|
180
223
|
"routesDropped": {
|
|
181
224
|
"type": "integer",
|
|
182
225
|
"minimum": 0,
|
|
183
|
-
"description": "
|
|
226
|
+
"description": "Routes the register had no row for, folded into one shared row, counted once each. At the register's cap for how many it may remember it is a lower bound: a bounded memory does not count distinct names past its bound, and the volume of what was folded is what the shared row keeps."
|
|
184
227
|
},
|
|
185
228
|
"renewalPaused": {
|
|
186
229
|
"type": "boolean",
|
|
@@ -195,6 +238,118 @@
|
|
|
195
238
|
"description": "The kept requests, in the same shape as the captured ones. An empty array is a real answer: a process that has just started has nothing to compare with yet."
|
|
196
239
|
}
|
|
197
240
|
}
|
|
241
|
+
},
|
|
242
|
+
"CoarseSummary": {
|
|
243
|
+
"type": "object",
|
|
244
|
+
"title": "CoarseSummary",
|
|
245
|
+
"additionalProperties": false,
|
|
246
|
+
"required": ["windowSeconds", "routes", "eventLoop", "routesDropped"],
|
|
247
|
+
"description": "The coarse half of the black box, frozen: the last few minutes, second by second, so a reader can see how something detected late began (`product.md:94`). Sums and a maximum, never percentiles: the interval aggregate answers the percentile question with exactness, and this answers the shape of the change (`product.md:122`). What an older instrumentation did not send is absent from the evidence, and stored as absent.",
|
|
248
|
+
"properties": {
|
|
249
|
+
"windowSeconds": {
|
|
250
|
+
"type": "integer",
|
|
251
|
+
"minimum": 1,
|
|
252
|
+
"description": "How many seconds the summary covers: the length of the register's window, and the most any of the lists below may hold."
|
|
253
|
+
},
|
|
254
|
+
"routesDropped": {
|
|
255
|
+
"type": "integer",
|
|
256
|
+
"minimum": 0,
|
|
257
|
+
"description": "Routes the register had no row for, folded into one shared row, counted once each. At the register's cap for how many it may remember it is a lower bound: a bounded memory does not count distinct names past its bound, and the volume of what was folded is what the shared row keeps."
|
|
258
|
+
},
|
|
259
|
+
"routes": {
|
|
260
|
+
"type": "array",
|
|
261
|
+
"maxItems": 129,
|
|
262
|
+
"items": {
|
|
263
|
+
"$ref": "#/$defs/CoarseRoute"
|
|
264
|
+
},
|
|
265
|
+
"description": "One entry per route with a row of its own, the last being the shared row for what did not fit, when there is one. A route's series starts at the first second this process saw the route: before it, nobody was watching this route, and inventing silence there would say the route was quiet when the truth is that it was unwatched (invariant 14)."
|
|
266
|
+
},
|
|
267
|
+
"eventLoop": {
|
|
268
|
+
"type": "array",
|
|
269
|
+
"maxItems": 300,
|
|
270
|
+
"items": {
|
|
271
|
+
"$ref": "#/$defs/CoarseEventLoopSecond"
|
|
272
|
+
},
|
|
273
|
+
"description": "The process's event loop delay, second by second, in its own series and not attributed to any route: it is the process's, and attributing it to a route would be inventing a measurement. Only the seconds somebody sampled are here: a second with no reading says nothing about the loop, and a zero would say it was idle. An empty array is a real answer: the process had no event loop to sample, or nobody did."
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
"CoarseRoute": {
|
|
278
|
+
"type": "object",
|
|
279
|
+
"title": "CoarseRoute",
|
|
280
|
+
"additionalProperties": false,
|
|
281
|
+
"required": ["method", "route", "seconds"],
|
|
282
|
+
"properties": {
|
|
283
|
+
"method": {
|
|
284
|
+
"type": "string",
|
|
285
|
+
"maxLength": 16
|
|
286
|
+
},
|
|
287
|
+
"route": {
|
|
288
|
+
"type": "string",
|
|
289
|
+
"maxLength": 512,
|
|
290
|
+
"description": "The route template, never the path with its values in it (invariant 5)."
|
|
291
|
+
},
|
|
292
|
+
"seconds": {
|
|
293
|
+
"type": "array",
|
|
294
|
+
"maxItems": 300,
|
|
295
|
+
"items": {
|
|
296
|
+
"$ref": "#/$defs/CoarseSecond"
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
"CoarseSecond": {
|
|
302
|
+
"type": "object",
|
|
303
|
+
"title": "CoarseSecond",
|
|
304
|
+
"additionalProperties": false,
|
|
305
|
+
"required": ["second", "requests", "errors", "latencySumMs", "latencyMaxMs", "calls"],
|
|
306
|
+
"description": "One second of one route. Sums and a maximum, never a histogram: a histogram per second per route would multiply the memory by its buckets to answer a question the interval already answers.",
|
|
307
|
+
"properties": {
|
|
308
|
+
"second": {
|
|
309
|
+
"type": "integer",
|
|
310
|
+
"description": "The Unix second this row covers, an integer instant like the ones a batch writes: a reader aligns it with the dates the evidence writes by flooring them."
|
|
311
|
+
},
|
|
312
|
+
"requests": {
|
|
313
|
+
"type": "integer",
|
|
314
|
+
"minimum": 0,
|
|
315
|
+
"description": "Requests this route answered in this second. Zero is a real answer: a watched second with no traffic, and not an absence."
|
|
316
|
+
},
|
|
317
|
+
"errors": {
|
|
318
|
+
"type": "integer",
|
|
319
|
+
"minimum": 0,
|
|
320
|
+
"description": "Requests that answered 5xx."
|
|
321
|
+
},
|
|
322
|
+
"latencySumMs": {
|
|
323
|
+
"type": "number",
|
|
324
|
+
"minimum": 0
|
|
325
|
+
},
|
|
326
|
+
"latencyMaxMs": {
|
|
327
|
+
"type": "number",
|
|
328
|
+
"minimum": 0
|
|
329
|
+
},
|
|
330
|
+
"calls": {
|
|
331
|
+
"type": "integer",
|
|
332
|
+
"minimum": 0,
|
|
333
|
+
"description": "Operations the requests of this second ran."
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
"CoarseEventLoopSecond": {
|
|
338
|
+
"type": "object",
|
|
339
|
+
"title": "CoarseEventLoopSecond",
|
|
340
|
+
"additionalProperties": false,
|
|
341
|
+
"required": ["second", "maxDelayMs"],
|
|
342
|
+
"properties": {
|
|
343
|
+
"second": {
|
|
344
|
+
"type": "integer",
|
|
345
|
+
"description": "The Unix second this reading covers."
|
|
346
|
+
},
|
|
347
|
+
"maxDelayMs": {
|
|
348
|
+
"type": "number",
|
|
349
|
+
"minimum": 0,
|
|
350
|
+
"description": "The worst delay sampled in this second: a second that stalled once stalled, and averaging it away is how a stall becomes invisible."
|
|
351
|
+
}
|
|
352
|
+
}
|
|
198
353
|
}
|
|
199
354
|
}
|
|
200
355
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"protocol": "0.9.0",
|
|
3
|
+
"instance": { "id": "i-1" },
|
|
4
|
+
"startedAt": "2026-09-10T10:04:00.000Z",
|
|
5
|
+
"endedAt": "2026-09-10T10:05:00.000Z",
|
|
6
|
+
"coverage": { "observedRequests": 1, "attachedRequests": 0, "detailLost": 0, "truncated": 0 },
|
|
7
|
+
"requests": [],
|
|
8
|
+
"coarse": {
|
|
9
|
+
"windowSeconds": 300,
|
|
10
|
+
"routesDropped": 0,
|
|
11
|
+
"routes": [
|
|
12
|
+
{
|
|
13
|
+
"method": "GET",
|
|
14
|
+
"route": "/checkout",
|
|
15
|
+
"seconds": [{ "second": 1757517900, "requests": 4, "errors": 0, "latencySumMs": 48.2, "latencyMaxMs": 12.1 }]
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"eventLoop": []
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"protocol": "0.9.0",
|
|
3
|
+
"instance": { "id": "i-1" },
|
|
4
|
+
"startedAt": "2026-09-10T10:00:00.000Z",
|
|
5
|
+
"endedAt": "2026-09-10T10:01:00.000Z",
|
|
6
|
+
"coverage": {
|
|
7
|
+
"observedRequests": 1,
|
|
8
|
+
"attachedRequests": 0,
|
|
9
|
+
"detailLost": 0,
|
|
10
|
+
"truncated": 0,
|
|
11
|
+
"dependenciesTruncated": -1
|
|
12
|
+
},
|
|
13
|
+
"requests": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"protocol": "0.9.0",
|
|
3
|
+
"instance": { "id": "i-1" },
|
|
4
|
+
"startedAt": "2026-09-10T10:00:00.000Z",
|
|
5
|
+
"endedAt": "2026-09-10T10:01:00.000Z",
|
|
6
|
+
"coverage": {
|
|
7
|
+
"observedRequests": 1,
|
|
8
|
+
"attachedRequests": 0,
|
|
9
|
+
"detailLost": 0,
|
|
10
|
+
"truncated": 0,
|
|
11
|
+
"dependenciesTruncated": 1
|
|
12
|
+
},
|
|
13
|
+
"requests": [
|
|
14
|
+
{
|
|
15
|
+
"method": "GET",
|
|
16
|
+
"route": "/cart",
|
|
17
|
+
"status": 200,
|
|
18
|
+
"startedAt": "2026-09-10T09:59:58.900Z",
|
|
19
|
+
"durationMs": 88,
|
|
20
|
+
"operations": [],
|
|
21
|
+
"dependenciesTruncated": "true"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"protocol": "0.9.0",
|
|
3
|
+
"instance": {
|
|
4
|
+
"id": "7d1e9c6a-4f2b-4c1e-9b0a-2f6d3e8a1c55",
|
|
5
|
+
"hostname": "web-1",
|
|
6
|
+
"pid": 4242
|
|
7
|
+
},
|
|
8
|
+
"startedAt": "2026-09-10T10:00:00.000Z",
|
|
9
|
+
"endedAt": "2026-09-10T10:01:00.000Z",
|
|
10
|
+
"coverage": {
|
|
11
|
+
"observedRequests": 1,
|
|
12
|
+
"attachedRequests": 0,
|
|
13
|
+
"detailLost": 0,
|
|
14
|
+
"truncated": 0
|
|
15
|
+
},
|
|
16
|
+
"requests": [
|
|
17
|
+
{
|
|
18
|
+
"method": "POST",
|
|
19
|
+
"route": "/checkout",
|
|
20
|
+
"status": 200,
|
|
21
|
+
"startedAt": "2026-09-10T10:00:03.120Z",
|
|
22
|
+
"durationMs": 250,
|
|
23
|
+
"operations": [
|
|
24
|
+
{
|
|
25
|
+
"kind": "timeout",
|
|
26
|
+
"hash": "3e1f0a9c5b7d2468",
|
|
27
|
+
"startMs": 40,
|
|
28
|
+
"endMs": 240
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"protocol": "0.9.0",
|
|
3
|
+
"instance": { "id": "i-1" },
|
|
4
|
+
"startedAt": "2026-09-10T10:00:00.000Z",
|
|
5
|
+
"endedAt": "2026-09-10T10:01:00.000Z",
|
|
6
|
+
"coverage": {
|
|
7
|
+
"observedRequests": 0,
|
|
8
|
+
"attachedRequests": 0,
|
|
9
|
+
"detailLost": 0,
|
|
10
|
+
"truncated": 0,
|
|
11
|
+
"shed": { "ms": 60000, "reason": "latency", "since": "2026-09-10T10:00:00.000Z" }
|
|
12
|
+
},
|
|
13
|
+
"requests": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"protocol": "0.9.0",
|
|
3
|
+
"instance": { "id": "i-1" },
|
|
4
|
+
"startedAt": "2026-09-10T10:00:00.000Z",
|
|
5
|
+
"endedAt": "2026-09-10T10:01:00.000Z",
|
|
6
|
+
"coverage": {
|
|
7
|
+
"observedRequests": 0,
|
|
8
|
+
"attachedRequests": 0,
|
|
9
|
+
"detailLost": 0,
|
|
10
|
+
"truncated": 0,
|
|
11
|
+
"shed": { "ms": 60000, "reason": "cpu" }
|
|
12
|
+
},
|
|
13
|
+
"requests": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"protocol": "0.9.0",
|
|
3
|
+
"instance": { "id": "i-1" },
|
|
4
|
+
"startedAt": "2026-09-10T10:00:00.000Z",
|
|
5
|
+
"endedAt": "2026-09-10T10:01:00.000Z",
|
|
6
|
+
"coverage": {
|
|
7
|
+
"observedRequests": 0,
|
|
8
|
+
"attachedRequests": 0,
|
|
9
|
+
"detailLost": 0,
|
|
10
|
+
"truncated": 0,
|
|
11
|
+
"shed": { "ms": 0, "reason": "latency" }
|
|
12
|
+
},
|
|
13
|
+
"requests": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"protocol": "0.9.0",
|
|
3
|
+
"instance": { "id": "7d1e9c6a-4f2b-4c1e-9b0a-2f6d3e8a1c55" },
|
|
4
|
+
"startedAt": "2026-09-10T10:04:00.000Z",
|
|
5
|
+
"endedAt": "2026-09-10T10:05:00.000Z",
|
|
6
|
+
"coverage": { "observedRequests": 3, "attachedRequests": 1, "detailLost": 0, "truncated": 0 },
|
|
7
|
+
"requests": [
|
|
8
|
+
{
|
|
9
|
+
"method": "GET",
|
|
10
|
+
"route": "/checkout",
|
|
11
|
+
"status": 500,
|
|
12
|
+
"startedAt": "2026-09-10T10:04:31.000Z",
|
|
13
|
+
"durationMs": 912.4,
|
|
14
|
+
"operations": []
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"coarse": {
|
|
18
|
+
"windowSeconds": 300,
|
|
19
|
+
"routesDropped": 0,
|
|
20
|
+
"routes": [
|
|
21
|
+
{
|
|
22
|
+
"method": "GET",
|
|
23
|
+
"route": "/checkout",
|
|
24
|
+
"seconds": [
|
|
25
|
+
{ "second": 1757517900, "requests": 4, "errors": 0, "latencySumMs": 48.2, "latencyMaxMs": 12.1, "calls": 8 },
|
|
26
|
+
{ "second": 1757517901, "requests": 0, "errors": 0, "latencySumMs": 0, "latencyMaxMs": 0, "calls": 0 },
|
|
27
|
+
{
|
|
28
|
+
"second": 1757517902,
|
|
29
|
+
"requests": 7,
|
|
30
|
+
"errors": 2,
|
|
31
|
+
"latencySumMs": 910.5,
|
|
32
|
+
"latencyMaxMs": 431.9,
|
|
33
|
+
"calls": 21
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"eventLoop": [{ "second": 1757517901, "maxDelayMs": 0.8 }, { "second": 1757517902, "maxDelayMs": 250.4 }]
|
|
39
|
+
}
|
|
40
|
+
}
|