-
Notifications
You must be signed in to change notification settings - Fork 22
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
Backend: Fix Lucene logs so it only uses date_histogram #277
Conversation
"field": "agent.keyword", | ||
"id": "2", | ||
"settings": { | ||
"interval": "20m", | ||
"min_doc_count": "0", | ||
"trimEdges": "0" | ||
"interval": "1000", | ||
"min_doc_count": "15" | ||
}, | ||
"type": "date_histogram" | ||
"type": "histogram" |
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.
Test now shows that even with "histogram" and "min_doc_count" set, query is built with default date_histogram
@@ -7,14 +7,13 @@ | |||
"alias": "", | |||
"bucketAggs": [ | |||
{ | |||
"field": "timestamp", |
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.
is there a reason that the field changed?
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.
yes, sorry this should have also gone into an explanatory comment. this also shows that no matter the field put here, the "defaultTimeField" will be used over here https://github.com/grafana/opensearch-datasource/pull/277/files#diff-44afe4fa7a308b985c56a75c710979bd17870768f6365e65baa40115849846e6R91 resulting in this kind of query to OpenSearch here https://github.com/grafana/opensearch-datasource/pull/277/files/98a8fa01a4bf2aa0adc11573355c0143f38a1c99#diff-1a311aa56365fe4dc3d664446f14d8c7835626e6a2a908be02eee3d403ad4808R44.
What this PR does / why we need it:
We discovered that in the frontend, Lucene logs queries were built only with
date_histogram
grouping by default time field, no matter what is chosen in the UI.This fixes the backend to do the same. (This should only affect queries executed in Explore as of v2.10.0.
Which issue(s) this PR fixes:
Contributes to #199