roadrunner icon indicating copy to clipboard operation
roadrunner copied to clipboard

[💡 FEATURE REQUEST]: Log elapsed time always in microseconds

Open dmitryuk opened this issue 1 year ago • 8 comments

Plugin

Logger

I have an idea!

RR example log line

2024-02-02T02:51:48+0000	INFO	http        	http log	{"status": 200, "method": "GET", "URI": "/api/v2/cart/status?args=site24x7", "remote_address": "10.56.36.63:42084", "read_bytes": 0, "write_bytes": 448, "start": "2024-02-02T02:51:48+0000", "elapsed": "18.868363ms"} 

It is hard to monitor elapsed parameter, because it has units (microseconds or seconds).

Is it possible to always write microseconds without unit ?

dmitryuk avatar Feb 02 '24 03:02 dmitryuk

Hey @dmitryuk 👋 Why is it hard to monitor?

rustatian avatar Feb 02 '24 16:02 rustatian

Because elapsed can have different units (ms, s, m). Logging system like ELK hard to interpreter it

dmitryuk avatar Feb 03 '24 03:02 dmitryuk

@rustatian If I make a PR to always cast elapsed timestamp to ms units will you accept it?

dmitryuk avatar Feb 05 '24 05:02 dmitryuk

@dmitryuk No need to cast, time might be written in ms natively. Sure, you may send a PR, but this elapsed time should be updated across the whole plugin.

rustatian avatar Feb 05 '24 13:02 rustatian

MR 1 https://github.com/roadrunner-server/http/pull/199 MR 2 https://github.com/roadrunner-server/jobs/pull/125 MR 3 https://github.com/roadrunner-server/grpc/pull/132 MR 4 https://github.com/roadrunner-server/kafka/pull/339 MR 5 https://github.com/roadrunner-server/amqp/pull/121 MR 6 https://github.com/roadrunner-server/nats/pull/118 MR 7 https://github.com/roadrunner-server/boltdb/pull/109 MR 8 https://github.com/roadrunner-server/beanstalk/pull/103 MR 9 https://github.com/roadrunner-server/sqs/pull/398

Ready for review

dmitryuk avatar Feb 09 '24 04:02 dmitryuk

Cool, thanks @dmitryuk 👍

rustatian avatar Feb 13 '24 18:02 rustatian

@dmitryuk Please, rebase your PR's with master. There were some tests are failed, I've fixed that.

rustatian avatar Feb 15 '24 16:02 rustatian

@rustatian done, thanks

dmitryuk avatar Feb 16 '24 03:02 dmitryuk

Thanks @dmitryuk 👍 All PRs are merged 😃

rustatian avatar Feb 19 '24 08:02 rustatian