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

Update types, schemas, and saved objects for datasources. #58921

Closed

Conversation

jfsiii
Copy link
Contributor

@jfsiii jfsiii commented Feb 28, 2020

refs #58874

Based on specs/examples from beats repo 1 & 2

πŸ‘ /datasources POST accepted the various examples linked above and GET returned the list of the datasource objects
❓ Is this correct? If so, what else do I need to do? Add/update tests? Any esarchiver data/mappings ?

πŸ‘ŽFails type checks because of issues on one UI view (datasources table):
ERROR x-pack failed
      x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/details_page/components/datasources_table.tsx:46:37 - error TS2339: Property 'name' does not exist on type 'DatasourceWithConfig'.

      46     originalDatasources?.map(({ id, name, inputs, package: datasourcePackage, configs }) => ({
                                             ~~~~

      x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/details_page/components/datasources_table.tsx:51:40 - error TS2339: Property 'title' does not exist on type '{ name: string; version: string; }'.

      51       packageTitle: datasourcePackage?.title,
                                                ~~~~~

      x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/details_page/components/datasources_table.tsx:53:46 - error TS2339: Property 'description' does not exist on type '{ name: string; version: string; }'.

      53       packageDescription: datasourcePackage?.description,
                                                      ~~~~~~~~~~~

      Found 3 errors.
❓ What should I do about the issues with datasources table? I can remove the properties which are causing the errors and leave porting / updating for a later pass. I'm still getting up to speed on the latest workflows.

Based on specs/examples at https://github.com/elastic/beats/blob/feature-ingest/x-pack/agent/docs/agent_configuration_example.yml#L28-L61 & https://github.com/elastic/beats/blob/c46ae67648b08f8d263de3eb7db870f77bbc2558/x-pack/agent/pkg/agent/program/testdata/single_config.yml#L22-L40

Create & list for /datasources API worked as expected

Fails type checks because of issues on one UI view (datasources table):
```
ERROR x-pack failed
      x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/details_page/components/datasources_table.tsx:46:37 - error TS2339: Property 'name' does not exist on type 'DatasourceWithConfig'.

      46     originalDatasources?.map(({ id, name, inputs, package: datasourcePackage, configs }) => ({
                                             ~~~~

      x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/details_page/components/datasources_table.tsx:51:40 - error TS2339: Property 'title' does not exist on type '{ name: string; version: string; }'.

      51       packageTitle: datasourcePackage?.title,
                                                ~~~~~

      x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/details_page/components/datasources_table.tsx:53:46 - error TS2339: Property 'description' does not exist on type '{ name: string; version: string; }'.

      53       packageDescription: datasourcePackage?.description,
                                                      ~~~~~~~~~~~

      Found 3 errors.
```
@nchaulet
Copy link
Member

For the datasource table, the new one changed a lot I think we can use id instead of name see proto

@kibanamachine
Copy link
Contributor

πŸ’” Build Failed


Test Failures

Kibana Pipeline / kibana-oss-agent / Chrome UI Functional Tests.test/functional/apps/context/_date_nanosΒ·js.context app context view for date_nanos displays predessors - anchor - successors in right order

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 1 times on tracked branches: https://github.com/elastic/kibana/issues/58815

[00:00:00]       β”‚
[00:00:12]         β””-: context app
[00:00:12]           β””-> "before all" hook
[00:00:12]           β””-> "before all" hook
[00:00:12]             β”‚ info [logstash_functional] Loading "mappings.json"
[00:00:12]             β”‚ info [logstash_functional] Loading "data.json.gz"
[00:00:12]             β”‚ info [o.e.c.m.MetaDataCreateIndexService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [logstash-2015.09.22] creating index, cause [api], templates [], shards [1]/[0], mappings [_doc]
[00:00:12]             β”‚ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[logstash-2015.09.22][0]]]).
[00:00:12]             β”‚ info [logstash_functional] Created index "logstash-2015.09.22"
[00:00:12]             β”‚ debg [logstash_functional] "logstash-2015.09.22" settings {"index":{"analysis":{"analyzer":{"url":{"max_token_length":"1000","tokenizer":"uax_url_email","type":"standard"}}},"number_of_replicas":"0","number_of_shards":"1"}}
[00:00:12]             β”‚ info [o.e.c.m.MetaDataCreateIndexService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [logstash-2015.09.20] creating index, cause [api], templates [], shards [1]/[0], mappings [_doc]
[00:00:12]             β”‚ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[logstash-2015.09.20][0]]]).
[00:00:12]             β”‚ info [logstash_functional] Created index "logstash-2015.09.20"
[00:00:12]             β”‚ debg [logstash_functional] "logstash-2015.09.20" settings {"index":{"analysis":{"analyzer":{"url":{"max_token_length":"1000","tokenizer":"uax_url_email","type":"standard"}}},"number_of_replicas":"0","number_of_shards":"1"}}
[00:00:12]             β”‚ info [o.e.c.m.MetaDataCreateIndexService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [logstash-2015.09.21] creating index, cause [api], templates [], shards [1]/[0], mappings [_doc]
[00:00:12]             β”‚ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[logstash-2015.09.21][0]]]).
[00:00:12]             β”‚ info [logstash_functional] Created index "logstash-2015.09.21"
[00:00:12]             β”‚ debg [logstash_functional] "logstash-2015.09.21" settings {"index":{"analysis":{"analyzer":{"url":{"max_token_length":"1000","tokenizer":"uax_url_email","type":"standard"}}},"number_of_replicas":"0","number_of_shards":"1"}}
[00:00:22]             β”‚ info progress: 11943
[00:00:23]             β”‚ info [logstash_functional] Indexed 4633 docs into "logstash-2015.09.22"
[00:00:23]             β”‚ info [logstash_functional] Indexed 4757 docs into "logstash-2015.09.20"
[00:00:23]             β”‚ info [logstash_functional] Indexed 4614 docs into "logstash-2015.09.21"
[00:00:24]             β”‚ info [visualize] Loading "mappings.json"
[00:00:24]             β”‚ info [visualize] Loading "data.json"
[00:00:24]             β”‚ info [o.e.c.m.MetaDataDeleteIndexService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [.kibana_1/8W3FUQwuTKGfjScijlgpzA] deleting index
[00:00:24]             β”‚ info [visualize] Deleted existing index [".kibana_1"]
[00:00:24]             β”‚ info [o.e.c.m.MetaDataCreateIndexService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [.kibana] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:00:24]             β”‚ info [visualize] Created index ".kibana"
[00:00:24]             β”‚ debg [visualize] ".kibana" settings {"index":{"number_of_replicas":"1","number_of_shards":"1"}}
[00:00:24]             β”‚ info [o.e.c.m.MetaDataMappingService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [.kibana/ji6MtdHIR-2lN828npeWXg] update_mapping [_doc]
[00:00:24]             β”‚ info [visualize] Indexed 7 docs into ".kibana"
[00:00:24]             β”‚ info [o.e.c.m.MetaDataMappingService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [.kibana/ji6MtdHIR-2lN828npeWXg] update_mapping [_doc]
[00:00:24]             β”‚ debg Migrating saved objects
[00:00:24]             β”‚ proc [kibana]   log   [18:33:15.725] [info][savedobjects-service] Creating index .kibana_2.
[00:00:24]             β”‚ info [o.e.c.m.MetaDataCreateIndexService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [.kibana_2] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:00:24]             β”‚ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] updating number_of_replicas to [0] for indices [.kibana_2]
[00:00:24]             β”‚ proc [kibana]   log   [18:33:15.800] [info][savedobjects-service] Reindexing .kibana to .kibana_1
[00:00:24]             β”‚ info [o.e.c.m.MetaDataCreateIndexService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [.kibana_1] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:00:24]             β”‚ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] updating number_of_replicas to [0] for indices [.kibana_1]
[00:00:24]             β”‚ info [o.e.c.m.MetaDataCreateIndexService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [.tasks] creating index, cause [auto(task api)], templates [], shards [1]/[1], mappings [_doc]
[00:00:24]             β”‚ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] updating number_of_replicas to [0] for indices [.tasks]
[00:00:25]             β”‚ info [o.e.t.LoggingTaskListener] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] 867 finished with response BulkByScrollResponse[took=86.8ms,timed_out=false,sliceId=null,updated=0,created=7,deleted=0,batches=1,versionConflicts=0,noops=0,retries=0,throttledUntil=0s,bulk_failures=[],search_failures=[]]
[00:00:25]             β”‚ info [o.e.c.m.MetaDataDeleteIndexService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [.kibana/ji6MtdHIR-2lN828npeWXg] deleting index
[00:00:25]             β”‚ proc [kibana]   log   [18:33:16.198] [info][savedobjects-service] Migrating .kibana_1 saved objects to .kibana_2
[00:00:25]             β”‚ info [o.e.c.m.MetaDataMappingService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [.kibana_2/rN0l1YX4TASKlHCoGIJgew] update_mapping [_doc]
[00:00:25]             β”‚ info [o.e.c.m.MetaDataMappingService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [.kibana_2/rN0l1YX4TASKlHCoGIJgew] update_mapping [_doc]
[00:00:25]             β”‚ proc [kibana]   log   [18:33:16.318] [info][savedobjects-service] Pointing alias .kibana to .kibana_2.
[00:00:25]             β”‚ proc [kibana]   log   [18:33:16.361] [info][savedobjects-service] Finished in 639ms.
[00:00:25]             β”‚ debg applying update to kibana config: {"accessibility:disableAnimations":true,"dateFormat:tz":"UTC"}
[00:00:25]             β”‚ info [o.e.c.m.MetaDataMappingService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [.kibana_2/rN0l1YX4TASKlHCoGIJgew] update_mapping [_doc]
[00:00:26]             β”‚ debg replacing kibana config doc: {"defaultIndex":"logstash-*"}
[00:00:26]             β”‚ info [o.e.c.m.MetaDataMappingService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [.kibana_2/rN0l1YX4TASKlHCoGIJgew] update_mapping [_doc]
[00:00:27]             β”‚ debg navigating to discover url: http://localhost:6111/app/kibana#/discover
[00:00:27]             β”‚ debg Navigate to: http://localhost:6111/app/kibana#/discover
[00:00:27]             β”‚ debg ... sleep(700) start
[00:00:27]             β”‚ debg browser[INFO] http://localhost:6111/app/kibana?_t=1582914798833#/discover 350 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:00:27]             β”‚
[00:00:27]             β”‚ debg browser[INFO] http://localhost:6111/bundles/app/kibana/bootstrap.js 9:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:00:28]             β”‚ debg ... sleep(700) end
[00:00:28]             β”‚ debg returned from get, calling refresh
[00:00:28]             β”‚ debg browser[INFO] http://localhost:6111/app/kibana?_t=1582914798833#/discover 350 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:00:28]             β”‚
[00:00:28]             β”‚ debg browser[INFO] http://localhost:6111/bundles/app/kibana/bootstrap.js 9:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:00:29]             β”‚ debg currentUrl = http://localhost:6111/app/kibana#/discover
[00:00:29]             β”‚          appUrl = http://localhost:6111/app/kibana#/discover
[00:00:29]             β”‚ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:00:31]             β”‚ debg TestSubjects.find(kibanaChrome)
[00:00:31]             β”‚ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=10000
[00:00:31]             β”‚ debg browser[INFO] http://localhost:6111/bundles/plugin/data/data.plugin.js 62:139970 "INFO: 2020-02-28T18:33:21Z
[00:00:31]             β”‚        Adding connection to http://localhost:6111/elasticsearch
[00:00:31]             β”‚
[00:00:31]             β”‚      "
[00:00:31]             β”‚ debg ... sleep(501) start
[00:00:32]             β”‚ debg ... sleep(501) end
[00:00:32]             β”‚ debg in navigateTo url = http://localhost:6111/app/kibana#/discover?_g=()
[00:00:32]             β”‚ debg TestSubjects.exists(statusPageContainer)
[00:00:32]             β”‚ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:00:34]             β”‚ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:03:13]           β””-: context view for date_nanos
[00:03:13]             β””-> "before all" hook
[00:03:13]             β””-> "before all" hook
[00:03:13]               β”‚ info [date_nanos] Loading "mappings.json"
[00:03:13]               β”‚ info [date_nanos] Loading "data.json"
[00:03:13]               β”‚ info [o.e.c.m.MetaDataCreateIndexService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [date-nanos] creating index, cause [api], templates [], shards [1]/[0], mappings [_doc]
[00:03:13]               β”‚ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[date-nanos][0]]]).
[00:03:13]               β”‚ info [date_nanos] Created index "date-nanos"
[00:03:13]               β”‚ debg [date_nanos] "date-nanos" settings {"index":{"number_of_replicas":"0","number_of_shards":"1"}}
[00:03:13]               β”‚ info [o.e.c.m.MetaDataMappingService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [date-nanos/nZ_gkbNWQuScFYq-3SIGSg] update_mapping [_doc]
[00:03:13]               β”‚ info [date_nanos] Indexed 9 docs into "date-nanos"
[00:03:13]               β”‚ info [date_nanos] Indexed 2 docs into ".kibana"
[00:03:13]               β”‚ info [o.e.c.m.MetaDataMappingService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [.kibana_2/rN0l1YX4TASKlHCoGIJgew] update_mapping [_doc]
[00:03:13]               β”‚ debg Migrating saved objects
[00:03:14]               β”‚ proc [kibana]   log   [18:36:05.074] [info][savedobjects-service] Creating index .kibana_3.
[00:03:14]               β”‚ info [o.e.c.m.MetaDataCreateIndexService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [.kibana_3] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:03:14]               β”‚ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] updating number_of_replicas to [0] for indices [.kibana_3]
[00:03:14]               β”‚ debg TestSubjects.exists(filter filter-disabled filter-key-geo.src filter-value-IN)
[00:03:14]               β”‚ debg Find.existsByCssSelector('[data-test-subj="filter filter-disabled filter-key-geo.src filter-value-IN"]') with timeout=2500
[00:03:14]               β”‚ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[.kibana_3][0]]]).
[00:03:14]               β”‚ proc [kibana]   log   [18:36:05.158] [info][savedobjects-service] Migrating .kibana_2 saved objects to .kibana_3
[00:03:14]               β”‚ info [o.e.c.m.MetaDataMappingService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [.kibana_3/o5AmvnQKTjqG4plxW_O3Hw] update_mapping [_doc]
[00:03:14]               β”‚ info [o.e.c.m.MetaDataMappingService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [.kibana_3/o5AmvnQKTjqG4plxW_O3Hw] update_mapping [_doc]
[00:03:14]               β”‚ info [o.e.c.m.MetaDataMappingService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [.kibana_3/o5AmvnQKTjqG4plxW_O3Hw] update_mapping [_doc]
[00:03:14]               β”‚ info [o.e.c.m.MetaDataMappingService] [kibana-ci-immutable-oraclelinux-tests-xl-1582913742279877952] [.kibana_3/o5AmvnQKTjqG4plxW_O3Hw] update_mapping [_doc]
[00:03:14]               β”‚ proc [kibana]   log   [18:36:05.336] [info][savedobjects-service] Pointing alias .kibana to .kibana_3.
[00:03:14]               β”‚ proc [kibana]   log   [18:36:05.413] [info][savedobjects-service] Finished in 342ms.
[00:03:14]               β”‚ debg replacing kibana config doc: {"defaultIndex":"date-nanos"}
[00:03:15]               β”‚ debg applying update to kibana config: {"context:defaultSize":"1","context:step":"3"}
[00:03:16]             β””-> displays predessors - anchor - successors in right order 
[00:03:16]               β””-> "before each" hook: global before each
[00:03:16]               β”‚ debg browser.get(http://localhost:6111/app/kibana#/context/date-nanos/AU_x3-TaGFA8no6Qj999Z?_a=(columns:!('@message')))
[00:03:16]               β”‚ debg --- retry.try failed again with the same message...
[00:03:16]               β”‚ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:03:16]               β”‚ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:03:16]               β”‚ debg browser[INFO] http://localhost:6111/app/kibana?_t=1582914967679#/context/date-nanos/AU_x3-TaGFA8no6Qj999Z?_a=(columns:!(%27@message%27)) 350 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:03:16]               β”‚
[00:03:16]               β”‚ debg browser[INFO] http://localhost:6111/bundles/app/kibana/bootstrap.js 9:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:03:17]               β”‚ debg TestSubjects.exists(filter filter-disabled filter-key-geo.src filter-value-IN)
[00:03:17]               β”‚ debg Find.existsByCssSelector('[data-test-subj="filter filter-disabled filter-key-geo.src filter-value-IN"]') with timeout=2500
[00:03:20]               β”‚ debg browser[INFO] http://localhost:6111/bundles/plugin/data/data.plugin.js 62:139970 "INFO: 2020-02-28T18:36:10Z
[00:03:20]               β”‚        Adding connection to http://localhost:6111/elasticsearch
[00:03:20]               β”‚
[00:03:20]               β”‚      "
[00:03:20]               β”‚ debg TestSubjects.find(successorsLoadMoreButton)
[00:03:20]               β”‚ debg Find.findByCssSelector('[data-test-subj="successorsLoadMoreButton"]') with timeout=10000
[00:03:30]               β”‚ debg --- retry.try failed again with the same message...
[00:03:30]               β”‚ debg TestSubjects.find(predecessorsLoadMoreButton)
[00:03:30]               β”‚ debg Find.findByCssSelector('[data-test-subj="predecessorsLoadMoreButton"]') with timeout=10000
[00:03:31]               β”‚ debg ... sleep(1000) start
[00:03:31]               β””- βœ– fail: "context app context view for date_nanos displays predessors - anchor - successors in right order "
[00:03:31]               β”‚

Stack Trace

{ DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    at emitDeprecationWarning (internal/process/promises.js:111:13)
    at emitWarning (internal/process/promises.js:104:3)
    at emitPromiseRejectionWarnings (internal/process/promises.js:143:7)
    at process._tickCallback (internal/process/next_tick.js:69:34) name: 'DeprecationWarning', code: 'DEP0018', uncaught: true }

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

enabled?: boolean;
dataset?: string;
metricset?: string;
paths?: string[];
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: don't we need something like config (from prior version) that accepts free-typed JSON?

I'm thinking of the use case for Endpoint where we will need to add our policy configuration data.
The example in the beats repo has two suggestions for this use case (line 472 and 578 - I thought that from one of the review meetings, the Endpoint team (@ferullo ) indicated suggestion 2 was best but @ph can confirm.

Copy link

@michalpristas michalpristas left a comment

Choose a reason for hiding this comment

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

I think it seems ok, we will need to update output schema definition as we have changed/added fields there as well. but this should work for datasource

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.

I do not think this PR is needed. Our saved object schema does not, and should not, match the agent config spec exactly. The saved object schema needs to 1) provide enough information for UI usage and 2) contain enough fields to translate to agent config. There will be a business layer that translates the saved object to agent config. My work in #58670 referenced the agent config spec, and contains changes to datasources and output types.

I left some comments for explanation. Please let me know if you disagree or see anything that we do need to change that isn't covered by the previous work.

Comment on lines +23 to +24
metricset?: string;
paths?: string[];
Copy link
Contributor

Choose a reason for hiding this comment

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

There are examples of fields that don't need to exist in the saved object schema. metricset and paths are not applicable to all streams, that's why we have a config property for arbitrary stream config fields that will then be flattened into the top-level streams object at the business logic layer of converting SO -> agent config.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I was wondering if this wasn't perhaps an A | B | C type and if we needed to be that involved in the Agent configs

version: string;
};
output_id: string;
namespace?: string;
use_output: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is an example where it's ok that the field name differs in SO than agent schema. The field names will be remapped, but the SO name is more friendly to work with in UI.

@jfsiii
Copy link
Contributor Author

jfsiii commented Mar 2, 2020

@jen-huang πŸ€·β€β™€ I hear what you're saying. As I said, I'm not completely clear here. In the Thursday meeting, @ph mentioned some Fleet changes related to the new Agent config. I offered to help and to sync up with @nchaulet. We met and this is what I understood the changes to be.

I don't know if that work is still needed elsewhere or if the changes you mentioned make it unnecessary. Just let me know how I can help.

@ruflin ruflin added Feature:EPM Fleet team's Elastic Package Manager (aka Integrations) project Feature:Fleet Fleet team's agent central management project labels Mar 3, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest (Feature:EPM)

@jfsiii jfsiii closed this Mar 5, 2020
@jen-huang jen-huang added the Team:Fleet Team label for Observability Data Collection Fleet team label Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:EPM Fleet team's Elastic Package Manager (aka Integrations) project Feature:Fleet Fleet team's agent central management project Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants