-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Synthetics] add monitor id migration #143879
[Synthetics] add monitor id migration #143879
Conversation
…-ref HEAD~1..HEAD --fix'
…hub.com/dominiqueclarke/kibana into feature/synthetics-monitor-id-migration
@elasticmachine merge upstream |
…hub.com/dominiqueclarke/kibana into feature/synthetics-monitor-id-migration
…ics-monitor-id-migration
…ics-monitor-id-migration
Pinging @elastic/uptime (Team:uptime) |
x-pack/plugins/synthetics/common/runtime_types/monitor_management/locations.ts
Show resolved
Hide resolved
x-pack/plugins/synthetics/common/runtime_types/monitor_management/locations.ts
Show resolved
Hide resolved
@elasticmachine merge upstream |
@@ -139,7 +139,8 @@ export const TestRunsTable = ({ paginable = true, from, to }: TestRunsTableProps | |||
}, | |||
]; | |||
|
|||
const historyIdParam = monitor?.[ConfigKey.CUSTOM_HEARTBEAT_ID] ?? monitor?.[ConfigKey.ID]; | |||
const historyIdParam = | |||
monitor?.[ConfigKey.CUSTOM_HEARTBEAT_ID] ?? monitor?.[ConfigKey.MONITOR_QUERY_ID]; |
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.
so we need migration to get rid of this?
191490a
to
9e62978
Compare
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.
Let's do follow up to clean up the usage of the field !!
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
POST FF Testing, tested this on cloud staging
|
Summary
Relates to #143309
Adds a migration to add two fields to each monitor saved object
[ConfigKey.HEARTBEAT_ID] ('id')
- The id to use for ES queries to heartbeat. Either the saved object id for UI monitors, or the custom heartbeat id for project monitors. This new key can be used regardless of monitor type as the single source of truth as the id to use for ES queries[ConfigKey.CONFIG_ID] ('config_id')
- This id is always the saved object id. It is an exact match tosavedObject.id
. I've added this key as a way to perform aggregations against the monitor saved object id in the future, as it's currently impossible to do terms aggregations againstsavedObject.id
but possible to do aggregations os any field within the savedObject attributes. By moving a copy of the id into the saved object attributes, we can perform aggregations if needed in the future.This PR is a prerequisite for standardizing the use of
ConfigKey.HEARTBEAT_ID
across the app. Making use of these new keys in a predictable, standardized way will take place in a subsequent PR.Testing
id
andconfig_id
value. For project monitors, theid
value should matchcustom_heartbeat_id
. For ui monitors, theid
value should match the saved object id. For both monitor types, theconfig_id
value should match the saved object id.