@downtrace/protocol 0.3.0 → 0.4.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/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ interface AggregatesBatch {
6
6
  /**
7
7
  * Protocol version this batch conforms to. Every published minor of v0 stays acceptable.
8
8
  */
9
- protocol: "0.1.0" | "0.2.0" | "0.3.0" | "0.4.0";
9
+ protocol: "0.1.0" | "0.2.0" | "0.3.0" | "0.4.0" | "0.5.0";
10
10
  agent: AgentInfo;
11
11
  instance: InstanceInfo;
12
12
  deploy: DeployInfo;
@@ -157,6 +157,10 @@ interface Dependency {
157
157
  * Calls that failed.
158
158
  */
159
159
  errors: number;
160
+ /**
161
+ * Time requests spent waiting to be able to talk to this dependency, on top of the time spent talking to it: a saturated connection pool shows up here and nowhere else. Optional; agents that cannot see it omit it.
162
+ */
163
+ waitMs?: number;
160
164
  }
161
165
  /**
162
166
  * Health of the agent's own process during the interval. Optional: an agent that does not measure it omits it. Per interval, not per route, because it belongs to the process.
@@ -216,7 +220,7 @@ declare const CALLS_PER_REQUEST_BUCKETS_V0 = 8;
216
220
  * Version of the ingestion protocol this package speaks. Every published minor of v0 stays acceptable to the
217
221
  * cloud, so an agent on an older minor keeps working: fields are only ever added, and always optional (ADR 0008).
218
222
  */
219
- declare const PROTOCOL_VERSION = "0.4.0";
223
+ declare const PROTOCOL_VERSION = "0.5.0";
220
224
  /** Path, relative to the ingest URL, that receives AggregatesBatch payloads. */
221
225
  declare const AGGREGATES_PATH = "/v0/aggregates";
222
226
  /** The JSON Schema (draft 2020-12) for AggregatesBatch, for validators on either side. */
@@ -577,6 +581,11 @@ declare const AGGREGATES_SCHEMA_V0: {
577
581
  minimum: number;
578
582
  description: string;
579
583
  };
584
+ waitMs: {
585
+ type: string;
586
+ minimum: number;
587
+ description: string;
588
+ };
580
589
  };
581
590
  };
582
591
  };
package/dist/index.js CHANGED
@@ -20,7 +20,8 @@ var aggregates_schema_default = {
20
20
  "0.1.0",
21
21
  "0.2.0",
22
22
  "0.3.0",
23
- "0.4.0"
23
+ "0.4.0",
24
+ "0.5.0"
24
25
  ],
25
26
  "description": "Protocol version this batch conforms to. Every published minor of v0 stays acceptable."
26
27
  },
@@ -450,6 +451,11 @@ var aggregates_schema_default = {
450
451
  "type": "integer",
451
452
  "minimum": 0,
452
453
  "description": "Calls that failed."
454
+ },
455
+ "waitMs": {
456
+ "type": "number",
457
+ "minimum": 0,
458
+ "description": "Time requests spent waiting to be able to talk to this dependency, on top of the time spent talking to it: a saturated connection pool shows up here and nowhere else. Optional; agents that cannot see it omit it."
453
459
  }
454
460
  }
455
461
  }
@@ -514,7 +520,7 @@ const CALLS_PER_REQUEST_BUCKETS_V0 = 8;
514
520
  * Version of the ingestion protocol this package speaks. Every published minor of v0 stays acceptable to the
515
521
  * cloud, so an agent on an older minor keeps working: fields are only ever added, and always optional (ADR 0008).
516
522
  */
517
- const PROTOCOL_VERSION = "0.4.0";
523
+ const PROTOCOL_VERSION = "0.5.0";
518
524
  /** Path, relative to the ingest URL, that receives AggregatesBatch payloads. */
519
525
  const AGGREGATES_PATH = "/v0/aggregates";
520
526
  /** The JSON Schema (draft 2020-12) for AggregatesBatch, for validators on either side. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@downtrace/protocol",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Downtrace ingestion protocol: JSON Schema, fixtures and generated TypeScript types",
5
5
  "type": "module",
6
6
  "exports": {
@@ -9,7 +9,7 @@
9
9
  "properties": {
10
10
  "protocol": {
11
11
  "type": "string",
12
- "enum": ["0.1.0", "0.2.0", "0.3.0", "0.4.0"],
12
+ "enum": ["0.1.0", "0.2.0", "0.3.0", "0.4.0", "0.5.0"],
13
13
  "description": "Protocol version this batch conforms to. Every published minor of v0 stays acceptable."
14
14
  },
15
15
  "agent": {
@@ -357,6 +357,11 @@
357
357
  "type": "integer",
358
358
  "minimum": 0,
359
359
  "description": "Calls that failed."
360
+ },
361
+ "waitMs": {
362
+ "type": "number",
363
+ "minimum": 0,
364
+ "description": "Time requests spent waiting to be able to talk to this dependency, on top of the time spent talking to it: a saturated connection pool shows up here and nowhere else. Optional; agents that cannot see it omit it."
360
365
  }
361
366
  }
362
367
  }
@@ -0,0 +1,84 @@
1
+ {
2
+ "protocol": "0.5.0",
3
+ "agent": {
4
+ "name": "@downtrace/agent",
5
+ "version": "0.0.0",
6
+ "runtime": "node",
7
+ "runtimeVersion": "v24.0.0"
8
+ },
9
+ "instance": {
10
+ "id": "7d1e9c6a-4f2b-4c1e-9b0a-2f6d3e8a1c55",
11
+ "hostname": "web-1",
12
+ "pid": 4242
13
+ },
14
+ "deploy": {
15
+ "version": "8f71ac2",
16
+ "environment": "production"
17
+ },
18
+ "intervals": [
19
+ {
20
+ "start": 1756900000000,
21
+ "durationMs": 10000,
22
+ "endpoints": [
23
+ {
24
+ "method": "POST",
25
+ "route": "/checkout",
26
+ "count": 3,
27
+ "errors": 0,
28
+ "status": {
29
+ "success": 3,
30
+ "redirect": 0,
31
+ "clientError": 0,
32
+ "serverError": 0
33
+ },
34
+ "latency": {
35
+ "counts": [
36
+ 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
37
+ ],
38
+ "sum": 2.4,
39
+ "max": 0.9
40
+ },
41
+ "dependencies": [
42
+ {
43
+ "kind": "postgres",
44
+ "target": "",
45
+ "callsPerRequest": [0, 0, 0, 0, 0, 3, 0, 0],
46
+ "totalMs": 41.25,
47
+ "max": 9.5,
48
+ "errors": 0,
49
+ "waitMs": 30.5
50
+ },
51
+ {
52
+ "kind": "http",
53
+ "target": "api.stripe.com",
54
+ "callsPerRequest": [0, 0, 3, 0, 0, 0, 0, 0],
55
+ "totalMs": 612.4,
56
+ "max": 240.1,
57
+ "errors": 1
58
+ },
59
+ {
60
+ "kind": "redis",
61
+ "target": "",
62
+ "callsPerRequest": [0, 0, 0, 3, 0, 0, 0, 0],
63
+ "totalMs": 4.2,
64
+ "max": 1.1,
65
+ "errors": 0
66
+ }
67
+ ]
68
+ }
69
+ ],
70
+ "runtime": {
71
+ "eventLoopDelayMs": {
72
+ "p50": 0.9,
73
+ "p99": 14.2,
74
+ "max": 61.5
75
+ },
76
+ "gcPauseMs": 22.4,
77
+ "gcCount": 7,
78
+ "heapUsedMb": 48.6,
79
+ "rssMb": 131.2,
80
+ "inFlightMax": 9
81
+ }
82
+ }
83
+ ]
84
+ }