Commit b730182
Allow reraising the root exception if instrumentation fails (#3545)
* Allow reraising the root exception if instrumentation fails
I would rather completely fail startup in my services if instrumentation fails for whatever reason instead of just logging an exception and continuing.
Use case:
from opentelemetry import autoinstrumentation
autoinstrumentation.initialize(swallow_exceptions=False)
* Fix lint
* Type hinting, re-raise original exception
* One more type hint to indicate None return
---------
Co-authored-by: Riccardo Magliocchetti <[email protected]>1 parent 4a21b39 commit b730182
File tree
3 files changed
+24
-3
lines changed- opentelemetry-instrumentation
- src/opentelemetry/instrumentation/auto_instrumentation
- tests/auto_instrumentation
3 files changed
+24
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| |||
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
123 | 127 | | |
124 | 128 | | |
125 | 129 | | |
| |||
131 | 135 | | |
132 | 136 | | |
133 | 137 | | |
134 | | - | |
| 138 | + | |
135 | 139 | | |
| 140 | + | |
| 141 | + | |
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
0 commit comments