-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Make sub-fields of aggregate_metric_double field type optional #74145
Comments
Pinging @elastic/es-analytics-geo (Team:Analytics) |
Pinging @elastic/es-search (Team:Search) |
@axw we discussed about this issue with the team and we would like to ask what is the use case that fixing this issue would solve for you. This will help us understand if relaxing this constrain is the best solution for your use case. |
@csoulios the use-case is for APM to store custom application metrics. Different metrics sources will provide different sets of summary metrics. Often it will just be sum+count. Other times min and max will also be available. We never know ahead of time. |
@axw Thanks for the answer. I have a follow up question on this. Why can't you define different fields (one for each summary metric), so you can have a field to store sum+count and another field to store min+max. In this case you will define the supported metrics for each field in their mapping. |
We don't know the full set of metric names up front. They're application-defined, not within APM's control. Metrics come to APM Server something like this: {
"metrics": {
"count_and_sum": {
"count": 100,
"sum": 500
},
"count_and_sum_and_minmax": {
"count": 100,
"sum": 500,
"min": 0,
"max": 500
}
}
} The names "count_and_sum" and "count_and_sum_and_minmax" are completely arbitrary, and unknown to APM Server. We dynamically map these metrics as individual fields, so the resulting document should look like this: {
"count_and_sum": {
"value_count": 100,
"sum": 500
},
"count_and_sum_and_minmax": {
"count": 100,
"sum": 500,
"min": 0,
"max": 500
}
} Each of those fields would be mapped as |
Thanks, let me discuss this again with the team and I will get back to you |
We'd like to discuss this one a bit more with APM, looking for some times to coordinate discussions. |
@wchaparro @csoulios I've been chatting with @felixbarny about this issue, and our needs in APM. Re-reading the description, maybe we can reduce the scope a bit? In APM we would use the field as follows:
So for APM, Regarding making
Results in:
If you aggregate over just Seems to me that aggregating over a single index/field should behave exactly the same. |
@csoulios planning to close this one in favor of current discussions on downsampling. Please reopen if needed. |
@wchaparro is there an equivalent of this issue in the context of downsampling? Note that in APM, we're using We just define summary metrics as a pair of sum and value_count, and ignore all other sub fields. So we have a workaround but I don't really understand why this got closed unless this is a duplicate. |
reopening this one - tagging with Downsampling, to track going forward. |
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
Pinging @elastic/es-search-foundations (Team:Search Foundations) |
Currently, when a user defines a field of type
aggregate_metric_double
with any of the supported summary sub-fields (min
,max
,value_count
,sum
), all inserted documents are required to contain all sub-fields. We have found this approach to be very restrictive and we should relax this constraint.Perhaps, we should allow some (or all?) sub-fields of an
aggregate_metric_double
field to be empty. In this case we should decide how we handle the following cases:default_metric
sub-field is empty? We rely on this field for delegating many operations.I am opening this ticket for discussion so that we plan implementing it.
The text was updated successfully, but these errors were encountered: