-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build proxy with conditional logging and jsonselect encoders #4864
Conversation
…ders Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
…s not equal to 200 Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
I need to force caddy to pick the latest plugin versions Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
Reminder for myself tomorrow: debug the Aside from those, it is working - ie., not emitting all the non 200 access logs. Also stackdriver log entry format looks rad. |
/auto-cc |
…(status code 0) Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
@leodido please also exclude the status code 304 |
@leodido I just tried to run some of the examples and I see some 200 Also, I think we should add the path of the request. |
Yes Ale you're right. I found the same too. There's a bug in the expression evaluator I'm fixing |
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
Ok, these are some logs now: {"severity":"INFO","timestamp":"2021-07-21T09:39:20.042817513Z","logName":"http.log.access.log0","httpRequest":{"requestMethod":"GET","protocol":"HTTP/2.0","status":302,"responseSize":0,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0","requestUrl":"/api/login?host=github.com&returnTo=https%3A%2F%2Fleo-caddy-logger-plugin.staging.gitpod-dev.com%2Fcomplete-auth%3Fmessage%3Dsuccess"}}
{"severity":"INFO","timestamp":"2021-07-21T09:39:21.051060152Z","logName":"http.log.access.log0","httpRequest":{"requestMethod":"GET","protocol":"HTTP/2.0","status":302,"responseSize":190,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0","requestUrl":"/auth/github/callback?code=b905eb14ab149f4a97e1&state=leo-caddy-logger-plugin"}}
{"severity":"INFO","timestamp":"2021-07-21T09:39:21.264285932Z","logName":"http.log.access.log0","httpRequest":{"requestMethod":"GET","protocol":"HTTP/2.0","status":302,"responseSize":212,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0","requestUrl":"/api/tos?mode=login"}}
{"severity":"ERROR","timestamp":"2021-07-21T09:41:06.096766455Z","logName":"http.log.access.log2","httpRequest":{"requestMethod":"GET","protocol":"HTTP/1.1","status":404,"responseSize":369,"userAgent":"MinIO (linux; amd64) minio-go/v7.0.11","requestUrl":"/gitpod-user-7ba328d8-0454-4a26-b4d0-1adb8badefa2/?location="}}
{"severity":"ERROR","timestamp":"2021-07-21T09:41:06.189535151Z","logName":"http.log.access.log2","httpRequest":{"requestMethod":"HEAD","protocol":"HTTP/1.1","status":404,"responseSize":0,"userAgent":"MinIO (linux; amd64) minio-go/v7.0.11","requestUrl":"/gitpod-user-7ba328d8-0454-4a26-b4d0-1adb8badefa2/workspaces/violet-ermine-wwnq93qg/full.tar"}}
{"severity":"INFO","timestamp":"2021-07-21T09:41:06.758797925Z","logName":"http.log.access.log1","httpRequest":{"requestMethod":"GET","protocol":"HTTP/2.0","status":303,"responseSize":193,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0","requestUrl":"/favicon.ico"}}
{"severity":"INFO","timestamp":"2021-07-21T09:42:18.086951018Z","logName":"http.log.access.log0","httpRequest":{"requestMethod":"GET","protocol":"HTTP/2.0","status":204,"responseSize":0,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0","requestUrl":"/code-sync/v1/resource/globalState/latest"}}
{"severity":"INFO","timestamp":"2021-07-21T09:42:20.573728889Z","logName":"http.log.access.log0","httpRequest":{"requestMethod":"GET","protocol":"HTTP/2.0","status":204,"responseSize":0,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0","requestUrl":"/code-sync/v1/resource/keybindings/latest"}}
{"severity":"INFO","timestamp":"2021-07-21T09:42:20.574281602Z","logName":"http.log.access.log0","httpRequest":{"requestMethod":"GET","protocol":"HTTP/2.0","status":204,"responseSize":0,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0","requestUrl":"/code-sync/v1/resource/snippets/latest"}}
{"severity":"INFO","timestamp":"2021-07-21T09:42:29.531150562Z","logName":"http.log.access.log0","httpRequest":{"requestMethod":"GET","protocol":"HTTP/2.0","status":204,"responseSize":0,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0","requestUrl":"/code-sync/v1/resource/machines/latest"}}
{"severity":"INFO","timestamp":"2021-07-21T09:42:29.710513684Z","logName":"http.log.access.log0","httpRequest":{"requestMethod":"GET","protocol":"HTTP/2.0","status":204,"responseSize":0,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0","requestUrl":"/code-sync/v1/resource/keybindings/latest"}}
{"severity":"INFO","timestamp":"2021-07-21T09:42:29.942736795Z","logName":"http.log.access.log0","httpRequest":{"requestMethod":"GET","protocol":"HTTP/2.0","status":204,"responseSize":0,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0","requestUrl":"/code-sync/v1/resource/snippets/latest"}}
{"severity":"INFO","timestamp":"2021-07-21T09:42:30.050469218Z","logName":"http.log.access.log0","httpRequest":{"requestMethod":"GET","protocol":"HTTP/2.0","status":204,"responseSize":0,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0","requestUrl":"/code-sync/v1/resource/globalState/latest"}} I think this is ready for review now. :) |
Besides my comment to simplify the filter this change LGTM |
@leodido thank you for working on this!!! |
/lgtm |
LGTM label has been added. Git tree hash: 44b9fbce388ab77b483eb7d220111b868e07cead
|
/approve |
fa2ef39
to
d0b3772
Compare
… head change Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
d0b3772
to
531ebf0
Compare
/lgtm |
LGTM label has been added. Git tree hash: 0fbec4a928fd0db5b5a94d1f6f01ce2456a07c99
|
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
…modules Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
Re-organized the caddy plugins into separated go modules. This is the current custom caddy plugin list: caddy.logging.encoders.if
caddy.logging.encoders.jsonselect
http.handlers.gitpod_cors_origin
http.handlers.gitpod_sec_websocket_key
http.handlers.gitpod_workspace_download
Non-standard modules: 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other than the nit, this looks good to me
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com> Co-authored-by: Christian Weichel <chris@gitpod.io>
/LGTM |
LGTM label has been added. Git tree hash: 5b043e37e7aa5b126e6453483aa8d4eba0eec11e
|
/approve |
Ok @roboquat keep calm ahaha! I've asked people in the @gitpod-io/engineering-meta to take a look at this 👼 |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aledbf, csweichel, leodido The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes #4740 (do not log 200 requests).
Also:
Signed-off-by: Leonardo Di Donato leodidonato@gmail.com