Skip to content

Commit

Permalink
[Reporting/Telemetry] Include counts for each deprecated job type (#1…
Browse files Browse the repository at this point in the history
…08614)

* add isDeprecated to report meta for telemetry

* test clean up

* update snapshots

* Update x-pack/plugins/reporting/server/usage/decorate_range_stats.ts

Co-authored-by: Michael Dokolin <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Michael Dokolin <[email protected]>
  • Loading branch information
3 people authored Aug 20, 2021
1 parent 5f9193d commit 91630c6
Show file tree
Hide file tree
Showing 14 changed files with 1,153 additions and 913 deletions.
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

0 comments on commit 91630c6

Please sign in to comment.