-
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
Make telemetry task use a schedule instead of scheduling explicitly for midnight #153380
Conversation
@elasticmachine merge upstream |
Pinging @elastic/response-ops (Team:ResponseOps) |
} from '@kbn/task-manager-plugin/server'; | ||
import { PreConfiguredAction } from '../types'; | ||
import { getTotalCount, getInUseTotalCount, getExecutionsPerDayCount } from './actions_telemetry'; | ||
|
||
export const TELEMETRY_TASK_TYPE = 'actions_telemetry'; | ||
|
||
export const TASK_ID = `Actions-${TELEMETRY_TASK_TYPE}`; | ||
export const SCHEDULE: IntervalSchedule = { interval: '15s' }; |
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.
should this be 1d
?
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.
Whops, ended up committing something for testing. Reverted back in 412db8d. That would have been A LOT of telemetry collection 😆
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Public APIs missing exports
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @mikecote |
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.
LGTM!
Fixes #140973
Fixes https://github.com/elastic/kibana-team/issues/563
In this PR, I'm fixing flaky tests that caused extra telemetry runs whenever CI would run them near midnight UTC. The assertion expected two runs while sometimes a 3rd run would happen if the test ran near midnight when the telemetry task was scheduled to run again..
To fix this, I've moved away from the midnight scheduling given telemetry only needs to be reported daily, and moved the task to use a
schedule
within task manager to make the task run daily (+24hrs from the previous run). This also improves error handling given task manager will now know it's a recurring task and recurring tasks never get marked asfailed
.The following verification steps can be done using this query in Dev Tools
To verify existing tasks migrating to a schedule
main
, setup a fresh Kibana and ES instancemain
to this PRawait taskManager.runSoon(TASK_ID);
after theensureScheduled
call withinx-pack/plugins/actions/server/usage/task.ts
.schedule
attribute addedTo verify fresh installs
schedule
attribute addedFlaky test runner: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2017