This repository was archived by the owner on Jul 31, 2023. It is now read-only.
Commit 553b823
committed
trace: add starttime start option
Adds a StartTime option when creating a new span.
In some cases, you are able to trace only after the operation
was made. for example in some post-operation hook/observer.
func myHook(ctx context.Context, info queryInfo) {
_, span := StartSpan("mydatabase", WithStartTime(time.Now().Sub(info.Duration()))
span.End()
}1 parent fb92c34 commit 553b823
2 files changed
+29
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
130 | 134 | | |
131 | 135 | | |
132 | 136 | | |
| |||
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
150 | 161 | | |
151 | 162 | | |
152 | 163 | | |
| |||
221 | 232 | | |
222 | 233 | | |
223 | 234 | | |
224 | | - | |
| 235 | + | |
225 | 236 | | |
226 | 237 | | |
227 | 238 | | |
228 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
229 | 243 | | |
230 | 244 | | |
231 | 245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
232 | 246 | | |
233 | 247 | | |
234 | 248 | | |
| |||
0 commit comments