-
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
[Reporting/Telemetry] Include counts for each deprecated job type #108614
[Reporting/Telemetry] Include counts for each deprecated job type #108614
Conversation
}; | ||
doc_count: number; | ||
} | ||
|
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.
These lines of code were mysteriously duplicated in the file
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.
🧙🏻♂️
0325f4f
to
813f3df
Compare
| 'failed' | ||
| 'pending' | ||
| 'processing'; | ||
type Statuses = 'completed' | 'completed_with_warnings' | 'failed' | 'pending' | 'processing'; |
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.
Removed non-existent cancelled
status
b75313e
to
1fe51ff
Compare
PDF_JOB_TYPE, | ||
PNG_JOB_TYPE, | ||
} from '../../common/constants'; | ||
import { AvailableTotal, ExportType, FeatureAvailabilityMap, RangeStats } from './types'; | ||
|
||
const jobTypeIsDeprecated = (jobType: string) => DEPRECATED_JOB_TYPES.includes(jobType); | ||
|
||
function getForFeature( | ||
range: Partial<RangeStats>, | ||
typeKey: ExportType, | ||
featureAvailability: FeatureAvailabilityMap, | ||
additional?: any |
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.
I took a crack at fixing this any
but was not able to see a clean fix for it yet
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.
You can use generics as a clean fix.
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.
@dokmic I merged your suggestion and there is still a lot of ambiguity in the body of this function. I reverted the commit for now, but let's keep track of this. It is a very nasty any
and in a big way, it indicates the logic of the function could be improved.
@@ -559,9 +722,6 @@ describe('Ready for collection observable', () => { | |||
}, | |||
}, | |||
"status": Object { | |||
"cancelled": Object { |
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.
cancelled
is not a valid status
b9e1e74
to
74177a4
Compare
74177a4
to
12ef82a
Compare
Pinging @elastic/kibana-app-services (Team:AppServices) |
Pinging @elastic/kibana-reporting-services (Team:Reporting Services) |
@elasticmachine merge upstream |
@@ -4105,9 +4117,6 @@ | |||
}, | |||
"status": { | |||
"properties": { | |||
"cancelled": { |
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.
Removing these from the telemetry indices will require a re-index operation. Please make sure that you follow up with infra to let them know.
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.
Telemetry (and therefore core) changes LGTM. Please remember to follow up with Infra to get cancelled
removed from the mappings.
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.
Code changes LGTM 👍
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.
Code changes look great to me! Thanks for adding this @tsullivan
I tested this locally and report generation and telemetry collection worked as expected.
I think the PR description needs to update isDeprectated
-> deprecated
as that what it looks like we are currently getting back from the Kibana stats API.
Co-authored-by: Michael Dokolin <[email protected]>
💚 Build SucceededMetrics [docs]Page load bundle
History
To update your PR or re-run it, just comment with: |
…astic#108614) * 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]>
…08614) (#109366) * 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]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Michael Dokolin <[email protected]>
Closes #105868
Summary
This PR adds an explicit
deprecated
count to each export type, which makes deprecating code in Reporting more flexible for telemetry:Telemetry data can show how often deprecated export types are used. Prior to this PR, the export type itself would have to be deprecated, and we would find the usage of deprecated export types by comparing the usage of each export type.
When is merged, the
printable_pdf
andPNG
, report jobs will be conditionally marked as deprecated, based on whether the job parameters used the 6.2savedObjectId
style, or the laterrelativeUrls
style. Since the job type can not be used to see if the job is deprecated, this PR adds extra logic to telemetry collection in Reporting and gives an explicit flag on if the job is deprecated.Testing:
With the reporting index set up with deprecated job types, you can then query the internal API for usage, and see that it contains info about the deprecated job types.
jq
:Example output:
TODO:
Checklist
Delete any items that are not applicable to this PR.