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

RFC/PROPOSAL: add timestamp to query.request #29

Closed
epugh opened this issue Oct 23, 2024 · 4 comments · Fixed by #28
Closed

RFC/PROPOSAL: add timestamp to query.request #29

epugh opened this issue Oct 23, 2024 · 4 comments · Fixed by #28
Labels
bug Something isn't working RFC Request for Comment
Milestone

Comments

@epugh
Copy link
Member

epugh commented Oct 23, 2024

What/Why

What are you proposing?

We propose that the we add to the query request schema a timestamp field so that consumers of UBI data can know when the query was made. This timestamp field would mirror the existing timestamp field defined in the event schema:

https://o19s.github.io/ubi/docs/html/1.1.0/event.schema.html#timestamp

What users have asked for this feature?

We actually have in the OpenSearch UBI plugin that we track queries by a Unix Epoch field, so we capture the specific date time. But that is a different format than what we use for events. We also support a "date" but not a "datetime", so this needs fixing in the UBI plugin for OpenSearch anyway.

What problems are you trying to solve?

Consistency in the UBI specification and the UBI plugin, and moving to using ISO 8601 formatted time stamps everywhere to simplify down stream users of UBI data.

This bug was discovered by @alexeyrodriguez during his work to simulate UBI formatted data. Thanks @alexeyrodriguez!

Are there any breaking changes to the Spec

Yes, if you used Chorus for OpenSearch edition, then you would need to update. In the future this might cause a major version bump in the spec, but today, I think it's niche enough we use it as a chance to bump the minor version.

What is the user experience going to be?

Simpler consumption of the data.

Are there breaking changes to the User Experience?

Yes, if you used epoch formatted dates you need to switch to ISO 8601 format.

Why should it be built? Any reason not to?

Definitly let's change now before UBI becomes even more widespread ;-)/

What will it take to execute?

  1. Update UBI Spec
  2. Update UBI for OpenSearch Plugin schema defintion
  3. Update Chorus for OPenSearch to change format of dates being sent.
  4. Documentation and samples updates.

Any remaining open questions?

No.

@epugh epugh added bug Something isn't working RFC Request for Comment labels Oct 23, 2024
@epugh
Copy link
Member Author

epugh commented Oct 23, 2024

This is what the spec will look like.. Ignore the 1.1 version, this will be in 1.2...
image

@jzonthemtn
Copy link
Collaborator

There is already a timestamp field in the queries mapping. What we can do is if the user provides a timestamp in the search request, the UBI plugin can use it instead of now.

@epugh epugh linked a pull request Oct 23, 2024 that will close this issue
@epugh
Copy link
Member Author

epugh commented Oct 23, 2024

This is a revamped version, where we take out the required nature, and articulate two use cases for why you might want to provide the timestamp instead of letting the UBI plugin for the search engine do it.

image

@epugh epugh added this to the 1.2 milestone Oct 23, 2024
@jzonthemtn
Copy link
Collaborator

Looks good. Linking opensearch-project/user-behavior-insights#39 for visibility.

@epugh epugh closed this as completed in #28 Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working RFC Request for Comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants