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

[FEATURE] Add an ID Field to Search Query Records #159

Open
ansjcy opened this issue Nov 18, 2024 · 1 comment
Open

[FEATURE] Add an ID Field to Search Query Records #159

ansjcy opened this issue Nov 18, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request v2.19.0 Issues targeting release v2.19.0

Comments

@ansjcy
Copy link
Member

ansjcy commented Nov 18, 2024

Is your feature request related to a problem?

To support fetching a specific search query record by ID (e.g., for the current detail page or inspecting a historical slow query in the future), we need to add a unique identifier to each search query record.

What solution would you like?

Add an ID field to search query records.

  • Preferred Approach: Use a randomly generated UUID (via UUID.randomUUID() in Java). UUIDs are 128 bits and provide ~3.4 × 10³⁸ possible values, making the probability of collision effectively zero for our use case.

What alternatives have you considered?

  • Use the timestamp as the ID: This may fail when multiple queries share the same timestamp.
  • Use a group hash code: While useful for identifying groups, it is insufficient for distinguishing individual queries within a group at different timestamps.
  • Generate an ID by hashing the query source and timestamp - this won't avoid ID collision neither

Do you have any additional context?

This feature is a prerequisite for opensearch-project/query-insights-dashboards#12

@ansjcy ansjcy added enhancement New feature or request untriaged labels Nov 18, 2024
@ansjcy ansjcy self-assigned this Nov 18, 2024
@ansjcy ansjcy removed the untriaged label Nov 18, 2024
@ansjcy
Copy link
Member Author

ansjcy commented Nov 18, 2024

We need to pick this up as part of the QID release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v2.19.0 Issues targeting release v2.19.0
Projects
None yet
Development

No branches or pull requests

2 participants