-
Notifications
You must be signed in to change notification settings - Fork 731
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOCS] Adds Integrations section to Node.JS docs (#1407)
Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
- Loading branch information
1 parent
22ece32
commit 36eaed6
Showing
8 changed files
with
141 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[[integrations]] | ||
== Integrations | ||
|
||
The Client offers the following integration options for you: | ||
|
||
* <<observability>> | ||
* <<transport>> | ||
* <<typescript>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[[transport]] | ||
=== Transport | ||
|
||
This class is responsible for performing the request to {es} and handling | ||
errors, it also handles sniffing. | ||
|
||
[source,js] | ||
---- | ||
const { Client, Transport } = require('@elastic/elasticsearch') | ||
class MyTransport extends Transport { | ||
request (params, options, callback) { | ||
// your code | ||
} | ||
} | ||
const client = new Client({ | ||
Transport: MyTransport | ||
}) | ||
---- | ||
|
||
Sometimes you need to inject a small snippet of your code and then continue to | ||
use the usual client code. In such cases, call `super.method`: | ||
|
||
[source,js] | ||
---- | ||
class MyTransport extends Transport { | ||
request (params, options, callback) { | ||
// your code | ||
return super.request(params, options, callback) | ||
} | ||
} | ||
---- | ||
|
Oops, something went wrong.