Skip to content

Commit

Permalink
docs(site): update otel.md (#2821)
Browse files Browse the repository at this point in the history
`NodeSDK.start()` become `synchronous`

ref: open-telemetry/opentelemetry-js#3460
  • Loading branch information
waitingsong authored Mar 27, 2023
1 parent 7ad4e9b commit 4c9e56b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
10 changes: 5 additions & 5 deletions packages/otel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ const sdk = new opentelemetry.NodeSDK({
// initialize the SDK and register with the OpenTelemetry API
// this enables the API to record telemetry
sdk.start()
.then(() => {
return Bootstrap
.configure(/**/)
.run();
});

// gracefully shut down the SDK on process exit
process.on('SIGTERM', () => {
Expand All @@ -61,6 +56,11 @@ process.on('SIGTERM', () => {
.catch((error) => console.log('Error terminating tracing', error))
.finally(() => process.exit(0));
});

Bootstrap
.configure(/**/)
.run();

```

You can find more information at [opentelemetry-js](https:/open-telemetry/opentelemetry-js)
Expand Down
9 changes: 4 additions & 5 deletions site/docs/extensions/otel.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@ const sdk = new opentelemetry.NodeSDK({

// 初始化 SDK,成功启动之后,再启动 Midway 框架
sdk.start()
.then(() => {
return Bootstrap
.configure(/**/)
.run();
});

// 在进程关闭时,同时关闭数据采集
process.on('SIGTERM', () => {
Expand All @@ -99,6 +94,10 @@ process.on('SIGTERM', () => {
.catch((error) => console.log('Error terminating tracing', error))
.finally(() => process.exit(0));
});

Bootstrap
.configure(/**/)
.run();
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@ const sdk = new opentelemetry.NodeSDK({

// Initialize the SDK and start the Midway framework after successful startup.
sdk.start()
.then(() => {
return Bootstrap
.configure(/**/)
.run();
});

// When the process is closed, data collection is closed at the same time
process.on('SIGTERM', () => {
Expand All @@ -99,6 +94,10 @@ process.on('SIGTERM', () => {
.catch((error) => console.log('Error terminating tracing', error))
.finally(() => process.exit(0));
});

Bootstrap
.configure(/**/)
.run();
```


Expand Down

0 comments on commit 4c9e56b

Please sign in to comment.