Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

vlc log entries: routine start time is always the same #537

Open
kptdobe opened this issue Jul 8, 2020 · 7 comments
Open

vlc log entries: routine start time is always the same #537

kptdobe opened this issue Jul 8, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@kptdobe
Copy link
Contributor

kptdobe commented Jul 8, 2020

The order of the Fastly logs is random in Epsagon:

i think

s: vcl`time.start.usec`,
is the issue: looking at time-start-usec doc, the value of time.start.usec is the request start time, i.e. it will be the same in each subroutine.

We should rather use (now-sec)[https://developer.fastly.com/reference/vcl/variables/date-and-time/now-sec/] but I do not think second is precise enough... Or maybe do time.start.usec + time.elapsed.usec is this is possible.

cc @trieloff

@kptdobe kptdobe added the bug Something isn't working label Jul 8, 2020
@trieloff
Copy link
Contributor

trieloff commented Jul 8, 2020

@ranrib FYI. I think $t.s + $t.e should give us the right order, as $t.s is constant per request.

@kptdobe
Copy link
Contributor Author

kptdobe commented Jul 8, 2020

Correct.
I created https://fiddle.fastlydemo.net/fiddle/cfabc298 to double check.

@kptdobe
Copy link
Contributor Author

kptdobe commented Jul 8, 2020

@ranrib I do not know how this is architected internally but Epsagon API returns $t.s as the span start_time which here is then incorrect.

@kptdobe
Copy link
Contributor Author

kptdobe commented Jul 8, 2020

I also suspect that $t.e is used as the duration but that's not correct neither. I think the duration is missing in the data we send. I do not see in the tracer some logic that would compute the duration of a subroutine...

@trieloff
Copy link
Contributor

trieloff commented Jul 8, 2020

We send the leased time twice: when we enter the subroutine and when we leave. This should enable accurate calculation of the duration.

@kptdobe
Copy link
Contributor Author

kptdobe commented Jul 8, 2020

ok, then only the maths on the Epsagon side need to be adjusted. As you mention, $t.s + $t.e always gives "the current time" to be used for entry time and exit time of the subroutine. And the diff between those gives the duration.

@ranrib
Copy link

ranrib commented Jul 8, 2020

Hi, I tested it and it seems that we're getting $t.s + $t.e which is a similar value for enter and leave (which means duration = 0). Do you have any way to check it on your end?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants