tuns
created pr with
38.1
added 38.2
1: 55cba32 = 1: 55cba32 chore(analytics): send content-type to `metric-drain`
-: ------- > 2: 334a6dc chore: check for resp
added 38.3
1: 55cba32 < -: ------- chore(analytics): send content-type to `metric-drain`
-: ------- > 1:
2: 334a6dc < -: ------- chore: check for resp
added 38.4
1: < -: -------
-: ------- > 1: ea8a742 chore(analytics): send content-type to `metric-drain`
cmds
checkout latest patchset:
ssh pr.pico.sh print 38 | git am -3checkout any patchset in a patch request:
ssh pr.pico.sh print 38.[rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 38
Patchset
38.1
chore(analytics): send content-type to `metric-drain`
Eric Bower
2024-11-28T03:01:26ZSemantic diff summary
0 added,
2 modified,
0 signature changed,
0 removed
across 2 analyzed files
+9
-8
httpmuxer/httpmuxer.go
#
| ... | ... | @@ -129,14 +129,15 @@ func Start(state *utils.State) { | |
| 129 | 129 | slog.Info(logLine, "user", user, "userId", userId) | |
| 130 | 130 | ||
| 131 | 131 | 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"), | |
| 140 | 141 | } | |
| 141 | 142 | ||
| 142 | 143 | select { |
+9
-8
utils/state.go
#
| ... | ... | @@ -218,14 +218,15 @@ type Ports struct { | |
| 218 | 218 | ||
| 219 | 219 | // MetricDrainVisit represents a visit for the metric drain. | |
| 220 | 220 | 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"` | |
| 229 | 230 | } | |
| 230 | 231 | ||
| 231 | 232 | // State handles overall state. It retains mutexed maps for various |