-
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
[eem] remove history transforms #193999
[eem] remove history transforms #193999
Changes from all commits
7359805
46423e5
be50f9d
87f2632
c1cf4c7
f01a8a0
8d0df93
eef049e
238a3c9
1d9441e
6cb7e26
9f43b89
32f33f7
97c0270
7ea3236
eb3a923
c2a163d
31cd18a
3f28a24
ad391ae
b2e80c0
e379a12
5f458dd
5fc1130
6a457c4
60d9ec4
f2afe29
5ddf79b
ef2abd2
73f0a7d
6d189dd
55dae11
99ebedc
02ca50e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,6 @@ import { | |
durationSchema, | ||
identityFieldsSchema, | ||
semVerSchema, | ||
historySettingsSchema, | ||
durationSchemaWithMinimum, | ||
} from './common'; | ||
|
||
export const entityDefinitionSchema = z.object({ | ||
|
@@ -32,22 +30,17 @@ export const entityDefinitionSchema = z.object({ | |
metrics: z.optional(z.array(keyMetricSchema)), | ||
staticFields: z.optional(z.record(z.string(), z.string())), | ||
managed: z.optional(z.boolean()).default(false), | ||
history: z.object({ | ||
latest: z.object({ | ||
timestampField: z.string(), | ||
interval: durationSchemaWithMinimum(1), | ||
settings: historySettingsSchema, | ||
lookbackPeriod: z.optional(durationSchema).default('24h'), | ||
settings: z.optional( | ||
z.object({ | ||
syncField: z.optional(z.string()), | ||
syncDelay: z.optional(durationSchema), | ||
frequency: z.optional(durationSchema), | ||
}) | ||
), | ||
}), | ||
latest: z.optional( | ||
z.object({ | ||
settings: z.optional( | ||
z.object({ | ||
syncField: z.optional(z.string()), | ||
syncDelay: z.optional(durationSchema), | ||
frequency: z.optional(durationSchema), | ||
}) | ||
), | ||
}) | ||
), | ||
installStatus: z.optional( | ||
z.union([ | ||
z.literal('installing'), | ||
|
@@ -57,6 +50,18 @@ export const entityDefinitionSchema = z.object({ | |
]) | ||
), | ||
installStartedAt: z.optional(z.string()), | ||
installedComponents: z.optional( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this allows cleaning up versions of definitions that contain history components |
||
z.array( | ||
z.object({ | ||
type: z.union([ | ||
z.literal('transform'), | ||
z.literal('ingest_pipeline'), | ||
z.literal('template'), | ||
]), | ||
id: z.string(), | ||
}) | ||
) | ||
), | ||
}); | ||
|
||
export const entityDefinitionUpdateSchema = entityDefinitionSchema | ||
|
@@ -69,7 +74,7 @@ export const entityDefinitionUpdateSchema = entityDefinitionSchema | |
.partial() | ||
.merge( | ||
z.object({ | ||
history: z.optional(entityDefinitionSchema.shape.history.partial()), | ||
latest: z.optional(entityDefinitionSchema.shape.latest.partial()), | ||
version: semVerSchema, | ||
}) | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,8 +33,6 @@ export const ENTITY_LATEST_PREFIX_V1 = | |
`${ENTITY_BASE_PREFIX}-${ENTITY_SCHEMA_VERSION_V1}-${ENTITY_LATEST}` as const; | ||
|
||
// Transform constants | ||
export const ENTITY_DEFAULT_HISTORY_FREQUENCY = '1m'; | ||
export const ENTITY_DEFAULT_HISTORY_SYNC_DELAY = '60s'; | ||
export const ENTITY_DEFAULT_LATEST_FREQUENCY = '30s'; | ||
export const ENTITY_DEFAULT_LATEST_SYNC_DELAY = '1s'; | ||
export const ENTITY_DEFAULT_METADATA_LIMIT = 1000; | ||
export const ENTITY_DEFAULT_LATEST_FREQUENCY = '1m'; | ||
export const ENTITY_DEFAULT_LATEST_SYNC_DELAY = '60s'; | ||
export const ENTITY_DEFAULT_METADATA_LIMIT = 10; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. took the opportunity to reduce the default limit |
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.
Q: Since we're dropping this (previously required) field.
What would occur in the event of a rollback (if we have to revert to the current version after deploying the version including these changes, and having created a few entities)?
Will the newly formatted entities be considered corrupt by Kibana?
If so, can Kibana self-recover? Or will users suffer from data loss?
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.
There's a few difference regarding how the fields are aggregated in the new version, but overall entities keep the same schema (minus one field that's removed in the new version), so rollback/rollforward would be seamless as far as stored documents goes.
The entity definitions installed in the new version would be somewhat broken in the rolled back environment (few apis won't be able to interact with those). I didn't implement a good story for this since 1. this is tech preview 2. we don't have released product built on these yet.
Where can I read about our rollback strategy ?
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.
@kobelb, @rudolf, with those premises (unreleased tech preview), is it OK to make these changes in our SO schema?
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.
@afharo @kobelb @rudolf are we fine with this ?
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.
At the end of the day making breaking changes to internal APIs or disrupting the UI during a rollback is a product decision. The team responsible for it is best able to make this tradeoff. The important thing is that we do weigh up such customer impact instead of just shipping something. It sounds like the team has done this 👍🏻