Skip to content
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] Make stream id unique in agent policy #82447

Merged

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented Nov 3, 2020

Description

Resolve #81617 elastic/beats#22054

This PR make stream id unique, this allow to have multiple time the same integrations in an agent policy.

What changed?

  • the stream id is not generated client side anymore
  • when we persist a package policy (create|bulkCreate|update) we generated ids for streams
  • the stream id is suffixed the package policy id.
  • For input validate client side we do not use id anymore but dataset

I confirmed with @michalpristas there is not limit on the id size.

Example config

After

Screen Shot 2020-11-03 at 4 56 56 PM

Before

Screen Shot 2020-11-03 at 5 21 19 PM

How to test this?

  • Create a config
  • add multiple time the same integration (custom log is easy to read and configure)
  • Copy a policy should work too

@nchaulet nchaulet self-assigned this Nov 3, 2020
@nchaulet nchaulet force-pushed the feature-fleet-81617-unique-stream-id branch from 62c4091 to c50837e Compare November 3, 2020 16:18
@nchaulet nchaulet added Team:Fleet Team label for Observability Data Collection Fleet team v7.11.0 v8.0.0 release_note:skip Skip the PR/issue when compiling release notes labels Nov 3, 2020
@nchaulet nchaulet marked this pull request as ready for review November 3, 2020 22:25
@nchaulet nchaulet requested a review from a team November 3, 2020 22:25
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@nchaulet nchaulet requested a review from ruflin November 5, 2020 18:59
Copy link
Member

@ruflin ruflin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens in the following scenario:

  • Integration has 3 inputs and it is saved
  • I update 1 input and save the integration

Will all ids stay the same, will it regenerate all 3 or just one?

This is relevant because on the Agent / Beat side AFAIK the hash of the input is used to decide if an input is restarted or not. So if all ids keep changing all the time, it means for example log inputs are constantly stopped and started again.

@nchaulet
Copy link
Member Author

nchaulet commented Nov 6, 2020

@ruflin The ids will stay the same, the uuid part of the id is created when you create the package policy for the first time.

@ruflin
Copy link
Member

ruflin commented Nov 6, 2020

Great. So even if an input is changed, it keeps the id! That might even be beneficial to track issues.

@nchaulet nchaulet requested a review from a team November 6, 2020 15:24
@nchaulet
Copy link
Member Author

nchaulet commented Nov 6, 2020

@elasticmachine merge upstream

Copy link
Contributor

@jen-huang jen-huang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested locally

@@ -54,7 +54,7 @@ const PackagePolicyBaseSchema = {
),
streams: schema.arrayOf(
schema.object({
id: schema.string(),
id: schema.maybe(schema.string()), // BWC < 7.11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nchaulet
Copy link
Member Author

nchaulet commented Nov 8, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

async chunks size

id before after diff
ingestManager 1.2MB 1.2MB +34.0B

page load bundle size

id before after diff
ingestManager 386.4KB 386.3KB -78.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@nchaulet nchaulet merged commit 8560b2d into elastic:master Nov 8, 2020
@nchaulet nchaulet deleted the feature-fleet-81617-unique-stream-id branch November 8, 2020 23:51
nchaulet added a commit to nchaulet/kibana that referenced this pull request Nov 8, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request Nov 9, 2020
* master: (68 commits)
  [Fleet] Make stream id unique in agent policy (elastic#82447)
  skip flaky suite (elastic#82915)
  skip flaky suite (elastic#75794)
  Copy `dateAsStringRt` to observability plugin (elastic#82839)
  [Maps] rename connected_components/map folder to mb_map (elastic#82897)
  [Security Solution] Fix EventsViewer DnD cypress tests (elastic#82619)
  [Security Solution] Adds logging and performance fan out API for threat/Indicator matching (elastic#82546)
  Implemented Alerting health status pusher by using task manager and status pooler for Kibana status plugins 'kibanahost/api/status' (elastic#79056)
  [APM] Adds new configuration 'xpack.apm.maxServiceEnvironments' (elastic#82090)
  Move single use function in line (elastic#82885)
  [ML] Add unsigned_long support to data frame analytics and anomaly detection (elastic#82636)
  Add flot_chart dependency from shared_deps to Shareable Runtime (elastic#81649)
  [Security Solution][Detections] - Auto refresh all rules/monitoring tables (elastic#82062)
  [APM] Fix apm e2e runner script commands (elastic#82798)
  [Ingest Manager] Move cache functions to from registry to archive (elastic#82871)
  Update webpack-dev-server and webpack-cli (elastic#82844)
  [Uptime] Migrate to new es client (elastic#82003)
  Move parseAndVerify* functions to validation.ts (elastic#82845)
  Remove yeoman & yo (elastic#82825)
  [Canvas] Fix elements not being updated properly when filter is changed on workpad (elastic#81863)
  ...
phillipb added a commit to phillipb/kibana that referenced this pull request Nov 10, 2020
…e-details-overlay

* 'master' of github.com:elastic/kibana: (201 commits)
  Added `defaultActionMessage` to index threshold alert UI type definition (elastic#80936)
  [ILM] Migrate Delete phase and name field to Form Lib (elastic#82834)
  skip flaky suite (elastic#57426)
  [Alerting] adds an Run When field in the alert flyout to assign the action to an Action Group (elastic#82472)
  [APM] Expose APM event client as part of plugin contract (elastic#82724)
  [Logs UI] Fix errors during navigation (elastic#78319)
  Enable send to background in TSVB (elastic#82835)
  SavedObjects search_dsl: add match_phrase_prefix clauses when using prefix search (elastic#82693)
  [Ingest Manager] Unify install* under installPackage (elastic#82916)
  [Fleet] Make stream id unique in agent policy (elastic#82447)
  skip flaky suite (elastic#82915)
  skip flaky suite (elastic#75794)
  Copy `dateAsStringRt` to observability plugin (elastic#82839)
  [Maps] rename connected_components/map folder to mb_map (elastic#82897)
  [Security Solution] Fix EventsViewer DnD cypress tests (elastic#82619)
  [Security Solution] Adds logging and performance fan out API for threat/Indicator matching (elastic#82546)
  Implemented Alerting health status pusher by using task manager and status pooler for Kibana status plugins 'kibanahost/api/status' (elastic#79056)
  [APM] Adds new configuration 'xpack.apm.maxServiceEnvironments' (elastic#82090)
  Move single use function in line (elastic#82885)
  [ML] Add unsigned_long support to data frame analytics and anomaly detection (elastic#82636)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] Generate unique ID by stream
5 participants