-
Notifications
You must be signed in to change notification settings - Fork 943
feat: add connectionlogs
API
#18628
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
feat: add connectionlogs
API
#18628
Conversation
|
||
httpapi.Write(ctx, rw, http.StatusOK, codersdk.ConnectionLogResponse{ | ||
ConnectionLogs: convertConnectionLogs(dblogs), | ||
Count: 0, // TODO(ethanndickson): Set count |
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.
This is populated in the next PR in the stack.
8cec6d1
to
482a5d3
Compare
e4e1a04
to
1fcd8d7
Compare
482a5d3
to
ccc7539
Compare
ccc7539
to
406e3f4
Compare
88bf416
to
cd30512
Compare
cd30512
to
3a8822d
Compare
1fcd8d7
to
f47a3f7
Compare
3a8822d
to
02a93e0
Compare
f47a3f7
to
0346609
Compare
02a93e0
to
2231707
Compare
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.
Pull Request Overview
Introduces the new ConnectionLogs API to mirror audit log functionality for connection events, including server routing, handler logic, DB queries, client SDK support, tests, and docs.
- Adds
/api/v2/connectionlog
endpoint and pagination/filtering logic on the server - Implements search parser, SQL filters, and Go SDK client method
- Updates TypeScript types, autogenerated docs, enterprise tests, and pagination helpers
Reviewed Changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
enterprise/coderd/connectionlog.go |
New handler, routing, and conversion logic |
coderd/searchquery/search.go |
Added ConnectionLogs query parser |
coderd/database/queries/connectionlogs.sql |
New SQL filters for connection log queries |
codersdk/connectionlog.go |
Client method and types for ConnectionLogs |
site/src/api/typesGenerated.ts |
TS interfaces for new API types |
Multiple enterprise/coderd/*_test.go files |
Tests for parsing, DB querier, and handler |
coderd/pagination.go |
Renamed and updated pagination helper |
docs/reference/api/* and Swagger JSON files |
Documentation for new endpoint and schemas |
0346609
to
72ebddb
Compare
2231707
to
133e51d
Compare
72ebddb
to
7d13236
Compare
133e51d
to
b8faf73
Compare
7d13236
to
bea35a3
Compare
b8faf73
to
3ec1f06
Compare
bea35a3
to
3164ea2
Compare
3ec1f06
to
c013e9f
Compare
Merge activity
|
c013e9f
to
afdb48d
Compare
This is the second PR for moving connection events out of the audit log.
This PR:
/api/v2/connectionlog
endpointGetAuthorizedConnectionLogsOffset
and thus the endpoint.There's quite a few, but I was aiming for feature parity with the audit log.
organization:<id|name>
workspace_owner:<username>
workspace_owner_email:<email>
type:<ssh|vscode|jetbrains|reconnecting_pty|workspace_app|port_forwarding>
username:<username>
user_email:<email>
connected_after:<time>
connected_before:<time>
workspace_id:<id>
connection_id:<id>
status:<connected|disconnected>
connected
only sessions with a nullclose_time
are returned, ifdisconnected
, only those with a non-nullclose_time
. If filter is omitted, both are returned.Future PRs:
count
onConnectionLogResponse
using a seperate query (to preemptively mitigate the issue described in Audit log slows to a crawl when nearing 1 million entries #17689)