-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Dataset quality] remove usage of dataStreamStats API in serverless #192839
Changes from all commits
501b092
b69c604
0ff68b8
2481d61
803cf2c
8772af7
2cb6646
3dfbd99
a5b76b8
733a687
10f16e3
472f9b9
398f95d
38bb9bb
9a104c6
cd56be8
7a0cd44
f161b78
1d00819
b2a6926
8216546
94a53ac
3e37cba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,18 +12,20 @@ import { dataStreamService, datasetQualityPrivileges } from '../../../services'; | |
|
||
export async function getDataStreams(options: { | ||
esClient: ElasticsearchClient; | ||
types: DataStreamType[]; | ||
types?: DataStreamType[]; | ||
datasetQuery?: string; | ||
uncategorisedOnly: boolean; | ||
uncategorisedOnly?: boolean; | ||
}) { | ||
const { esClient, types, datasetQuery, uncategorisedOnly } = options; | ||
const { esClient, types = [], datasetQuery, uncategorisedOnly } = options; | ||
|
||
const datasetNames = types.map((type) => | ||
streamPartsToIndexPattern({ | ||
typePattern: type, | ||
datasetPattern: datasetQuery ? `${datasetQuery}` : '*-*', | ||
}) | ||
); | ||
const datasetNames = datasetQuery | ||
? [datasetQuery] | ||
: types.map((type) => | ||
streamPartsToIndexPattern({ | ||
typePattern: type, | ||
datasetPattern: '*-*', | ||
}) | ||
); | ||
|
||
const datasetUserPrivileges = await datasetQualityPrivileges.getDatasetPrivileges( | ||
esClient, | ||
|
@@ -32,7 +34,7 @@ export async function getDataStreams(options: { | |
|
||
if (!datasetUserPrivileges.canMonitor) { | ||
return { | ||
items: [], | ||
dataStreams: [], | ||
datasetUserPrivileges, | ||
}; | ||
} | ||
|
@@ -59,13 +61,15 @@ export async function getDataStreams(options: { | |
const mappedDataStreams = filteredDataStreams.map((dataStream) => ({ | ||
name: dataStream.name, | ||
integration: dataStream._meta?.package?.name, | ||
// @ts-expect-error | ||
lastActivity: dataStream.maximum_timestamp, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. package of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you update the comment like, remove this error post a date or PR merge. This way its trackable in code as this comment will get lost in time There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't worry, I won't forget. As soon as 8.16 is released I'll get rid of it |
||
userPrivileges: { | ||
canMonitor: dataStreamsPrivileges[dataStream.name], | ||
}, | ||
})); | ||
|
||
return { | ||
items: mappedDataStreams, | ||
dataStreams: mappedDataStreams, | ||
datasetUserPrivileges, | ||
}; | ||
} |
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.
Last Activity
is now always enabled through dataStreams APIverbose
modeThere 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 we completely remove this prop in favour of this change now ?
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 generic component is used also for
Estimated Size
. In https://github.com/elastic/logs-dev/issues/179 I'll do a refactor