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

[ES] Upgrade client to v8.0 #113950

Merged
merged 210 commits into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from 176 commits
Commits
Show all changes
210 commits
Select commit Hold shift + click to select a range
03079d4
bump to a pre-8.0 version
mshustov Oct 5, 2021
453157a
export KibanaClient from /lib sub-folder
mshustov Oct 5, 2021
adf623c
workaround the problem of the absence of estypes
mshustov Oct 5, 2021
ff63c52
update es client usage in pacakges
mshustov Oct 5, 2021
b085089
export estypes from another path
mshustov Oct 5, 2021
1faf379
import errors from root
mshustov Oct 5, 2021
ceb4886
import errors from root 2
mshustov Oct 5, 2021
f93b8dc
update transport import
mshustov Oct 6, 2021
279533d
update import path for /api/types
mshustov Oct 6, 2021
13b152f
update import path for /api/types
mshustov Oct 6, 2021
baa07a5
import errors from top export
mshustov Oct 6, 2021
14d6fb5
use TransportResult instead if ApiResponse
mshustov Oct 6, 2021
cf0bdf6
fix errors in client_config
mshustov Oct 6, 2021
ede95bb
fix src/core/server/saved_objects/migrationsv2/actions/integration_te…
mshustov Oct 6, 2021
525bdbd
use KibanaClient in mock. we dont export the original Client
mshustov Oct 6, 2021
d3607c5
fix client mocks
mshustov Oct 6, 2021
9f5446c
fix errors on SO
mshustov Oct 6, 2021
2f67f71
fix remaining core errors
mshustov Oct 6, 2021
6ee98bd
update estype import path
mshustov Oct 6, 2021
1e7846d
fix errors in data plugin
mshustov Oct 6, 2021
4d76b09
fix data_views
mshustov Oct 6, 2021
23d56e5
fix es_ui_shared
mshustov Oct 6, 2021
54b34fa
fix errors in interactive_setup
mshustov Oct 6, 2021
57e797e
fix errors in ./test folder
mshustov Oct 6, 2021
47afcf8
add @elastic/transport to the runtime deps
mshustov Oct 7, 2021
c8a71b0
fix errors in packages
mshustov Oct 7, 2021
6e0a34f
fix erros in src/core
mshustov Oct 7, 2021
1647724
fix errors in test/
mshustov Oct 7, 2021
4ed2d11
fix an error in actions plugin
mshustov Oct 7, 2021
abe4e73
woraround and fix errors in APM plugin
mshustov Oct 7, 2021
79348ad
fix errors in canvas
mshustov Oct 7, 2021
f4a7dfd
fix errors in event_log
mshustov Oct 7, 2021
6c105fc
fix errors in fleet
mshustov Oct 7, 2021
53e1105
fix errors in ILM
mshustov Oct 7, 2021
3beef6a
fix errors in infra
mshustov Oct 7, 2021
e41e566
fix errors in ingest_pipeline
mshustov Oct 7, 2021
e686e86
fix errors in lens
mshustov Oct 7, 2021
3b82324
fix errors in license_management
mshustov Oct 7, 2021
a2d00ea
fix errors in licensing
mshustov Oct 7, 2021
b9e09d6
fix errors in logstash
mshustov Oct 7, 2021
cf0ee25
fix errors in ml
mshustov Oct 7, 2021
1575bcb
fix errors in monitoring
mshustov Oct 7, 2021
cbf44d4
fix errors in observability
mshustov Oct 7, 2021
1786edc
fix errors in rule_registry
mshustov Oct 7, 2021
b30724d
fix errors in reporting
mshustov Oct 7, 2021
053e4b8
fix errors in rule_registry
mshustov Oct 7, 2021
c5150db
fix errors in security
mshustov Oct 7, 2021
51ca4d4
fix errors in security_solution
mshustov Oct 7, 2021
d3552e1
fix errors in snapshot_restore
mshustov Oct 7, 2021
dfe35f4
fix errors in transform
mshustov Oct 7, 2021
724ec0b
fix errors in UA
mshustov Oct 7, 2021
fc9c4a4
fix errors in uptime
mshustov Oct 7, 2021
c1958a6
fix errors in x-pack/test
mshustov Oct 7, 2021
a7f0bf8
fix eslint errors
mshustov Oct 7, 2021
0c6dc30
Merge branch 'master' into issue-108387-es-client-80
mshustov Oct 13, 2021
e37fff4
fix new errors
mshustov Oct 13, 2021
12bb7a7
use default HTTP Connection. Undici does not support agent config opt…
mshustov Oct 13, 2021
ff79963
create does not accept require_alias option
mshustov Oct 13, 2021
67785b1
update deps
mshustov Oct 14, 2021
5ebf8e6
use transport types exported from ES client package
mshustov Oct 14, 2021
211ff87
fix ErrorCause | string errors
mshustov Oct 14, 2021
5871840
do not use enum
mshustov Oct 14, 2021
dc81ea8
fix errors in data plugin
mshustov Oct 14, 2021
2c485c1
update x-pack code
mshustov Oct 14, 2021
0a35a42
fix transport
mshustov Oct 14, 2021
3c13ec5
fix apm search request
mshustov Oct 14, 2021
497ea54
do not crash on reporting
mshustov Oct 14, 2021
e467a5e
fix kbn-test build
mshustov Oct 14, 2021
407dd5d
mute reporting error to start
mshustov Oct 14, 2021
d04b2f5
fix ftr build
mshustov Oct 14, 2021
a042128
another attempt
mshustov Oct 14, 2021
4ade5c8
Merge branch 'master' into issue-108387-es-client-80
mshustov Oct 17, 2021
657e5bd
Merge remote-tracking branch 'restrry/issue-108387-es-client-80' into…
mshustov Oct 17, 2021
07b0bc2
update import path
mshustov Oct 17, 2021
4ce204e
address or mute new errors
mshustov Oct 18, 2021
dcb0acc
REMOVE me. pin transport version temporarily.
mshustov Oct 18, 2021
5226feb
remove deep imports from transport package
mshustov Oct 18, 2021
a4edd38
fix jest crash
mshustov Oct 18, 2021
957a56b
fix product check tests
mshustov Oct 18, 2021
189af1a
remove unnecessary ts-expect-error
mshustov Oct 18, 2021
7c4a313
fix a few failed unit tests
mshustov Oct 18, 2021
b356775
bump to canary 24
mshustov Oct 18, 2021
7571003
remove unnecessary ts-expect-error
mshustov Oct 18, 2021
f46d758
remove dependency on transport
mshustov Oct 18, 2021
0ee13e0
Merge remote-tracking branch 'upstream/issue-108387-es-client-80' int…
mshustov Oct 18, 2021
692f8d4
fix types in tests
mshustov Oct 18, 2021
686fde8
Merge remote-tracking branch 'origin/issue-108387-es-client-80' into …
mshustov Oct 18, 2021
5547746
mute errors in xpack tests
mshustov Oct 19, 2021
5cd6b01
product check doesn;t spam in logs anymore
mshustov Oct 19, 2021
c14dc37
filterPath --> filter_path
mshustov Oct 19, 2021
5f22e83
ignoreUnavailable --> ignore_unavailable
mshustov Oct 19, 2021
77b7d20
ignoreUnavailable --> ignore_unavailable
mshustov Oct 19, 2021
eb1d72c
trackScores --> track_scores
mshustov Oct 19, 2021
e0582a6
trackTotalHits --> track_total_hits
mshustov Oct 19, 2021
15d913f
fix es-arcives
mshustov Oct 19, 2021
f4cf334
fix data plugin crashes
mshustov Oct 19, 2021
68d6ea3
fix watcher test utils
mshustov Oct 19, 2021
3fbdad6
rollback unnecessary changes
mshustov Oct 19, 2021
e466e2f
fix another problem in es-archiver
mshustov Oct 19, 2021
2cf1577
fix scroll. for whatever reason scroll fails when request scroll_id i…
mshustov Oct 19, 2021
4ba25f3
add meta: true in kbn-securitysolution-es-utils
mshustov Oct 19, 2021
fb3a12d
bump client to canary 25
mshustov Oct 20, 2021
a7a03f6
fix errors in accordance with the es client spec
mshustov Oct 20, 2021
cc66f07
update securityscolution-es-utils
mshustov Oct 20, 2021
b2bebab
unify scroll api in reporting and fix tests
mshustov Oct 20, 2021
6d0e46e
fix unit tests in watcher
mshustov Oct 20, 2021
b127d46
refactor APM to abort request with AbortController API
mshustov Oct 20, 2021
ddc5f80
fix missing es client calls in tests
mshustov Oct 20, 2021
0d0765c
fix missing meta in detection engine FTR tests
pgayvallet Oct 20, 2021
0d9cf97
fix another bunch of errors in js tests
mshustov Oct 20, 2021
4b3797a
Merge remote-tracking branch 'origin/issue-108387-es-client-80' into …
mshustov Oct 20, 2021
7749d90
fix wrong coercion
mshustov Oct 20, 2021
25a3506
remove test-grep pattern
pgayvallet Oct 20, 2021
cf8fa3d
fix apm unit test
mshustov Oct 20, 2021
99009a7
rename terminateAfter to terminate_after in infra plugin
pgayvallet Oct 20, 2021
16bb7c5
rename terminateAfter to terminate_after in uptime plugin
pgayvallet Oct 20, 2021
55ad139
rename terminateAfter to terminate_after in apm plugin
pgayvallet Oct 20, 2021
527d296
fix security roles FTR tests
pgayvallet Oct 20, 2021
7c52a8e
fix reference
pgayvallet Oct 20, 2021
0c8438d
fix post_privilidges test
mshustov Oct 20, 2021
f29aa5b
Merge remote-tracking branch 'origin/issue-108387-es-client-80' into …
mshustov Oct 20, 2021
747788f
fix post_privilidges
mshustov Oct 20, 2021
a19ff0a
bump client to 26
mshustov Oct 20, 2021
caa8be5
add meta for index_management test helpers
mshustov Oct 20, 2021
caa789f
remove ts-expect-error caused by bad type in reason
mshustov Oct 20, 2021
a33d8fc
bump client to 27
mshustov Oct 20, 2021
c038850
REMOVE me. workaround until fixed in the es client
mshustov Oct 21, 2021
42c3493
fix incorrect type casting
mshustov Oct 21, 2021
b2a2861
swtich from camelCase params
mshustov Oct 21, 2021
761875b
use `HttpConnection` for FTR-related clients
pgayvallet Oct 21, 2021
696f452
Merge remote-tracking branch 'origin/issue-108387-es-client-80' into …
mshustov Oct 21, 2021
4a3f621
bump client to 29
mshustov Oct 21, 2021
7e0159d
Revert "REMOVE me. workaround until fixed in the es client"
mshustov Oct 21, 2021
645c5d8
Merge remote-tracking branch 'upstream/master' into issue-108387-es-c…
pgayvallet Oct 21, 2021
64997e8
fix new util
pgayvallet Oct 21, 2021
14737ef
revert repository changes
mshustov Oct 21, 2021
6a9dc91
do not crash if cannot store event_loop data
mshustov Oct 21, 2021
5436112
fix new estypes imports
pgayvallet Oct 21, 2021
f81f693
Merge remote-tracking branch 'upstream/issue-108387-es-client-80' int…
pgayvallet Oct 21, 2021
6324647
fix more types
pgayvallet Oct 21, 2021
e089067
fix security test types and add ts-ignore for custom ES client
pgayvallet Oct 21, 2021
a156a6b
fix more estypes imports
pgayvallet Oct 21, 2021
144e7b1
yet more ts violations
pgayvallet Oct 21, 2021
1bb50f9
line by line fixing is hard
pgayvallet Oct 21, 2021
63cc7ba
adapt `evaluateAlert` from infra as it's also used from FTR tests
pgayvallet Oct 21, 2021
5e2a6f5
use convertToKibanaClient in FTR test instead of meta:true in plugin …
pgayvallet Oct 21, 2021
2cd5bf7
Merge remote-tracking branch 'origin/issue-108387-es-client-80' into …
mshustov Oct 21, 2021
ab1e13f
migrate from deprecated API in fleet
mshustov Oct 21, 2021
6756931
fix intergration tests
mshustov Oct 21, 2021
8240a84
fix fleet tests
mshustov Oct 21, 2021
d057875
Merge branch 'master' into issue-108387-es-client-80
mshustov Oct 21, 2021
31aa7ad
fix another fleet test
mshustov Oct 21, 2021
f08a6e6
fix more tests
pgayvallet Oct 21, 2021
31cea5f
Merge remote-tracking branch 'origin/issue-108387-es-client-80' into …
mshustov Oct 21, 2021
f5b9335
let's call it a day
pgayvallet Oct 21, 2021
8e3ec3e
Merge remote-tracking branch 'origin/issue-108387-es-client-80' into …
mshustov Oct 22, 2021
ed2d516
Removes custom header check on 404 responses, includes es client Prod…
TinaHeiligers Oct 22, 2021
aa38eb4
Merge remote-tracking branch 'origin/issue-108387-es-client-80' into …
mshustov Oct 22, 2021
93f2f7c
disable APM until compatible with client v8
pgayvallet Oct 22, 2021
0a615cb
skip async_search FTR test
pgayvallet Oct 22, 2021
b8caf61
use kbnClient in integration tests
mshustov Oct 22, 2021
b0e635b
bump version to 29
mshustov Oct 22, 2021
587d1fd
Merge remote-tracking branch 'origin/issue-108387-es-client-80' into …
mshustov Oct 22, 2021
8baed5d
bump to 30
mshustov Oct 22, 2021
e5c70da
have configureClient return a KibanaClient instead of Client, remove …
pgayvallet Oct 22, 2021
9c7b2af
bump to 31
pgayvallet Oct 22, 2021
5ac713e
bump to 31
mshustov Oct 22, 2021
ef8345d
Revert "bump to 31"
mshustov Oct 22, 2021
d34c1ba
trigger stop to unusubscribe
mshustov Oct 22, 2021
319cf99
Merge remote-tracking branch 'origin/issue-108387-es-client-80' into …
mshustov Oct 22, 2021
e2bec10
update generated docs
pgayvallet Oct 22, 2021
66fb5b9
remove obsolete test
pgayvallet Oct 22, 2021
34310c4
Merge remote-tracking branch 'upstream/master' into issue-108387-es-c…
pgayvallet Oct 22, 2021
8159269
put "as" back
mshustov Oct 22, 2021
7dffa45
cleanup
mshustov Oct 22, 2021
b8a534c
Merge remote-tracking branch 'origin/issue-108387-es-client-80' into …
mshustov Oct 22, 2021
b88c94c
skip test
mshustov Oct 23, 2021
2133dc2
Merge branch 'master' into issue-108387-es-client-80
mshustov Oct 23, 2021
617aaed
Merge remote-tracking branch 'origin/master' into issue-108387-es-cli…
mshustov Oct 24, 2021
c175bee
remove new type errors in apm package
mshustov Oct 24, 2021
168d660
remove ErrorCause casting
mshustov Oct 24, 2021
bccf202
update a comment
mshustov Oct 24, 2021
887bade
bump version to 32
mshustov Oct 25, 2021
8d6f5a0
Merge remote-tracking branch 'origin/master' into issue-108387-es-cli…
mshustov Oct 25, 2021
b3281ba
remove unnecessary ts-expect-error in apm code
mshustov Oct 25, 2021
96da44b
update comments
mshustov Oct 25, 2021
f02c82e
Merge remote-tracking branch 'origin/master' into issue-108387-es-cli…
mshustov Oct 25, 2021
35e16fa
update to client v33
mshustov Oct 25, 2021
89c284f
remove outdated type definition
mshustov Oct 25, 2021
97d5657
bump to 34 without params mutation
mshustov Oct 25, 2021
f7aa7ce
unskip the test that should not fail anymore
mshustov Oct 25, 2021
22c8789
Merge remote-tracking branch 'origin/master' into issue-108387-es-cli…
mshustov Oct 25, 2021
5ad28bd
remove unnecessary ts-expect-error comments
mshustov Oct 25, 2021
67a3570
Merge remote-tracking branch 'origin/master' into issue-108387-es-cli…
mshustov Oct 25, 2021
e40e3e1
Merge remote-tracking branch 'origin/master' into issue-108387-es-cli…
mshustov Oct 25, 2021
18b23eb
Merge remote-tracking branch 'origin/master' into issue-108387-es-cli…
mshustov Oct 25, 2021
9ef6e22
update to v35. body can be string
mshustov Oct 25, 2021
76c35a8
Merge remote-tracking branch 'origin/master' into issue-108387-es-cli…
mshustov Oct 25, 2021
b1ad337
Merge remote-tracking branch 'origin/master' into issue-108387-es-cli…
mshustov Oct 25, 2021
476b331
Merge remote-tracking branch 'origin/master' into issue-108387-es-cli…
mshustov Oct 25, 2021
356a89b
move `sort` to body and use body friendly syntax
pgayvallet Oct 25, 2021
3449629
Merge remote-tracking branch 'origin/master' into issue-108387-es-cli…
mshustov Oct 25, 2021
b49a79c
Merge remote-tracking branch 'origin/issue-108387-es-client-80' into …
mshustov Oct 25, 2021
3b0d634
Merge remote-tracking branch 'upstream/master' into issue-108387-es-c…
pgayvallet Oct 25, 2021
8e71e3d
Merge remote-tracking branch 'upstream/master' into issue-108387-es-c…
pgayvallet Oct 25, 2021
fb9896b
Merge remote-tracking branch 'origin/master' into issue-108387-es-cli…
mshustov Oct 26, 2021
40c4bc0
Merge remote-tracking branch 'origin/issue-108387-es-client-80' into …
mshustov Oct 26, 2021
ef609f5
Merge remote-tracking branch 'origin/master' into issue-108387-es-cli…
mshustov Oct 26, 2021
61b7f90
fix a failing test. maps register the same SO that has been already r…
mshustov Oct 26, 2021
16198d1
Merge remote-tracking branch 'origin/master' into issue-108387-es-cli…
mshustov Oct 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Client used to query the elasticsearch cluster.
<b>Signature:</b>

```typescript
export declare type ElasticsearchClient = Omit<KibanaClient, 'connectionPool' | 'transport' | 'serializer' | 'extend' | 'child' | 'close'> & {
export declare type ElasticsearchClient = Omit<KibanaClient, 'connectionPool' | 'transport' | 'serializer' | 'extend' | 'child' | 'close' | 'diagnostic'> & {
transport: {
request(params: TransportRequestParams, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse>;
request<TResponse = unknown>(params: TransportRequestParams, options?: TransportRequestOptions): Promise<TransportResult<TResponse>>;
};
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [ElasticsearchErrorDetails](./kibana-plugin-core-server.elasticsearcherrordetails.md) &gt; [error](./kibana-plugin-core-server.elasticsearcherrordetails.error.md)

## ElasticsearchErrorDetails.error property

<b>Signature:</b>

```typescript
error?: {
type: string;
reason?: string;
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [ElasticsearchErrorDetails](./kibana-plugin-core-server.elasticsearcherrordetails.md)

## ElasticsearchErrorDetails interface


<b>Signature:</b>

```typescript
export interface ElasticsearchErrorDetails
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [error](./kibana-plugin-core-server.elasticsearcherrordetails.error.md) | <code>{</code><br/><code> type: string;</code><br/><code> reason?: string;</code><br/><code> }</code> | |

1 change: 1 addition & 0 deletions docs/development/core/server/kibana-plugin-core-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [DeprecationsServiceSetup](./kibana-plugin-core-server.deprecationsservicesetup.md) | The deprecations service provides a way for the Kibana platform to communicate deprecated features and configs with its users. These deprecations are only communicated if the deployment is using these features. Allowing for a user tailored experience for upgrading the stack version.<!-- -->The Deprecation service is consumed by the upgrade assistant to assist with the upgrade experience.<!-- -->If a deprecated feature can be resolved without manual user intervention. Using correctiveActions.api allows the Upgrade Assistant to use this api to correct the deprecation upon a user trigger. |
| [DiscoveredPlugin](./kibana-plugin-core-server.discoveredplugin.md) | Small container object used to expose information about discovered plugins that may or may not have been started. |
| [ElasticsearchConfigPreboot](./kibana-plugin-core-server.elasticsearchconfigpreboot.md) | A limited set of Elasticsearch configuration entries exposed to the <code>preboot</code> plugins at <code>setup</code>. |
| [ElasticsearchErrorDetails](./kibana-plugin-core-server.elasticsearcherrordetails.md) | |
| [ElasticsearchServicePreboot](./kibana-plugin-core-server.elasticsearchservicepreboot.md) | |
| [ElasticsearchServiceSetup](./kibana-plugin-core-server.elasticsearchservicesetup.md) | |
| [ElasticsearchServiceStart](./kibana-plugin-core-server.elasticsearchservicestart.md) | |
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export declare class SavedObjectsErrorHelpers
| [createBadRequestError(reason)](./kibana-plugin-core-server.savedobjectserrorhelpers.createbadrequesterror.md) | <code>static</code> | |
| [createConflictError(type, id, reason)](./kibana-plugin-core-server.savedobjectserrorhelpers.createconflicterror.md) | <code>static</code> | |
| [createGenericNotFoundError(type, id)](./kibana-plugin-core-server.savedobjectserrorhelpers.creategenericnotfounderror.md) | <code>static</code> | |
| [createGenericNotFoundEsUnavailableError(type, id)](./kibana-plugin-core-server.savedobjectserrorhelpers.creategenericnotfoundesunavailableerror.md) | <code>static</code> | |
| [createIndexAliasNotFoundError(alias)](./kibana-plugin-core-server.savedobjectserrorhelpers.createindexaliasnotfounderror.md) | <code>static</code> | |
| [createInvalidVersionError(versionInput)](./kibana-plugin-core-server.savedobjectserrorhelpers.createinvalidversionerror.md) | <code>static</code> | |
| [createTooManyRequestsError(type, id)](./kibana-plugin-core-server.savedobjectserrorhelpers.createtoomanyrequestserror.md) | <code>static</code> | |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"@elastic/apm-rum-react": "^1.3.1",
"@elastic/charts": "38.0.1",
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.21",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.31",
"@elastic/ems-client": "7.16.0",
"@elastic/eui": "39.1.1",
"@elastic/filesaver": "1.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/elastic-apm-generator/src/scripts/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ yargs(process.argv.slice(2))
)
.then((results) => {
const errors = results
.flatMap((result) => result.body.items)
.flatMap((result) => result.items)
.filter((item) => !!item.index?.error)
.map((item) => item.index?.error);

Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-apm-config-loader/src/init_apm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import { mockLoadConfiguration } from './init_apm.test.mocks';
import { initApm } from './init_apm';
import apm from 'elastic-apm-node';

describe('initApm', () => {
// TODO: https://github.com/elastic/apm-agent-nodejs/issues/2355 is fixed
describe.skip('initApm', () => {
let apmAddFilterSpy: jest.SpyInstance;
let apmStartSpy: jest.SpyInstance;
let getConfig: jest.Mock;
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-apm-config-loader/src/init_apm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export const initApm = (
isDistributable: boolean,
serviceName: string
) => {
// TODO: re-enabled when https://github.com/elastic/apm-agent-nodejs/issues/2355 is fixed
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@elastic/kibana-operations we can merge it after FF

return;

const apmConfigLoader = loadConfiguration(argv, rootDir, isDistributable);
const apmConfig = apmConfigLoader.getConfig(serviceName);

Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-es-archiver/src/actions/empty_kibana_index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import type { KibanaClient } from '@elastic/elasticsearch/api/kibana';
import type { Client } from '@elastic/elasticsearch';
import { ToolingLog } from '@kbn/dev-utils';
import { KbnClient } from '@kbn/test';

Expand All @@ -17,7 +17,7 @@ export async function emptyKibanaIndexAction({
log,
kbnClient,
}: {
client: KibanaClient;
client: Client;
log: ToolingLog;
kbnClient: KbnClient;
}) {
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-es-archiver/src/actions/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { createReadStream } from 'fs';
import { Readable } from 'stream';
import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
import { KbnClient } from '@kbn/test';
import type { KibanaClient } from '@elastic/elasticsearch/api/kibana';
import type { Client } from '@elastic/elasticsearch';
import { createPromiseFromStreams, concatStreamProviders } from '@kbn/utils';
import { ES_CLIENT_HEADERS } from '../client_headers';

Expand Down Expand Up @@ -47,7 +47,7 @@ export async function loadAction({
inputDir: string;
skipExisting: boolean;
useCreate: boolean;
client: KibanaClient;
client: Client;
log: ToolingLog;
kbnClient: KbnClient;
}) {
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-es-archiver/src/actions/save.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { resolve, relative } from 'path';
import { createWriteStream, mkdirSync } from 'fs';
import { Readable, Writable } from 'stream';
import type { KibanaClient } from '@elastic/elasticsearch/api/kibana';
import type { Client } from '@elastic/elasticsearch';
import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
import { createListStream, createPromiseFromStreams } from '@kbn/utils';

Expand All @@ -31,7 +31,7 @@ export async function saveAction({
}: {
outputDir: string;
indices: string | string[];
client: KibanaClient;
client: Client;
log: ToolingLog;
raw: boolean;
query?: Record<string, any>;
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-es-archiver/src/actions/unload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { resolve, relative } from 'path';
import { createReadStream } from 'fs';
import { Readable, Writable } from 'stream';
import type { KibanaClient } from '@elastic/elasticsearch/api/kibana';
import type { Client } from '@elastic/elasticsearch';
import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
import { KbnClient } from '@kbn/test';
import { createPromiseFromStreams } from '@kbn/utils';
Expand All @@ -31,7 +31,7 @@ export async function unloadAction({
kbnClient,
}: {
inputDir: string;
client: KibanaClient;
client: Client;
log: ToolingLog;
kbnClient: KbnClient;
}) {
Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-es-archiver/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Fs from 'fs';

import { RunWithCommands, createFlagError, CA_CERT_PATH } from '@kbn/dev-utils';
import { readConfigFile, KbnClient } from '@kbn/test';
import { Client } from '@elastic/elasticsearch';
import { Client, HttpConnection } from '@elastic/elasticsearch';

import { EsArchiver } from './es_archiver';

Expand Down Expand Up @@ -106,7 +106,8 @@ export function runCli() {

const client = new Client({
node: esUrl,
ssl: esCa ? { ca: esCa } : undefined,
tls: esCa ? { ca: esCa } : undefined,
Connection: HttpConnection,
});
addCleanupTask(() => client.close());

Expand Down
6 changes: 3 additions & 3 deletions packages/kbn-es-archiver/src/es_archiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Fs from 'fs';
import Path from 'path';

import type { KibanaClient } from '@elastic/elasticsearch/api/kibana';
import type { Client } from '@elastic/elasticsearch';
import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
import { KbnClient } from '@kbn/test';

Expand All @@ -23,14 +23,14 @@ import {
} from './actions';

interface Options {
client: KibanaClient;
client: Client;
baseDir?: string;
log: ToolingLog;
kbnClient: KbnClient;
}

export class EsArchiver {
private readonly client: KibanaClient;
private readonly client: Client;
private readonly baseDir: string;
private readonly log: ToolingLog;
private readonly kbnClient: KbnClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,8 @@ it('transforms each input index to a stream of docs using scrollSearch helper',
Array [
Object {
"_source": "true",
"body": Object {
"query": undefined,
},
"index": "bar",
"query": undefined,
"rest_total_hits_as_int": true,
"scroll": "1m",
"size": 1000,
Expand All @@ -116,10 +114,8 @@ it('transforms each input index to a stream of docs using scrollSearch helper',
Array [
Object {
"_source": "true",
"body": Object {
"query": undefined,
},
"index": "foo",
"query": undefined,
"rest_total_hits_as_int": true,
"scroll": "1m",
"size": 1000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { Transform } from 'stream';
import type { KibanaClient } from '@elastic/elasticsearch/api/kibana';
import type { Client } from '@elastic/elasticsearch';
import { Stats } from '../stats';
import { Progress } from '../progress';
import { ES_CLIENT_HEADERS } from '../../client_headers';
Expand All @@ -21,7 +21,7 @@ export function createGenerateDocRecordsStream({
progress,
query,
}: {
client: KibanaClient;
client: Client;
stats: Stats;
progress: Progress;
query?: Record<string, any>;
Expand All @@ -37,9 +37,7 @@ export function createGenerateDocRecordsStream({
scroll: SCROLL_TIMEOUT,
size: SCROLL_SIZE,
_source: 'true',
body: {
query,
},
query,
rest_total_hits_as_int: true,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
* Side Public License, v 1.
*/

import type { KibanaClient } from '@elastic/elasticsearch/api/kibana';
import type { Client } from '@elastic/elasticsearch';
import AggregateError from 'aggregate-error';
import { Writable } from 'stream';
import { Stats } from '../stats';
import { Progress } from '../progress';
import { ES_CLIENT_HEADERS } from '../../client_headers';

export function createIndexDocRecordsStream(
client: KibanaClient,
client: Client,
stats: Stats,
progress: Progress,
useCreate: boolean = false
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-es-archiver/src/lib/indices/__mocks__/stubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import type { KibanaClient } from '@elastic/elasticsearch/api/kibana';
import type { Client } from '@elastic/elasticsearch';
import sinon from 'sinon';
import { ToolingLog } from '@kbn/dev-utils';
import { Stats } from '../../stats';
Expand Down Expand Up @@ -67,7 +67,7 @@ const createEsClientError = (errorType: string) => {
const indexAlias = (aliases: Record<string, any>, index: string) =>
Object.keys(aliases).find((k) => aliases[k] === index);

type StubClient = KibanaClient;
type StubClient = Client;

export const createStubClient = (
existingIndices: string[] = [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ describe('esArchiver: createCreateIndexStream()', () => {
"ignore": Array [
404,
],
"meta": true,
},
],
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import { Transform, Readable } from 'stream';
import { inspect } from 'util';

import { estypes } from '@elastic/elasticsearch';
import type { KibanaClient } from '@elastic/elasticsearch/api/kibana';
import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { Client } from '@elastic/elasticsearch';
import { ToolingLog } from '@kbn/dev-utils';

import { Stats } from '../stats';
Expand All @@ -31,7 +31,7 @@ export function createCreateIndexStream({
skipExisting = false,
log,
}: {
client: KibanaClient;
client: Client;
stats: Stats;
skipExisting?: boolean;
log: ToolingLog;
Expand Down
Loading