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

[Usage collection] Expose the new es client and SO client #79044

Closed

Conversation

TinaHeiligers
Copy link
Contributor

@TinaHeiligers TinaHeiligers commented Sep 30, 2020

Summary
Handles step 3 in #74840 (comment).

As part of migrating over to the new Elasticsearch client, we provided the new client as an additional parameter to the fetch method in collectors and pass the client down as an additional collection config parameter.

To use the new client forces plugin owners to provide the old client as well, which is not ideal.

This work refactors the way in which we provide the clients from individual arguments to an object, allowing plugins to select the client they wish to use.

This is a breaking change for Kibana developers and requires refactoring collectors in all the plugins that currently use callCluster.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@TinaHeiligers TinaHeiligers changed the title Usage collection es clients [Usage collection] Provide both es clients Sep 30, 2020
@TinaHeiligers TinaHeiligers changed the title [Usage collection] Provide both es clients [Usage collection] Expose the new es client and SO client Sep 30, 2020
@kibanamachine
Copy link
Contributor

kibanamachine commented Sep 30, 2020

💔 Build Failed

Failed CI Steps


Test Failures

Jest Tests.src/plugins/usage_collection/server/collector.CollectorSet registers a collector set and runs lifecycle events should log debug status of fetching from the collector

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

TypeError: collectors.values(...) is not a function or its return value is not iterable
    at CollectorSet.bulkFetch (/dev/shm/workspace/parallel/5/kibana/src/plugins/usage_collection/server/collector/collector_set.ts:130:22)
    at Object.it (/dev/shm/workspace/parallel/5/kibana/src/plugins/usage_collection/server/collector/collector_set.test.ts:89:39)
    at Object.asyncJestTest (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:100:37)
    at resolve (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/queueRunner.js:45:12)
    at new Promise (<anonymous>)
    at mapper (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/queueRunner.js:28:19)
    at promise.then (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/queueRunner.js:75:41)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Jest Tests.src/plugins/usage_collection/server/collector.CollectorSet registers a collector set and runs lifecycle events should gracefully handle a collector fetch method throwing an error

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

Error: expect(received).toStrictEqual(expected) // deep equality

Expected: []
Received: undefined
    at Object.it (/dev/shm/workspace/parallel/5/kibana/src/plugins/usage_collection/server/collector/collector_set.test.ts:119:22)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Jest Tests.src/plugins/usage_collection/server/collector.CollectorSet registers a collector set and runs lifecycle events should not break if isReady is not a function

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

TypeError: collectors.values(...) is not a function or its return value is not iterable
    at CollectorSet.bulkFetch (/dev/shm/workspace/parallel/5/kibana/src/plugins/usage_collection/server/collector/collector_set.ts:130:22)
    at Object.it (/dev/shm/workspace/parallel/5/kibana/src/plugins/usage_collection/server/collector/collector_set.test.ts:132:39)
    at Object.asyncJestTest (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:100:37)
    at resolve (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/queueRunner.js:45:12)
    at new Promise (<anonymous>)
    at mapper (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/queueRunner.js:28:19)
    at promise.then (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/queueRunner.js:75:41)
    at process._tickCallback (internal/process/next_tick.js:68:7)

and 6 more failures, only showing the first 3.

Metrics [docs]

✅ unchanged

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

@TinaHeiligers
Copy link
Contributor Author

Closing to revisit using a different strategy.

@TinaHeiligers TinaHeiligers deleted the usage-collection-esClients branch October 14, 2020 15:35
@lukeelmers lukeelmers added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc and removed Team:KibanaTelemetry labels Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Telemetry release_note:breaking release_note:enhancement Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants