@downtrace/protocol 0.8.0 → 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.
Files changed (36) hide show
  1. package/README.md +23 -1
  2. package/dist/index.d.ts +426 -20
  3. package/dist/index.js +317 -23
  4. package/package.json +1 -1
  5. package/schema/v0/aggregates.schema.json +108 -13
  6. package/schema/v0/capture-evidence.schema.json +154 -4
  7. package/schema/v0/fixtures/evidence/invalid/coarse-second-without-its-calls.json +20 -0
  8. package/schema/v0/fixtures/evidence/invalid/dependencies-truncated-negative.json +14 -0
  9. package/schema/v0/fixtures/evidence/invalid/dependencies-truncated-not-a-boolean.json +24 -0
  10. package/schema/v0/fixtures/evidence/invalid/operation-of-an-unknown-kind.json +33 -0
  11. package/schema/v0/fixtures/evidence/invalid/shed-with-an-extra-field.json +14 -0
  12. package/schema/v0/fixtures/evidence/invalid/shed-with-unknown-reason.json +14 -0
  13. package/schema/v0/fixtures/evidence/invalid/shed-with-zero-ms.json +14 -0
  14. package/schema/v0/fixtures/evidence/valid/with-coarse.json +40 -0
  15. package/schema/v0/fixtures/evidence/valid/with-dependencies-truncated.json +32 -0
  16. package/schema/v0/fixtures/evidence/valid/with-operation-kinds.json +57 -0
  17. package/schema/v0/fixtures/evidence/valid/with-shed.json +31 -0
  18. package/schema/v0/fixtures/invalid/a-running-total-of-nothing.json +27 -0
  19. package/schema/v0/fixtures/invalid/an-ending-nobody-declared.json +46 -0
  20. package/schema/v0/fixtures/invalid/call-with-a-path.json +38 -0
  21. package/schema/v0/fixtures/invalid/call-with-a-query-string.json +38 -0
  22. package/schema/v0/fixtures/invalid/command-with-its-key.json +38 -0
  23. package/schema/v0/fixtures/invalid/context-that-is-not-flat.json +40 -0
  24. package/schema/v0/fixtures/invalid/error-sources-with-a-call.json +49 -0
  25. package/schema/v0/fixtures/invalid/error-sources-with-a-query.json +49 -0
  26. package/schema/v0/fixtures/invalid/error-sources-with-a-repeat.json +49 -0
  27. package/schema/v0/fixtures/invalid/error-sources-with-an-unknown-value.json +49 -0
  28. package/schema/v0/fixtures/invalid/operation-of-an-unknown-kind.json +37 -0
  29. package/schema/v0/fixtures/valid/calls-and-commands.json +59 -0
  30. package/schema/v0/fixtures/valid/dropped-exceptions.json +56 -0
  31. package/schema/v0/fixtures/valid/error-sources.json +49 -0
  32. package/schema/v0/fixtures/valid/exceptions-with-a-running-total.json +38 -0
  33. package/schema/v0/fixtures/valid/exceptions-without-intervals.json +37 -0
  34. package/schema/v0/fixtures/valid/reported-errors.json +97 -0
  35. package/schema/v0/fixtures/valid/the-last-batch-of-a-process.json +59 -0
  36. package/schema/v0/fixtures/valid/triggers-without-intervals.json +28 -0
@@ -0,0 +1,56 @@
1
+ {
2
+ "protocol": "0.9.0",
3
+ "agent": {
4
+ "name": "@downtrace/agent",
5
+ "version": "0.0.0",
6
+ "runtime": "node",
7
+ "runtimeVersion": "v24.0.0",
8
+ "resources": {
9
+ "droppedExceptions": 3
10
+ }
11
+ },
12
+ "instance": {
13
+ "id": "7d1e9c6a-4f2b-4c1e-9b0a-2f6d3e8a1c55",
14
+ "hostname": "web-1",
15
+ "pid": 4242
16
+ },
17
+ "deploy": {
18
+ "version": "8f71ac2",
19
+ "environment": "production"
20
+ },
21
+ "intervals": [
22
+ {
23
+ "start": 1756900000000,
24
+ "durationMs": 10000,
25
+ "endpoints": [
26
+ {
27
+ "method": "GET",
28
+ "route": "/healthz",
29
+ "count": 3,
30
+ "errors": 0,
31
+ "status": {
32
+ "success": 3,
33
+ "redirect": 0,
34
+ "clientError": 0,
35
+ "serverError": 0
36
+ },
37
+ "latency": {
38
+ "counts": [
39
+ 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
40
+ ],
41
+ "sum": 2.4,
42
+ "max": 0.9
43
+ }
44
+ }
45
+ ]
46
+ }
47
+ ],
48
+ "exceptions": [
49
+ {
50
+ "kind": "uncaught",
51
+ "hash": "9f1c2d3e4a5b6c7d",
52
+ "text": "TypeError: cannot read ? of ? · handler@orders.js:41",
53
+ "count": 3
54
+ }
55
+ ]
56
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "protocol": "0.9.0",
3
+ "agent": {
4
+ "name": "@downtrace/agent",
5
+ "version": "0.8.1",
6
+ "runtime": "node",
7
+ "runtimeVersion": "v24.0.0",
8
+ "errorSources": {
9
+ "inRequest": ["error", "framework", "explicit"],
10
+ "outsideRequest": ["uncaught", "unhandled-rejection", "framework", "explicit"]
11
+ }
12
+ },
13
+ "instance": {
14
+ "id": "7d1e9c6a-4f2b-4c1e-9b0a-2f6d3e8a1c55",
15
+ "hostname": "web-1",
16
+ "pid": 4242
17
+ },
18
+ "deploy": {
19
+ "version": "8f71ac2",
20
+ "environment": "production"
21
+ },
22
+ "intervals": [
23
+ {
24
+ "start": 1756900000000,
25
+ "durationMs": 10000,
26
+ "endpoints": [
27
+ {
28
+ "method": "GET",
29
+ "route": "/healthz",
30
+ "count": 3,
31
+ "errors": 0,
32
+ "status": {
33
+ "success": 3,
34
+ "redirect": 0,
35
+ "clientError": 0,
36
+ "serverError": 0
37
+ },
38
+ "latency": {
39
+ "counts": [
40
+ 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
41
+ ],
42
+ "sum": 2.4,
43
+ "max": 0.9
44
+ }
45
+ }
46
+ ]
47
+ }
48
+ ]
49
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "protocol": "0.9.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": "5c2a7e19-3d4b-4f8a-9e61-0b7d2c4a8f33",
11
+ "hostname": "web-2",
12
+ "pid": 6262
13
+ },
14
+ "deploy": {
15
+ "version": "8f71ac2",
16
+ "environment": "production"
17
+ },
18
+ "intervals": [],
19
+ "exceptions": [
20
+ {
21
+ "kind": "uncaught",
22
+ "hash": "9f1c2d3e4a5b6c7d",
23
+ "text": "TypeError: cannot read ? of ? · handler@orders.js:41",
24
+ "count": 2,
25
+ "total": 5
26
+ },
27
+ {
28
+ "kind": "explicit",
29
+ "hash": "5e6f708192a3b4c5",
30
+ "text": "Error: invoice ? could not be rendered · render@invoices-job.js:57",
31
+ "count": 1,
32
+ "total": 1,
33
+ "context": {
34
+ "stage": "render"
35
+ }
36
+ }
37
+ ]
38
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "protocol": "0.9.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": "3b8f2e71-9c4d-4a6e-8f1b-5d2c7a9e0f14",
11
+ "hostname": "worker-1",
12
+ "pid": 5151
13
+ },
14
+ "deploy": {
15
+ "version": "8f71ac2",
16
+ "environment": "production"
17
+ },
18
+ "intervals": [],
19
+ "exceptions": [
20
+ {
21
+ "kind": "explicit",
22
+ "hash": "5e6f708192a3b4c5",
23
+ "text": "Error: invoice ? could not be rendered · render@invoices-job.js:57",
24
+ "count": 4,
25
+ "context": {
26
+ "stage": "render",
27
+ "retryable": "false"
28
+ }
29
+ },
30
+ {
31
+ "kind": "unhandled-rejection",
32
+ "hash": "d4e5f60718293a4b",
33
+ "text": "TimeoutError: queue did not answer in ? · poll@queue-client.js:112",
34
+ "count": 1
35
+ }
36
+ ]
37
+ }
@@ -0,0 +1,97 @@
1
+ {
2
+ "protocol": "0.9.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": 1,
28
+ "status": {
29
+ "success": 2,
30
+ "redirect": 0,
31
+ "clientError": 0,
32
+ "serverError": 1
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
+ }
42
+ ]
43
+ }
44
+ ],
45
+ "profile": {
46
+ "start": 1756900000000,
47
+ "durationMs": 60000,
48
+ "endpoints": [
49
+ {
50
+ "method": "POST",
51
+ "route": "/checkout",
52
+ "operations": [
53
+ {
54
+ "kind": "explicit",
55
+ "hash": "3c9f0a1b2d4e5f60",
56
+ "text": "Error: provider responded ? · call@provider-client.js:38",
57
+ "count": 2,
58
+ "totalMs": 0,
59
+ "errors": 2,
60
+ "context": {
61
+ "stage": "authorize",
62
+ "retryable": "true",
63
+ "attempt": "?"
64
+ }
65
+ },
66
+ {
67
+ "kind": "framework",
68
+ "hash": "a1b2c3d4e5f60718",
69
+ "text": "ProviderError: provider call ? failed after ? attempt(s) · call@provider-client.js:45",
70
+ "count": 1,
71
+ "totalMs": 0,
72
+ "errors": 1
73
+ },
74
+ {
75
+ "kind": "query",
76
+ "hash": "b7c1d0f2a3e45861",
77
+ "text": "SELECT id, price_cents FROM products WHERE id = ?",
78
+ "count": 1440,
79
+ "totalMs": 812.4,
80
+ "errors": 0
81
+ }
82
+ ]
83
+ }
84
+ ]
85
+ },
86
+ "exceptions": [
87
+ {
88
+ "kind": "explicit",
89
+ "hash": "5e6f708192a3b4c5",
90
+ "text": "Error: could not warm the cache · warm@boot.js:12",
91
+ "count": 1,
92
+ "context": {
93
+ "stage": "boot"
94
+ }
95
+ }
96
+ ]
97
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "protocol": "0.9.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": "GET",
25
+ "route": "/healthz",
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
+ }
42
+ ]
43
+ }
44
+ ],
45
+ "exceptions": [
46
+ {
47
+ "kind": "uncaught",
48
+ "hash": "9f1c2d3e4a5b6c7d",
49
+ "text": "TypeError: cannot read ? of ? · handler@orders.js:41",
50
+ "count": 3
51
+ },
52
+ {
53
+ "kind": "unhandled-rejection",
54
+ "hash": "1a2b3c4d5e6f7a8b",
55
+ "count": 1
56
+ }
57
+ ],
58
+ "ending": "signal"
59
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "protocol": "0.7.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
+ "triggers": [
20
+ {
21
+ "signal": "event-loop-delay",
22
+ "observedAt": 1756900020000,
23
+ "valueMs": 412.5,
24
+ "thresholdMs": 200,
25
+ "intervals": 3
26
+ }
27
+ ]
28
+ }