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

Improve performance of TimelineFieldsResource endpoint #3200

Open
3 tasks
jkppr opened this issue Oct 9, 2024 · 2 comments
Open
3 tasks

Improve performance of TimelineFieldsResource endpoint #3200

jkppr opened this issue Oct 9, 2024 · 2 comments
Labels
Backend Rest API Issue related to the Rest API backend

Comments

@jkppr
Copy link
Collaborator

jkppr commented Oct 9, 2024

In PR #3182 we introduced a new API endpoint TimelineFieldsResource to gather unique field names per timeline to improve the UX of the visualizations dialog.

https://github.com/google/timesketch/pull/3182/files#diff-bb4334f2502d8d96c5689e099dd1440470e425b43a01d8221ebfaabd18511862R538

Currently, the endpoint retrieves the unique fields by:

  1. Aggregating all data types within the timeline.
  2. For each data type, querying for a single event to get the fields.

This approach can be inefficient, especially for timelines with many data types. This approach also ignores that some data_types can have different fields per event or have some events with annotated fields by analyzers.

This issue is to track research into a more efficient way of gathering those fields. Possible approaches to investigate include:

  • Using OpenSearch field capabilities: Explore if OpenSearch provides a more direct way to retrieve unique fields for a given index and data type.
  • Caching field information: Investigate caching the field information to avoid redundant queries.
  • Optimizing the aggregation: Analyze if the aggregation step can be optimized or if it can be avoided altogether.
    • Find all unique fields for a given data_type

Tasks:

  • Research alternative approaches for retrieving unique fields.
  • Benchmark the performance of different approaches.
  • Implement the most performant solution.

Related PRs:

@jkppr jkppr added Backend Rest API Issue related to the Rest API backend labels Oct 9, 2024
@manojks1999
Copy link

@jkppr Can I work on this ?

@jkppr
Copy link
Collaborator Author

jkppr commented Dec 12, 2024

Hi @manojks1999 , before working on this problem, let's brainstorm your ideas on how to tackle the problems outlined. Can you share your ideas/concepts on how to fix these problems?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend Rest API Issue related to the Rest API backend
Projects
None yet
Development

No branches or pull requests

2 participants