File tree Expand file tree Collapse file tree 3 files changed +87
-0
lines changed
platform-includes/performance
platforms/common/performance/instrumentation Expand file tree Collapse file tree 3 files changed +87
-0
lines changed Original file line number Diff line number Diff line change
1
+ ``` bash {tabTitle:npm}
2
+ npm install @sentry/node @sentry/opentelemetry-node
3
+ ```
4
+
5
+ ``` bash {tabTitle:yarn}
6
+ npm install @sentry/node @sentry/opentelemetry-node
7
+ ```
8
+
9
+ <Note >
10
+
11
+ Note that @sentry/opentelemetry-node depends on the following peer dependencies:
12
+
13
+ - @opentelemetry/api version 1.0.0 or greater
14
+ - @opentelemetry/sdk-trace-base version 1.0.0 or greater, or a package that implements that, like @opentelemetry/sdk-node .
15
+
16
+ </Note >
Original file line number Diff line number Diff line change
1
+ You need to register the SentrySpanProcessor and SentryPropagator with your OpenTelemetry installation:
2
+
3
+ ``` js
4
+ import _ as Sentry from ' @sentry/node' ;
5
+ import _ as otelApi from ' @opentelemetry/api' ;
6
+ import { SentrySpanProcessor } from ' @sentry/opentelemetry-node' ;
7
+
8
+ // Make sure to call `Sentry.init` BEFORE initializing the OpenTelemetry SDK
9
+ Sentry .init ({
10
+ dsn: ' ___PUBLIC_DSN___' ,
11
+ // ...
12
+ });
13
+
14
+ const sdk = new opentelemetry.NodeSDK ({
15
+ // Existing config
16
+ traceExporter: new OTLPTraceExporter (),
17
+ instrumentations: [getNodeAutoInstrumentations ()],
18
+
19
+ // Sentry config
20
+ spanProcessor: new SentrySpanProcessor (),
21
+ });
22
+
23
+ otelApi .propagation .setGlobalPropagator (new SentryPropagator ());
24
+ ```
Original file line number Diff line number Diff line change
1
+ ---
2
+ title : OpenTelemetry Support
3
+ sidebar_order : 20
4
+ supported :
5
+ - node
6
+ notSupported :
7
+ - javascript
8
+ - python
9
+ - dart
10
+ - flutter
11
+ - react-native
12
+ - java
13
+ - java.spring-boot
14
+ - android
15
+ - apple
16
+ - dotnet
17
+ - javascript.cordova
18
+ - javascript.electron
19
+ - go
20
+ - ruby
21
+ - unity
22
+ - rust
23
+ - native
24
+ - php
25
+ - native.breakpad
26
+ - native.crashpad
27
+ - native.minidumps
28
+ - unreal
29
+ - native.wasm
30
+ description : " Using OpenTelemetry with Sentry Performance."
31
+ ---
32
+
33
+ <Alert level = " warning" title = " Note" >
34
+
35
+ OpenTelemetry support for Sentry SDKs are in an alpha state. Features in alpha are still in-progress and may have bugs. We recognize the irony.
36
+
37
+ </Alert >
38
+
39
+ You can configure your [ OpenTelemetry SDK] ( https://opentelemetry.io/ ) to send traces and spans to Sentry.
40
+
41
+ ## Installation
42
+
43
+ <PlatformContent includePath = " performance/opentelemetry-install" />
44
+
45
+ ## Usage
46
+
47
+ <PlatformContent includePath = " performance/opentelemetry-install" />
You can’t perform that action at this time.
0 commit comments