You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/api/browser-protocol.md
+168-8Lines changed: 168 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,16 +4,176 @@ Browser protocol describes the data format between [skywalking-client-js](https:
4
4
5
5
## Overview
6
6
7
-
Browser protocol is defined and provided in [gRPC format](https://github.com/apache/skywalking-data-collect-protocol/blob/master/browser/BrowserPerf.proto),
8
-
and also implemented in [HTTP 1.1](browser-http-api-protocol.md)
7
+
Browser protocol is defined in [gRPC format](https://github.com/apache/skywalking-data-collect-protocol/blob/master/browser/BrowserPerf.proto) and
8
+
exposed in HTTP 1.1 for the browser.
9
9
10
-
### Send performance data and error logs
10
+
### Performance Data Report
11
11
12
-
You can send performance data and error logs using the following services:
12
+
Detailed information about data format can be found in [BrowserPerf.proto](https://github.com/apache/skywalking-data-collect-protocol/blob/master/browser/BrowserPerf.proto).
13
13
14
-
1.`BrowserPerfService#collectPerfData` for performance data format.
15
-
1.`BrowserPerfService#collectErrorLogs` for error log format.
14
+
#### POST http://localhost:12800/browser/perfData
16
15
17
-
For error log format, note that:
16
+
Send a performance data object in JSON format.
18
17
19
-
1.`BrowserErrorLog#uniqueId` should be unique in all distributed environments.
18
+
Input:
19
+
20
+
```json
21
+
{
22
+
"service": "web",
23
+
"serviceVersion": "v0.0.1",
24
+
"pagePath": "/index.html",
25
+
"redirectTime": 10,
26
+
"dnsTime": 10,
27
+
"ttfbTime": 10,
28
+
"tcpTime": 10,
29
+
"transTime": 10,
30
+
"domAnalysisTime": 10,
31
+
"fptTime": 10,
32
+
"domReadyTime": 10,
33
+
"loadPageTime": 10,
34
+
"resTime": 10,
35
+
"sslTime": 10,
36
+
"ttlTime": 10,
37
+
"firstPackTime": 10,
38
+
}
39
+
```
40
+
41
+
OutPut:
42
+
43
+
HTTP Status: 204
44
+
45
+
#### POST http://localhost:12800/browser/perfData/webVitals
46
+
47
+
Send a performance data object in JSON format. Since client-js 1.0.0, the following attached metrics are reported.
48
+
49
+
Input:
50
+
51
+
```json5
52
+
{
53
+
"service":"web",
54
+
"serviceVersion":"v0.0.1",
55
+
"pagePath":"/index.html",
56
+
"fmpTime":10, // Deprecated since skywalking-client-js 1.0. This is no longer recommended. Please use the `useWebVitals` instead.
57
+
/* NOTE, Safari does not support all core web vitals, and Firefox does not support `CLS`. */
58
+
"clsTime":10,
59
+
"lcpTime":10,
60
+
}
61
+
```
62
+
63
+
OutPut:
64
+
65
+
HTTP Status: 204
66
+
67
+
#### POST http://localhost:12800/browser/perfData/webInteractions
68
+
69
+
Send a performance data object in JSON format. Since client-js 1.0.0, the following attached metrics are reported.
70
+
71
+
Input:
72
+
73
+
```json
74
+
[
75
+
{
76
+
"service": "web",
77
+
"serviceVersion": "v0.0.1",
78
+
"pagePath": "/index.html",
79
+
"inpTime": 10,
80
+
}
81
+
]
82
+
```
83
+
84
+
OutPut:
85
+
86
+
HTTP Status: 204
87
+
88
+
#### POST http://localhost:12800/browser/perfData/resources
89
+
90
+
Send a static resources data object in JSON format. Since client-js 1.0.0, the following attached metrics are reported.
91
+
92
+
Input:
93
+
94
+
```json
95
+
[
96
+
{
97
+
"service": "web",
98
+
"serviceVersion": "v0.0.1",
99
+
"pagePath": "/index.html",
100
+
"name": "vue.js",
101
+
"duration": 600,
102
+
"size": 100000,
103
+
"protocol": "h2",
104
+
"type": "script",
105
+
}
106
+
]
107
+
```
108
+
109
+
OutPut:
110
+
111
+
HTTP Status: 204
112
+
113
+
### Error Logs Report
114
+
115
+
#### POST http://localhost:12800/browser/errorLogs
0 commit comments