Skip to content
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

Logs: add support for a start parameter when reading logs #1957

Merged
merged 2 commits into from
Feb 18, 2025
Merged

Conversation

@Page- Page- requested a review from a team February 15, 2025 16:08
@Page- Page- force-pushed the logs branch 2 times, most recently from 43e002c to 6d6353e Compare February 17, 2025 08:57
@Page- Page- marked this pull request as ready for review February 18, 2025 15:06
This can either be an ISO date or a milliseconds timestamp

Change-type: minor
@@ -189,6 +190,7 @@ export class LokiBackend implements DeviceLogsBackend {
query: this.getDeviceQuery(ctx),
limit: Number.isFinite(count) ? count : 1000,
since: '30d',
...(start != null ? { start: `${BigInt(start) * 1000000n}` } : {}),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be v ?

Suggested change
...(start != null ? { start: `${BigInt(start) * 1000000n}` } : {}),
...(typeof start === 'number' ? { start: `${BigInt(start) * 1000000n}` } : {}),

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm I just saw the tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's either undefined or a number, so both checks should be equivalent?

@Page- Page- requested review from pipex and thgreasi February 18, 2025 15:21
@@ -225,5 +228,31 @@ export default () => {
'streamed log line 1',
]);
});

for (const fn of ['toISOString', 'getTime'] as const) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

;)

@Page- Page- merged commit 9fef4b7 into master Feb 18, 2025
52 checks passed
@Page- Page- deleted the logs branch February 18, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants