Logs
Patchsets
Range Diff ↕ rd-77
1: 77aaa29 ! 1: 8d56535 reactor(metric-drain): use caddy json format
-: ------- > 2: a336041 wip
-: ------- > 3: 7ae45b3 chore: wrap
-: ------- > 4: bfa5c4f done
Range Diff ↕ rd-78
1: 8d56535 < -: ------- reactor(metric-drain): use caddy json format
3: 7ae45b3 ! 1: c7eeb12 reactor(metric-drain): use caddy access logs
2: a336041 < -: ------- wip
4: bfa5c4f < -: ------- done
Range Diff ↕ rd-79
1: c7eeb12 ! 1: 4e0839a reactor(metric-drain): use caddy access logs
Patchset ps-78
reactor(metric-drain): use caddy access logs
Eric Bower
Makefile
+2
-1
auth/api.go
+162
-12
caddy.json
+40
-0
db/db.go
+12
-11
db/postgres/storage.go
+2
-1
imgs/api.go
+0
-2
pastes/api.go
+0
-5
pgs/ssh.go
+3
-7
pgs/tunnel.go
+1
-2
pgs/web.go
+14
-36
pgs/web_asset_handler.go
+0
-37
pgs/web_test.go
+2
-42
prose/api.go
+3
-43
shared/api.go
+17
-0
shared/router.go
+3
-10
test.txt
+0
-0
reactor(metric-drain): use caddy access logs
Previously we were sending site usage analytics within our web app code. This worked well for our use case because we could filter, parse, and send the analytics to our pipe `metric-drain` which would then store the analytics into our database. Because we want to enable HTTP caching for pgs we won't always reach our web app code since usage analytics will terminate at our cache layer. Instead, we want to record analytics higher in the request stack. In this case, we want to record site analytics from Caddy access logs. Here's how it works: - `pub` caddy access logs to our pipe `container-drain` - `auth/web` will `sub` to `container-drain`, filter, deserialize, and `pub` to `metric-drain` - `auth/web` will `sub` to `metric-drain` and store the analytics in our database
Makefile
link
+2
-1
+2
-1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
auth/api.go
link
+162
-12
+162
-12
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
|
caddy.json
link
+40
-0
+40
-0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
db/db.go
link
+12
-11
+12
-11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
db/postgres/storage.go
link
+2
-1
+2
-1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
imgs/api.go
link
+0
-2
+0
-2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
pastes/api.go
link
+0
-5
+0
-5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
pgs/ssh.go
link
+3
-7
+3
-7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
pgs/tunnel.go
link
+1
-2
+1
-2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
pgs/web.go
link
+14
-36
+14
-36
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
pgs/web_asset_handler.go
link
+0
-37
+0
-37
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
pgs/web_test.go
link
+2
-42
+2
-42
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
prose/api.go
link
+3
-43
+3
-43
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
sql/migrations/20241125_add_content_type_to_analytics.sql
link
+1
-0
+1
-0
1 2 3 4 5 6 7 |
|
test.txt
link
+0
-0
+0
-0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|