Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor UDP Tracker logs #703

Conversation

josecelano
Copy link
Member

Refactor UDP Tracker logs.

  • Use tracing crate format.
  • Include request ID matching request and response.
  • Include service identification with the server socket address.
  • Rename target from UDP Tracker to UDP TRACKER.

Example:

2024-02-19T17:10:05.243973520+00:00 [UDP TRACKER][INFO] request; server_socket_addr=0.0.0.0:6969 action=CONNECT transaction_id=-888840697 request_id=03b92de0-c9f8-4c40-a808-5d706ce770f4
2024-02-19T17:10:05.244016141+00:00 [UDP TRACKER][INFO] response; server_socket_addr=0.0.0.0:6969 transaction_id=-888840697 request_id=03b92de0-c9f8-4c40-a808-5d706ce770f4
2024-02-19T17:10:05.244042841+00:00 [UDP TRACKER][INFO] request; server_socket_addr=0.0.0.0:6969 action=ANNOUNCE transaction_id=-888840697 request_id=2113eb8c-61f4-476b-b3d5-02892f0a2fdb connection_id=-7190270103145546231 info_hash=9c38422213e30bff212b30c360d26f9a02136422
2024-02-19T17:10:05.244052082+00:00 [UDP TRACKER][INFO] response; server_socket_addr=0.0.0.0:6969 transaction_id=-888840697 request_id=2113eb8c-61f4-476b-b3d5-02892f0a2fdb

It does not include any response data to keep log files small.

@josecelano josecelano added this to the v3.0.0 milestone Feb 19, 2024
@josecelano josecelano self-assigned this Feb 19, 2024
@josecelano josecelano added Enhancement / Feature Request Something New - Developer - Torrust Improvement Experience - Admin - Enjoyable to Install and Setup our Software labels Feb 19, 2024
@josecelano josecelano linked an issue Feb 19, 2024 that may be closed by this pull request
Use `tracing` crate format:

```
2024-02-19T17:10:05.243973520+00:00 [UDP TRACKER][INFO] request; server_socket_addr=0.0.0.0:6969 action=CONNECT transaction_id=-888840697 request_id=03b92de0-c9f8-4c40-a808-5d706ce770f4
2024-02-19T17:10:05.244016141+00:00 [UDP TRACKER][INFO] response; server_socket_addr=0.0.0.0:6969 transaction_id=-888840697 request_id=03b92de0-c9f8-4c40-a808-5d706ce770f4
2024-02-19T17:10:05.244042841+00:00 [UDP TRACKER][INFO] request; server_socket_addr=0.0.0.0:6969 action=ANNOUNCE transaction_id=-888840697 request_id=2113eb8c-61f4-476b-b3d5-02892f0a2fdb connection_id=-7190270103145546231 info_hash=9c38422213e30bff212b30c360d26f9a02136422
2024-02-19T17:10:05.244052082+00:00 [UDP TRACKER][INFO] response; server_socket_addr=0.0.0.0:6969 transaction_id=-888840697 request_id=2113eb8c-61f4-476b-b3d5-02892f0a2fdb
```
@josecelano josecelano force-pushed the 698-udp-tracker-refactor-logs-for-request-and-responses branch from 547030a to 4a2d902 Compare February 19, 2024 17:16
@josecelano
Copy link
Member Author

ACK 4a2d902

Copy link

codecov bot commented Feb 19, 2024

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (af2e0f9) 73.31% compared to head (4a2d902) 73.40%.

Files Patch % Lines
src/servers/udp/handlers.rs 80.76% 5 Missing ⚠️
src/bootstrap/jobs/udp_tracker.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #703      +/-   ##
===========================================
+ Coverage    73.31%   73.40%   +0.08%     
===========================================
  Files          143      144       +1     
  Lines         9241     9291      +50     
===========================================
+ Hits          6775     6820      +45     
- Misses        2466     2471       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@josecelano josecelano merged commit e6deacb into torrust:develop Feb 19, 2024
13 checks passed
@josecelano josecelano deleted the 698-udp-tracker-refactor-logs-for-request-and-responses branch February 19, 2024 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- Admin - Enjoyable to Install and Setup our Software - Developer - Torrust Improvement Experience Enhancement / Feature Request Something New
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UDP Tracker: refactor logs for request and responses
1 participant