Time delta between labels in separate log lines / query frames

  • What Grafana version and what operating system are you using? Grafana Cloud

  • What are you trying to achieve? Epoch time (ms) difference between time labels (t2 - t1) in separate panel queries (frames?)

  • How are you trying to achieve it? We think we might need the Concatenate Fields expression but there is almost certainly a better way to do it by creating a label in LogQL

  • What happened? We get no apparent usable output from the concat expression

  • What did you expect to happen? We hoped the labels would be available for the delta

  • Can you copy/paste the configuration(s) that you are having problems with? Below

  • Did you receive any errors in the Grafana UI or in related logs? No

  • Did you follow any online instructions? If so, what is the URL? Transformation functions | Grafana documentation

============
Sample logs / LogQL

t1
Dec 01 02:33:31 60100-33333 traffic[4819]: [traffic_app.cpp:1083] TrafficApp::trigger_callback:(trigger = A) happens at T1 [1669862011643]

{application=“traffic”}
|= trigger_callback
| pattern <_> _T1_ [<t1>]

t2
Dec 01 05:33:42 60100-33333 traffic[38779]: [radar_controller.cpp:468] RadarController::radar_read_thread()[1669872822841], get radar interrupt [115660] [5488]ago T2 [1669872817353]

{application=“traffic”}
|= get radar interrupt |= _T2_
| pattern <_>, get radar interrupt [<_>] [<_ms_>]ago _T2_ [<t2>]

===================================================

Also we have a related question regarding the epoch resolution i.e. we’re using milliseconds but it appears the lowest conversion resolution Grafana supports is seconds apart from the implicit tNs timer.

I can’t find the documentation but I definitely remember reading that - can repost this last as another thread if required.

Many TiAs and Merry Christmas :santa: