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
Alternatively, you can configure the OpenTelemetry Exporter directly in your application code. Here is an example with the OpenTelemetry Node SDK:
27
+
Alternatively, you can configure the OpenTelemetry Exporter directly in your application code. Here are examples with the OpenTelemetry Node and Python SDKs:
28
28
29
29
```typescript {filename: app.ts}
30
30
import { NodeSDK } from"@opentelemetry/sdk-node";
@@ -42,12 +42,37 @@ const sdk = new NodeSDK({
42
42
sdk.start();
43
43
```
44
44
45
+
```python {filename: app.py}
46
+
import sentry_sdk
47
+
from sentry_sdk.integrations.otlp import OtlpIntegration
48
+
from opentelemetry import trace
49
+
from opentelemetry.sdk.trace import TracerProvider
50
+
from opentelemetry.sdk.trace.export import BatchSpanProcessor
51
+
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
You can find the values of Sentry's OTLP traces endpoint and public key in your Sentry project settings.
46
67
47
68
1. Go to the [Settings > Projects](https://sentry.io/orgredirect/organizations/:orgslug/settings/projects/) page in Sentry.
48
69
2. Select a project from the list.
49
70
3. Go to the "Client Keys (DSN)" sub-page for this project under the "SDK Setup" heading.
50
71
72
+
### Linking Errors with Traces
73
+
74
+
For Python, make sure to enable the `OtlpIntegration` for the Sentry SDK so that other event types such as Errors and Logs are connected to the correct Trace.
0 commit comments