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 UI] Restore call to UsageCollector.countLogs #67051

Merged
merged 1 commit into from
May 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions x-pack/plugins/infra/server/routes/log_entries/summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
logEntriesSummaryResponseRT,
} from '../../../common/http_api/log_entries';
import { parseFilterQuery } from '../../utils/serialized_query';
import { UsageCollector } from '../../usage/usage_collector';

const escapeHatch = schema.object({}, { unknowns: 'allow' });

Expand Down Expand Up @@ -47,6 +48,8 @@ export const initLogEntriesSummaryRoute = ({ framework, logEntries }: InfraBacke
parseFilterQuery(query)
);

UsageCollector.countLogs();
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 in its own try/catch so we don't bounce to an error message just because the usage collector fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, but if the data collection might fail I think it should be handled inside the telemetry call itself and not in the application code. I think telemetry should behave like a black box for app code


return response.ok({
body: logEntriesSummaryResponseRT.encode({
data: {
Expand Down