-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Fleet] added time_series_metric mapping for metric_type package field #126322
Conversation
Pinging @elastic/fleet (Team:Fleet) |
@@ -193,7 +196,6 @@ export function generateMappings(fields: Field[]): IndexTemplateMappings { | |||
break; | |||
default: { | |||
const meta = {}; | |||
if ('metric_type' in field) Reflect.set(meta, 'metric_type', field.metric_type); |
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.
question: can metric_type
just be removed from meta
or does it need to be kept/migrated for BWC?
it looks like the change of adding time_series_metric
causes errors when installing system or apm package:
│ proc [kibana] [2022-02-24T13:30:17.599+01:00][ERROR][plugins.fleet] Error: Error installing system 1.11.0: illegal_argument_exception: [illegal_argument_exception] Reason: composable template [metrics-system.filesystem] template after composition with component templates [metrics-system.filesystem@settings, metrics-system.filesystem@custom, .fleet_component_template-1] is invalid
│ proc [kibana] at ensureInstalledPackage (/Users/juliabardi/kibana/kibana/x-pack/plugins/fleet/server/services/epm/packages/install.ts:129:11)
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.
question: can
metric_type
just be removed frommeta
or does it need to be kept/migrated for BWC?
I don't know of anything using the meta field, but maybe we can keep it for some time just in case? On this comment #82273 (comment) @ruflin also seemed to prefer keeping both approaches during some time.
it looks like the change of adding time_series_metric causes errors when installing system or apm package:
Regarding the error, could it be that aggregations
is mandatory when using the "object" format? In the examples in elastic/elasticsearch#74014, this format is only used when aggregations
is also present.
Maybe we have to use this format when there are no aggregations as is the case now:
"time_series_metric": "gauge"
@csoulios is it ok to set only the metric type without aggregations?
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.
Thanks, it works if I change to string like "time_series_metric": "gauge"
. If later we need to support aggregations, is it going to be possible to change from string to object?
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.
Currently, the time_series_metric
field only supports a string value that can be any of the gauge
, counter
, histogram
, summary
. The object format is not currently supported.
I would like to ask which of the above values do you plan to use.
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.
I'm not sure what are all the possible values of metric_type/time_series_metric, maybe @jsoriano knows?
It looks like the string format works, so we can go ahead with that, let me know if any concerns.
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.
By now we only allow counter
and gauge
in packages.
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
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.
Code looks good 🚀
elastic#126322) * moved metric_type to time_series_metric mapping * added back meta.metric_type for bwc, made time_series_metric to string
manual test case here: #115621 (comment) |
Summary
Closes #115621
Moved
metric_type
totime_series_metric
mapping, removed frommeta
.Example:
Resulting mapping:
Checklist