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

[Ingest Manager] Support updated package output structure #69864

Merged
merged 19 commits into from
Jun 29, 2020

Conversation

jen-huang
Copy link
Contributor

@jen-huang jen-huang commented Jun 24, 2020

‼️ Do not merge, PR needs to be merged in tandem with elastic/package-registry#514

Summary

Part of elastic/beats#19082. This PR makes the necessary changes for Ingest Manager to support package registry changes done in elastic/package-registry#514:

  • Update EPM's registry types and schemas to reflect registry package output changes
    • dataset.id was renamed to dataset.name, PR updates all references
  • Update data source saved object mappings to change stream[].dataset: string; to stream[].dataset: { name: string; type: string}
    • Associated types and schemas were also updated
  • Inline agent templates were removed from package registry in favor of template_path, datasourceService.assignPackageStream() and related methods were updated to fetch the stream templates
  • Moved inputs[].package information in agent config yaml to inputs[].meta.package
  • Updated associated tests for everything above

Example updated agent config yaml

Expand me (yaml for default config with system integration)
id: c455d4d0-b71f-11ea-a989-ef5894976394
revision: 2
settings:
  monitoring:
    enabled: true
    use_output: default
    logs: true
    metrics: true
outputs:
  default:
    type: elasticsearch
    hosts:
      - 'http://localhost:9200'
inputs:
  - id: c8a076d0-b71f-11ea-a989-ef5894976394
    name: system-1
    type: logs
    use_output: default
    meta:
      package:
        name: system
        version: 0.3.0
    dataset:
      namespace: default
    streams:
      - id: logs-system.auth
        dataset:
          name: system.auth
          type: logs
        paths:
          - /var/log/auth.log*
          - /var/log/secure*
        exclude_files:
          - .gz$
        multiline:
          pattern: ^\s
          match: after
        processors:
          - add_locale: null
          - add_fields:
              target: ''
              fields:
                ecs.version: 1.5.0
      - id: logs-system.syslog
        dataset:
          name: system.syslog
          type: logs
        paths:
          - /var/log/messages*
          - /var/log/syslog*
        exclude_files:
          - .gz$
        multiline:
          pattern: ^\s
          match: after
        processors:
          - add_locale: null
          - add_fields:
              target: ''
              fields:
                ecs.version: 1.5.0
  - id: c8a076d0-b71f-11ea-a989-ef5894976394
    name: system-1
    type: system/metrics
    use_output: default
    meta:
      package:
        name: system
        version: 0.3.0
    dataset:
      namespace: default
    streams:
      - id: system/metrics-system.cpu
        dataset:
          name: system.cpu
          type: metrics
        metricsets:
          - cpu
        core.metrics: null
        cpu.metrics:
          - percentages
          - normalized_percentages
        period: 10s
      - id: system/metrics-system.diskio
        dataset:
          name: system.diskio
          type: metrics
        metricsets:
          - diskio
      - id: system/metrics-system.load
        dataset:
          name: system.load
          type: metrics
        metricsets:
          - load
        core.metrics: null
        cpu.metrics: null
        period: 10s
        process.include_top_n.by_cpu: null
        process.include_top_n.by_memory: null
        processes: null
      - id: system/metrics-system.memory
        dataset:
          name: system.memory
          type: metrics
        metricsets:
          - memory
        core.metrics: null
        cpu.metrics: null
        period: 10s
        process.include_top_n.by_cpu: null
        process.include_top_n.by_memory: null
        processes: null
      - id: system/metrics-system.network
        dataset:
          name: system.network
          type: metrics
        metricsets:
          - network
        core.metrics: null
        cpu.metrics: null
        period: 10s
        process.include_top_n.by_cpu: null
        process.include_top_n.by_memory: null
        processes: null
      - id: system/metrics-system.process
        dataset:
          name: system.process
          type: metrics
        metricsets:
          - process
        period: 10s
        process.include_top_n.by_cpu: 5
        process.include_top_n.by_memory: 5
        processes:
          - .*
      - id: system/metrics-system.process_summary
        dataset:
          name: system.process_summary
          type: metrics
        metricsets:
          - process_summary
        core.metrics: null
        cpu.metrics: null
        period: 10s
        process.include_top_n.by_cpu: null
        process.include_top_n.by_memory: null
        processes: null
      - id: system/metrics-system.socket_summary
        dataset:
          name: system.socket_summary
          type: metrics
        metricsets:
          - socket_summary
        core.metrics: null
        cpu.metrics: null
        period: 10s
        process.include_top_n.by_cpu: null
        process.include_top_n.by_memory: null
        processes: null
      - id: system/metrics-system.uptime
        dataset:
          name: system.uptime
          type: metrics
        metricsets:
          - uptime
        core.metrics: null
        cpu.metrics: null
        period: 10s
        processes: null

Testing

Use:

All functionality should work normally with no UI changes, apart from slight agent config YAML view changes 😄

@jen-huang jen-huang self-assigned this Jun 24, 2020
@jen-huang jen-huang added release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.9.0 v8.0.0 labels Jun 25, 2020
@jen-huang jen-huang marked this pull request as ready for review June 25, 2020 21:26
@jen-huang jen-huang requested a review from a team June 25, 2020 21:26
@elasticmachine
Copy link
Contributor

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

@jen-huang jen-huang requested a review from ruflin June 25, 2020 21:32
@jen-huang jen-huang changed the title [WIP][Ingest Manager] Support updated package output structure [Ingest Manager] Support updated package output structure Jun 25, 2020
@paul-tavares
Copy link
Contributor

I will try to check this out locally today to see if its a matter of just updating the test case to match the new full agent config output

@jen-huang
Copy link
Contributor Author

jen-huang commented Jun 26, 2020

@paul-tavares The test failed because I moved package info under a new field, meta, so the snapshot needs to be updated. Working on it now!

@jen-huang jen-huang requested review from a team as code owners June 26, 2020 16:04
@paul-tavares
Copy link
Contributor

@jen-huang cool. I assume all that moving around is being coordinated with Agent and that the Endpoint specific data will still reach the endpoint, so 👍

@@ -16,7 +16,7 @@ const CONFIG_KEYS_ORDER = [
'inputs',
'enabled',
'use_output',
'package',
'meta',
Copy link
Member

Choose a reason for hiding this comment

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

@michalpristas for your awareness. As Agent ignores this at the moment, it should not have any effect.

@ruflin
Copy link
Member

ruflin commented Jun 29, 2020

@elasticmachine merge upstream

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.

@jen-huang I tested this PR together with the registry and the newest agent and everything seems to work as expected. I suggest we get the two PR's in in parallel and open quickly a backport for KB.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

History

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

@jen-huang jen-huang merged commit d9fcc58 into elastic:master Jun 29, 2020
@jen-huang jen-huang deleted the ingest/remove-registry-datasources branch June 29, 2020 21:06
jen-huang added a commit that referenced this pull request Jun 29, 2020
…70263)

* Update EPM package registry typings to reflect registry changes

* Change `dataset.id` references to `dataset.name`

* Fix RegistryStream

* Fix packageToConfigDatasourceInputs service

* Fix assignPackageStream service

* Fix validateDatasource service

* Fix configure data source components

* Fix variable

* Fix stream template installation

* Add support for `input[].dataset.type` and change `stream.dataset` mapping to be object containing `name` with instead of just a string

* Nest package information under `meta` in agent config yaml

* Move `dataset.type` to stream level instead of input level

* Make single call to fetch registry package information instead of doing it per stream

* Fix type issues

* Update endpoint test assertion

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jun 30, 2020
…ata-streams

* 'master' of github.com:elastic/kibana: (50 commits)
  [Logs UI] [Alerting] "Group by" functionality (elastic#68250)
  [Discover] Deangularize Skip to bottom button (elastic#69811)
  Implement recursive plugin discovery (elastic#68811)
  Use ts-expect-error in platform code (elastic#69883)
  [SIEM][Detection Engine][Lists] Moves getQueryFilter to common folder for use by both front and backend
  [Ingest Manager][SECURITY SOLUTION] adjust config reassign link and add roundtrip to Reassignment flow (elastic#70208)
  [Security][Lists] Add API functions and react hooks for value list APIs (elastic#69603)
  [ILM] Fix bug when clearing priority field (elastic#70154)
  [Platform][Security] Updates cluster_manager ignorePaths to include security scripts (elastic#70139)
  [IngestManager] Allow to filter agent by packages (elastic#69731)
  [code coverage] exclude folders: test_helpers, tests_bundle (elastic#70199)
  [Metrics UI] UX improvements for saved views (elastic#69910)
  [APM] docs: unique transaction troubleshooting (elastic#69831)
  Cross cluster search functional test with minimun privileges assigned to the test_user (elastic#70007)
  [Maps] choropleth layer wizard (elastic#69699)
  Make custom errors by extending Error (elastic#69966)
  [Ingest Manager] Support updated package output structure (elastic#69864)
  Resolver test coverage (elastic#70246)
  Async Discover search test (elastic#64388)
  [ui-shared-deps] include styled-components (elastic#69322)
  ...

# Conflicts:
#	x-pack/plugins/snapshot_restore/server/types.ts
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jun 30, 2020
…bana into alerting/consumer-based-rbac

* 'alerting/consumer-based-rbac' of github.com:gmmorris/kibana: (49 commits)
  [Discover] Deangularize Skip to bottom button (elastic#69811)
  Implement recursive plugin discovery (elastic#68811)
  Use ts-expect-error in platform code (elastic#69883)
  [SIEM][Detection Engine][Lists] Moves getQueryFilter to common folder for use by both front and backend
  [Ingest Manager][SECURITY SOLUTION] adjust config reassign link and add roundtrip to Reassignment flow (elastic#70208)
  [Security][Lists] Add API functions and react hooks for value list APIs (elastic#69603)
  [ILM] Fix bug when clearing priority field (elastic#70154)
  [Platform][Security] Updates cluster_manager ignorePaths to include security scripts (elastic#70139)
  [IngestManager] Allow to filter agent by packages (elastic#69731)
  [code coverage] exclude folders: test_helpers, tests_bundle (elastic#70199)
  [Metrics UI] UX improvements for saved views (elastic#69910)
  [APM] docs: unique transaction troubleshooting (elastic#69831)
  Cross cluster search functional test with minimun privileges assigned to the test_user (elastic#70007)
  [Maps] choropleth layer wizard (elastic#69699)
  Make custom errors by extending Error (elastic#69966)
  [Ingest Manager] Support updated package output structure (elastic#69864)
  Resolver test coverage (elastic#70246)
  Async Discover search test (elastic#64388)
  [ui-shared-deps] include styled-components (elastic#69322)
  SECURITY-ENDPOINT: add host properties (elastic#70238)
  ...
Bamieh pushed a commit to Bamieh/kibana that referenced this pull request Jul 1, 2020
)

* Update EPM package registry typings to reflect registry changes

* Change `dataset.id` references to `dataset.name`

* Fix RegistryStream

* Fix packageToConfigDatasourceInputs service

* Fix assignPackageStream service

* Fix validateDatasource service

* Fix configure data source components

* Fix variable

* Fix stream template installation

* Add support for `input[].dataset.type` and change `stream.dataset` mapping to be object containing `name` with instead of just a string

* Nest package information under `meta` in agent config yaml

* Move `dataset.type` to stream level instead of input level

* Make single call to fetch registry package information instead of doing it per stream

* Fix type issues

* Update endpoint test assertion

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
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.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants