Commit 6a09a37
committed
fix: filter Traceloop's own processor instead of patching the provider
Two problems with patching the global provider's add_span_processor.
When no OTLP endpoint is configured the bootstrap installs nothing and the
global provider is still a proxy, so there was nothing to patch and the filter
was skipped. Traceloop then registers its own concrete provider, the proxy
resolves onto it, and the service's spans reach the vendor by the same route.
That is the ordinary Traceloop-without-an-APM setup, not an edge case.
The provider is also shared: a processor another integration registered while
init was running would have been wrapped too, and would then have had this
filter's boundary applied backwards.
Wrap the SDK's get_default_span_processor for the duration of init instead. It
applies whichever provider Traceloop ends up with, and touches nothing outside
the SDK. As a side effect the vendor-first ordering no longer leaks either: the
APM still receives nothing, but the span is dropped rather than exported.1 parent a3e8073 commit 6a09a37
2 files changed
Lines changed: 59 additions & 23 deletions
File tree
- src/backend
- base/langflow/services/tracing
- tests/unit/services/tracing
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
95 | 103 | | |
96 | 104 | | |
97 | 105 | | |
| 106 | + | |
| 107 | + | |
98 | 108 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 109 | + | |
104 | 110 | | |
105 | | - | |
106 | | - | |
| 111 | + | |
| 112 | + | |
107 | 113 | | |
108 | | - | |
| 114 | + | |
109 | 115 | | |
110 | 116 | | |
111 | 117 | | |
112 | | - | |
| 118 | + | |
113 | 119 | | |
114 | 120 | | |
115 | 121 | | |
| |||
Lines changed: 36 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
109 | 136 | | |
110 | 137 | | |
111 | 138 | | |
| |||
135 | 162 | | |
136 | 163 | | |
137 | 164 | | |
138 | | - | |
| 165 | + | |
139 | 166 | | |
140 | 167 | | |
141 | 168 | | |
142 | | - | |
143 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
144 | 175 | | |
145 | 176 | | |
146 | | - | |
147 | | - | |
| 177 | + | |
148 | 178 | | |
149 | 179 | | |
150 | 180 | | |
| |||
162 | 192 | | |
163 | 193 | | |
164 | 194 | | |
165 | | - | |
| 195 | + | |
0 commit comments