This repository was archived by the owner on Jul 31, 2023. It is now read-only.
Commit 9d52fcf
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 df0549d commit 9d52fcf
2 files changed
+29
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
144 | 148 | | |
145 | 149 | | |
146 | 150 | | |
| |||
161 | 165 | | |
162 | 166 | | |
163 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
164 | 175 | | |
165 | 176 | | |
166 | 177 | | |
| |||
236 | 247 | | |
237 | 248 | | |
238 | 249 | | |
239 | | - | |
| 250 | + | |
240 | 251 | | |
241 | 252 | | |
242 | 253 | | |
| |||
246 | 257 | | |
247 | 258 | | |
248 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
249 | 263 | | |
250 | 264 | | |
251 | 265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
233 | 247 | | |
234 | 248 | | |
235 | 249 | | |
| |||
0 commit comments