Commit c883b63
authored
Handle 8 byte trace ids (#365)
Nginx uses 8 byte trace ids whereas OpenCensus expects trace ids which are 16 bytes. When we encounter an 8 byte trace id, we discard it, breaking the trace tree.
When reading trace id headers, we now left-pad trace ids with 0s to 16 bytes. This is consistent with the way that OpenCensus handles trace ids less than 16 bytes: https://github.com/census-instrumentation/opencensus-go/blob/master/plugin/ochttp/propagation/b3/b3.go#L66
We also now log the appropriate error when we fail to emit a span. This will allow us to distinguish between the scenario when the span receiver has been dropped vs when span conversion fails.
Signed-off-by: Alex Leong <[email protected]>1 parent 4c3d706 commit c883b63
2 files changed
+16
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
182 | | - | |
| 181 | + | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | | - | |
| 182 | + | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
222 | 232 | | |
223 | 233 | | |
224 | 234 | | |
| |||
0 commit comments