You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before any other module in your application is loaded, you must initialize the SDK.
36
36
If you fail to initialize the SDK or initialize it too late, no-op implementations will be provided to any library which acquires a tracer or meter from the API.
37
+
37
38
This example uses Jaeger and Prometheus, but exporters exist for [other tracing backends][other-tracing-backends].
@@ -59,22 +62,21 @@ const sdk = new opentelemetry.NodeSDK({
59
62
60
63
// You can optionally detect resources asynchronously from the environment.
61
64
// Detected resources are merged with the resources provided in the SDK configuration.
62
-
sdk
63
-
.start()
64
-
.then(() => {
65
-
// Resources have been detected and SDK is started
66
-
})
65
+
sdk.start().then(() => {
66
+
// Resources have been detected and SDK is started
67
+
});
67
68
68
69
// You can also use the shutdown method to gracefully shut down the SDK before process shutdown
69
70
// or on some operating system signal.
70
71
constprocess=require("process");
71
72
process.on("SIGTERM", () => {
72
-
sdk.shutdown()
73
+
sdk
74
+
.shutdown()
73
75
.then(
74
76
() =>console.log("SDK shut down successfully"),
75
-
(err) =>console.log("Error shutting down SDK", err),
77
+
(err) =>console.log("Error shutting down SDK", err)
76
78
)
77
-
.finally(() =>process.exit(0))
79
+
.finally(() =>process.exit(0));
78
80
});
79
81
```
80
82
@@ -126,7 +128,7 @@ Configure a custom sampler. By default all traces will be sampled.
126
128
127
129
Configure a trace exporter. If an exporter OR span processor is not configured, the tracing SDK will not be initialized and registered. If an exporter is configured, it will be used with a [BatchSpanProcessor](../opentelemetry-tracing/src/export/BatchSpanProcessor.ts).
128
130
129
-
### traceParams
131
+
### spanLimits
130
132
131
133
Configure tracing parameters. These are the same trace parameters used to [configure a tracer](../opentelemetry-tracing/src/types.ts#L71).
132
134
@@ -145,9 +147,8 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
0 commit comments