tuns

created pr with 38.1 on 2024-11-28T03:02:21Z · by c8ef7d19
added 38.2 on 2024-11-28T03:36:31Z · by c8ef7d19
1: 55cba32 = 1: 55cba32 chore(analytics): send content-type to `metric-drain`
-: ------- > 2: 334a6dc chore: check for resp
added 38.3 on 2024-11-28T14:08:25Z · by c8ef7d19
1: 55cba32 < -: ------- chore(analytics): send content-type to `metric-drain`
-: ------- > 1:
2: 334a6dc < -: ------- chore: check for resp
added 38.4 on 2024-11-28T14:09:17Z · by c8ef7d19
1: < -: -------
-: ------- > 1: ea8a742 chore(analytics): send content-type to `metric-drain`
cmds
checkout latest patchset:
ssh pr.pico.sh print 38 | git am -3
checkout any patchset in a patch request:
ssh pr.pico.sh print 38.[rev] | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 38
+9 -8 httpmuxer/httpmuxer.go #
......@@ -129,14 +129,15 @@ func Start(state *utils.State) {
129129 slog.Info(logLine, "user", user, "userId", userId)
130130
131131 visit := &utils.MetricDrainVisit{
132- Namespace: "tuns",
133- UserID: userId,
134- Host: param.Request.Host,
135- IpAddress: param.ClientIP,
136- Status: param.StatusCode,
137- Path: originalURI,
138- UserAgent: param.Request.UserAgent(),
139- Referer: param.Request.Referer(),
132+ Namespace: "tuns",
133+ UserID: userId,
134+ Host: param.Request.Host,
135+ IpAddress: param.ClientIP,
136+ Status: param.StatusCode,
137+ Path: originalURI,
138+ UserAgent: param.Request.UserAgent(),
139+ Referer: param.Request.Referer(),
140+ ContentType: param.Request.Response.Header.Get("Content-Type"),
140141 }
141142
142143 select {
+9 -8 utils/state.go #
......@@ -218,14 +218,15 @@ type Ports struct {
218218
219219 // MetricDrainVisit represents a visit for the metric drain.
220220 type MetricDrainVisit struct {
221- Namespace string `json:"namespace"`
222- UserID string `json:"user_id"`
223- Host string `json:"host"`
224- Path string `json:"path"`
225- IpAddress string `json:"ip_address"`
226- UserAgent string `json:"user_agent"`
227- Referer string `json:"referer"`
228- Status int `json:"status"`
221+ Namespace string `json:"namespace"`
222+ UserID string `json:"user_id"`
223+ Host string `json:"host"`
224+ Path string `json:"path"`
225+ IpAddress string `json:"ip_address"`
226+ UserAgent string `json:"user_agent"`
227+ Referer string `json:"referer"`
228+ Status int `json:"status"`
229+ ContentType string `json:"content_type"`
229230 }
230231
231232 // State handles overall state. It retains mutexed maps for various
Back to top