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

[7.x] [Reporting/Telemetry] Include counts for each deprecated job type (#108614) #109366

Merged
merged 2 commits into from
Aug 21, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions x-pack/plugins/reporting/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ export const CSV_JOB_TYPE_DEPRECATED = 'csv';

export const USES_HEADLESS_JOB_TYPES = [PDF_JOB_TYPE, PNG_JOB_TYPE];

export const DEPRECATED_JOB_TYPES = [CSV_JOB_TYPE_DEPRECATED];

// Licenses
export const LICENSE_TYPE_TRIAL = 'trial';
export const LICENSE_TYPE_BASIC = 'basic';
Expand Down
7 changes: 6 additions & 1 deletion x-pack/plugins/reporting/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ export interface ReportSource {
jobtype: string; // refers to `ExportTypeDefinition.jobType`
created_by: string | false; // username or `false` if security is disabled. Used for ensuring users can only access the reports they've created.
payload: BasePayload;
meta: { objectType: string; layout?: string }; // for telemetry
meta: {
// for telemetry
objectType: string;
layout?: string;
isDeprecated?: boolean;
};
migration_version: string; // for reminding the user to update their POST URL
attempts: number; // initially populated as 0
created_at: string; // timestamp in UTC
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/reporting/server/lib/enqueue_job.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ describe('Enqueue Job', () => {
"kibana_name": undefined,
"max_attempts": undefined,
"meta": Object {
"isDeprecated": undefined,
"layout": undefined,
"objectType": "cool_object_type",
},
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/reporting/server/lib/enqueue_job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ export async function enqueueJob(
created_by: user ? user.username : false,
payload: job,
meta: {
// telemetry fields
objectType: jobParams.objectType,
layout: jobParams.layout?.id,
isDeprecated: job.isDeprecated,
},
})
);
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/reporting/server/lib/store/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export const mapping = {
},
},
},
isDeprecated: {
type: 'boolean',
},
},
},
browser_type: { type: 'keyword' },
Expand Down
Loading