Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: addconnectionlogs 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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethanndickson merged 1 commit intomainfromethan/connection-logs-api
Jul 15, 2025
Merged

Conversation

ethanndickson
Copy link
Member

@ethanndicksonethanndickson commentedJun 27, 2025
edited
Loading

This is the second PR for moving connection events out of the audit log.

This PR:

  • Adds the/api/v2/connectionlog endpoint
  • Adds filtering forGetAuthorizedConnectionLogsOffset and thus the endpoint.
    There's quite a few, but I was aiming for feature parity with the audit log.
    1. organization:<id|name>
    2. workspace_owner:<username>
    3. workspace_owner_email:<email>
    4. type:<ssh|vscode|jetbrains|reconnecting_pty|workspace_app|port_forwarding>
    5. username:<username>
      • Only includes web-based connection events (workspace apps, web port forwarding) as only those include user metadata.
    6. user_email:<email>
    7. connected_after:<time>
    8. connected_before:<time>
    9. workspace_id:<id>
    10. connection_id:<id>
      • If you have one snapshot of the connection log, and some sessions are ongoing in that snapshot, you could use this filter to check if they've been closed since.
    11. status:<connected|disconnected>
      • Ifconnected 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:

  • Populatecount onConnectionLogResponse using a seperate query (to preemptively mitigate the issue described inAudit log slows to a crawl when nearing 1 million entries #17689)
  • Implement a table in the Web UI for viewing connection logs.
  • Write a query to delete old events from the audit log, call it from dbpurge.
  • Write documentation for the endpoint / feature (including these filters)

Copilot

This comment was marked as outdated.


httpapi.Write(ctx,rw,http.StatusOK, codersdk.ConnectionLogResponse{
ConnectionLogs:convertConnectionLogs(dblogs),
Count:0,// TODO(ethanndickson): Set count
Copy link
MemberAuthor

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.

@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch 2 times, most recently from8cec6d1 to482a5d3CompareJune 30, 2025 04:28
@ethanndicksonethanndicksonforce-pushed theethan/reroute-connection-logs branch frome4e1a04 to1fcd8d7CompareJune 30, 2025 12:03
@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch from482a5d3 toccc7539CompareJune 30, 2025 12:03
Copilot

This comment was marked as outdated.

@ethanndicksonethanndicksonforce-pushed theethan/reroute-connection-logs branch from1fcd8d7 tof47a3f7CompareJuly 10, 2025 05:58
@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch from3a8822d to02a93e0CompareJuly 10, 2025 05:58
@ethanndicksonethanndicksonforce-pushed theethan/reroute-connection-logs branch fromf47a3f7 to0346609CompareJuly 10, 2025 10:28
@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch from02a93e0 to2231707CompareJuly 10, 2025 10:28
Copy link
Contributor

@CopilotCopilotAI left a 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
FileDescription
enterprise/coderd/connectionlog.goNew handler, routing, and conversion logic
coderd/searchquery/search.goAddedConnectionLogs query parser
coderd/database/queries/connectionlogs.sqlNew SQL filters for connection log queries
codersdk/connectionlog.goClient method and types for ConnectionLogs
site/src/api/typesGenerated.tsTS interfaces for new API types
Multipleenterprise/coderd/*_test.go filesTests for parsing, DB querier, and handler
coderd/pagination.goRenamed and updated pagination helper
docs/reference/api/* and Swagger JSON filesDocumentation for new endpoint and schemas

@ethanndicksonethanndicksonforce-pushed theethan/reroute-connection-logs branch from0346609 to72ebddbCompareJuly 14, 2025 02:04
@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch from2231707 to133e51dCompareJuly 14, 2025 02:04
@ethanndicksonethanndicksonforce-pushed theethan/reroute-connection-logs branch from72ebddb to7d13236CompareJuly 14, 2025 06:12
@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch from133e51d tob8faf73CompareJuly 14, 2025 06:13
@ethanndicksonethanndicksonforce-pushed theethan/reroute-connection-logs branch from7d13236 tobea35a3CompareJuly 15, 2025 03:33
@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch fromb8faf73 to3ec1f06CompareJuly 15, 2025 03:33
@ethanndicksonethanndicksonforce-pushed theethan/reroute-connection-logs branch frombea35a3 to3164ea2CompareJuly 15, 2025 04:00
@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch from3ec1f06 toc013e9fCompareJuly 15, 2025 04:00
@ethanndicksonGraphite App
Copy link
MemberAuthor

ethanndickson commentedJul 15, 2025
edited
Loading

Merge activity

  • Jul 15, 4:35 AM UTC: A user started a stack merge that includes this pull request viaGraphite.
  • Jul 15, 4:38 AM UTC:Graphite rebased this pull request as part of a merge.
  • Jul 15, 4:45 AM UTC:Graphite couldn't merge this PR because it was not satisfying all requirements (Failed CI: 'required', 'test-go-race-pg').
  • Jul 15, 4:55 AM UTC: A user started a stack merge that includes this pull request viaGraphite.
  • Jul 15, 4:55 AM UTC:@ethanndickson merged this pull request withGraphite.

@ethanndicksonethanndickson changed the base branch fromethan/reroute-connection-logs tographite-base/18628July 15, 2025 04:36
@ethanndicksonethanndickson changed the base branch fromgraphite-base/18628 tomainJuly 15, 2025 04:36
@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch fromc013e9f toafdb48dCompareJuly 15, 2025 04:37
@ethanndicksonethanndickson merged commit7a339a1 intomainJul 15, 2025
48 of 52 checks passed
@ethanndicksonethanndickson deleted the ethan/connection-logs-api branchJuly 15, 2025 04:55
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJul 15, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

Copilot code reviewCopilotCopilot left review comments

@deansheatherdeansheatherdeansheather approved these changes

Assignees

@ethanndicksonethanndickson

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@ethanndickson@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp