Commit eff3909
committed
Allow OTEL instrumenter to work even with no DSN.
Context: we are writing tests for our Sentry integration itself,
setting up a client like
```py
events = []
c = sentry_sdk.Client(dsn=None, instrumenter='otel', transport=events.append)
```
, and verifying that events contains spans from OpenTelemetry such as
```py
with tracer.start_as_current_span('fn'):
raise Exception('boo')
assert events = [...]
```
This currently doesn't work because the Sentry OTEL integration
has some hacks poking into the client and hard-exiting if DSN is None.
I conjecture this can be removed - the check-DSN-to-avoid-sentry-otel-loops
logic still works even without the DSN check in on_start().1 parent bb85c26 commit eff3909
File tree
2 files changed
+11
-10
lines changed- sentry_sdk/integrations/opentelemetry
- tests/integrations/opentelemetry
2 files changed
+11
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | 116 | | |
125 | 117 | | |
126 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
291 | 300 | | |
292 | 301 | | |
293 | 302 | | |
| |||
306 | 315 | | |
307 | 316 | | |
308 | 317 | | |
309 | | - | |
| 318 | + | |
310 | 319 | | |
311 | 320 | | |
312 | 321 | | |
| |||
0 commit comments