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

[Scheduled Reports] Task data required for scheduling, and mapping additions needed for the historical index #75610

Closed
tsullivan opened this issue Aug 20, 2020 · 3 comments
Labels
discuss Feature:Reporting:Framework Reporting issues pertaining to the overall framework impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort needs-team Issues missing a team label

Comments

@tsullivan
Copy link
Member

tsullivan commented Aug 20, 2020

In the Reporting data, there are fields that describe the state of an item in a queue. This allows the index itself to act as a distributed task queue of the items that it stores.

With Reporting moving from the ESQueue sub-module to Task Manager, what impact will that have on the mapping of the fields in the reporting index? What needs to be added and will any need to go away?

Data belonging in Parameters and State of the Task Instance

For the "Create Recurring Report" form, fields of data belongs to Task Manager as the schedule definition, and are all fields of data in the scheduled task instance's parameters.

For the table of schedules these rows will come from a search against the Task Manager system index to find all scheduled tasks that match the reporting:execute task type. The returned set of "task instances" will include params and state for each task.

Parameters come from user input at the time the task was first scheduled.

State comes from the accumulated output of previous task runs.

Both of those data objects are available in the run context available to our task definition's run function.

Task Parameter Data:

  • Schedule name (report name)
  • URL of the page (PNG/PDF) or saved object ID/search source (CSV)
  • File type (PNG/PDF/CSV)
  • time range in the time picker
  • username
  • encrypted request headers, or an API token that allows recurring auth on behalf of the user that created the schedule
  • Interval expression (cron)
  • Array of actions

Task State Data:

  • Last report timestamp
  • Last status string

Alternative to using task state for latest status
There is also an Event Log that can preserve information about previous task runs. The state of a task would be replaced at the end of each task run, so it doesn't have any history and wouldn't be able to identify trends, while Event Log could do that.

Data belonging in the Historical Index

In this issue, the Reporting system index is referred to as the historical index, but it is also formerly the queue index that powered ESQueue.

To show the historical listing of reports, we'll continue the pattern of searching against the Reporting system index. That provides a historical listing, and is pretty much what we have today in the list of reports in the Management app.

New fields must be added to support scheduling. Certain parts of the schedule data can be "flattened" into the historical data data, such as the name of the schedule, and recurrence. We will need the task instance ID in this data to refer back to the schedule that created it since editing, pausing, retrying, etc will probably require access to the full params of the task instance.

Already exists for historical reports:

  • Saved object
  • File type
  • File size
  • Report date
  • Status
  • Retry button (using the job params in the document)
  • Download

New field for the historical reports:

  • Task instance ID
  • Schedule name
  • Recurrence (cron string | time units)

In the UI of historical reports, there should be a recurrence column showing a human-friendly value of the duration between reports, or the word "Custom". Therefore I propose the internal representation of recurrence in the system is time unit or cron string.

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-reporting-services (Team:Reporting Services)

@tsullivan tsullivan added WIP Work in progress and removed WIP Work in progress labels Aug 21, 2020
@tsullivan tsullivan changed the title [Scheduled Reports] ES mapping changes required for scheduled reports. [Scheduled Reports] Task data required for scheduling, and mapping additions needed for the historical index Aug 26, 2020
@tsullivan tsullivan added (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Team:AppServices and removed Team:Reporting Services labels Dec 17, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServices)

@tsullivan
Copy link
Member Author

This is already implemented in #64853

@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels May 13, 2021
@sophiec20 sophiec20 added Feature:Reporting:Framework Reporting issues pertaining to the overall framework and removed (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead (Deprecated) Team:Reporting Services labels Aug 21, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Feature:Reporting:Framework Reporting issues pertaining to the overall framework impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort needs-team Issues missing a team label
Projects
None yet
Development

No branches or pull requests

4 participants