Commit 7c9a874
authored
fix: Unparent connection span (#868)
The `Connection` struct contains a `tracing::Span` tracking its
lifetime. This can be useful. The problem is that this span has as its
parent the span within which the connection is created, meaning that it
keeps that span alive (not closed) while it is alive. In practice that
means, for example, instrumented functions that create connections and
store those connections for reuse will not have their spans closed and
exported when they end.
This commit sets the `Connection`'s span's parent to `None` and gives it
a "follows-from" relation to the span in which it was created instead.
This shows the causal relationship between them, without tying the
creating span's lifetime to the connection's lifetime.1 parent c342e3f commit 7c9a874
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
| |||
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
138 | | - | |
| 140 | + | |
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
| |||
0 commit comments