-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
ui: move events endpoint to use sql-over-http #91745
Conversation
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.
can you add a video showing the pages working with the new changes, like you did on your other PRs?
Reviewable status:
complete! 0 of 0 LGTMs obtained
1285d71
to
5303a62
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.
Added a demo :)
Reviewable status:
complete! 0 of 0 LGTMs obtained
5303a62
to
d927be5
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.
Reviewed 3 of 7 files at r1, 9 of 9 files at r2, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @THardy98)
pkg/ui/workspaces/cluster-ui/src/api/eventsApi.ts
line 21 at r2 (raw file):
// defaultEventsMaxBytesLimit is the default max size of events payload in bytes. export const defaultEventsMaxBytesLimit = 50000; // 50KB
I think I see a similar variable with the same size being used in a few other place, can you create a global const and replace the usages?
pkg/ui/workspaces/cluster-ui/src/api/eventsApi.ts
line 71 at r2 (raw file):
} eventsStmt.sql += ";"; console.log("EVENTS STMT", eventsStmt);
nit: remove this line
Code quote:
SELECT timestamp, "eventType", "reportingID", info, "uniqueID" FROM system.eventlog
pkg/ui/workspaces/cluster-ui/src/api/eventsApi.ts
line 86 at r2 (raw file):
} // getEvents fetches events logs from the database. Callers of
nit: s/getEvents/getNonRedactedEvents
pkg/ui/workspaces/cluster-ui/src/api/eventsApi.ts
line 87 at r2 (raw file):
// getEvents fetches events logs from the database. Callers of // getEvents from cluster-ui will need to pass a timeout argument for
nit: s/getEvents/getNonRedactedEvents
pkg/ui/workspaces/db-console/src/redux/events.ts
line 17 at r2 (raw file):
*/ export function eventsSelector(state: AdminUIState) { return state.cachedData.events.data && state.cachedData.events.data.events;
curious: why this is no longer needed?
d927be5
to
331e667
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.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @maryliag)
pkg/ui/workspaces/cluster-ui/src/api/eventsApi.ts
line 21 at r2 (raw file):
Previously, maryliag (Marylia Gutierrez) wrote…
I think I see a similar variable with the same size being used in a few other place, can you create a global const and replace the usages?
Yup, LARGE_RESULT_SIZE
already existed in sqlApi
, using that instead.
pkg/ui/workspaces/cluster-ui/src/api/eventsApi.ts
line 71 at r2 (raw file):
Previously, maryliag (Marylia Gutierrez) wrote…
nit: remove this line
Done.
pkg/ui/workspaces/cluster-ui/src/api/eventsApi.ts
line 86 at r2 (raw file):
Previously, maryliag (Marylia Gutierrez) wrote…
nit: s/getEvents/getNonRedactedEvents
Done.
pkg/ui/workspaces/cluster-ui/src/api/eventsApi.ts
line 87 at r2 (raw file):
Previously, maryliag (Marylia Gutierrez) wrote…
nit: s/getEvents/getNonRedactedEvents
Done.
pkg/ui/workspaces/db-console/src/redux/events.ts
line 17 at r2 (raw file):
Previously, maryliag (Marylia Gutierrez) wrote…
curious: why this is no longer needed?
The type of the response changed to the new EventsResponse
type defined in eventsApi
. The new type doesn't have an events
field, it's just a list of EventsColumns
:
export type EventsResponse = EventColumns[];
so we don't need the &&
check anymore.
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.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @THardy98)
Part of: cockroachdb#89429 Addresses: cockroachdb#90272 (blocked from resolving by cockroachdb#80789) This change migrates the existing `/events` request to use the sql-over-http endpoint on apiV2, making this request tenant-scoped once the sql-over-http endpoint is scoped to tenants (this should be the case when cockroachdb#91323 is completed). Release note: None
331e667
to
a68cd89
Compare
TYFR |
bors r+ |
Build succeeded: |
Part of: #89429
Addresses: #90272 (blocked from resolving by #80789)
Demo (DB-Console only): https://www.loom.com/share/bb67044a8560407fb703af2a6bbb2d9a
This change migrates the existing
/events
request to use the sql-over-http endpoint on apiV2, making this request tenant-scoped once the sql-over-http endpoint is scoped to tenants (this should be the case when #91323 is completed).Release note: None