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

Log url, method along with response #2281

Merged
merged 3 commits into from
Jul 4, 2023
Merged

Log url, method along with response #2281

merged 3 commits into from
Jul 4, 2023

Conversation

hardillb
Copy link
Contributor

Description

This means you don't need both request and response to get all details.

Will make for better dashboard data.

Related Issue(s)

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on flowforge/helm to update ConfigMap Template
    • Issue/PR raised on flowforge/CloudProject to update values for Staging/Production

Labels

  • Backport needed? -> add the backport label
  • Includes a DB migration? -> add the area:migration label

This means you don't need both request and response to get all
details.

Will make for better dashboard data.
@hardillb hardillb self-assigned this Jun 14, 2023
@knolleary
Copy link
Member

Any update on this? Still in draft so not sure what's left to do.

@hardillb
Copy link
Contributor Author

hardillb commented Jul 4, 2023

It was an experiment to see if I could get a single log line with both the request and response information to make metrics easier to generate.

To be honest I forgot about it once I got it this far, but meant to discuss it. Let me run it again locally and include some sample before and after output.

@hardillb hardillb marked this pull request as ready for review July 4, 2023 13:05
@hardillb
Copy link
Contributor Author

hardillb commented Jul 4, 2023

Old:

[2023-07-04T13:04:52.481Z] INFO: incoming request {"reqId":"req-k","req":{"method":"GET","url":"/app/assets/a1b365c70146b3110079.png","hostname":"localhost:3000","remoteAddress":"::1","remotePort":59742}}
[2023-07-04T13:04:52.487Z] INFO: request completed {"reqId":"req-h","res":{"statusCode":200},"responseTime":71.57810497283936}

New

[2023-07-04T12:53:31.980Z] INFO: incoming request {"reqId":"req-o","req":{"method":"GET","url":"/api/v1/projects/62cb0497-5591-4a9b-970e-d3e58eafc1a8/devices/settings","hostname":"localhost:3000","remoteAddress":"::1","remotePort":59810}}
[2023-07-04T12:53:31.987Z] INFO: request completed {"reqId":"req-o","res":{"statusCode":200,"request":{"url":"/api/v1/projects/62cb0497-5591-4a9b-970e-d3e58eafc1a8/devices/settings","method":"GET","remoteAddress":"::1","remotePort":59810}},"responseTime":6.843713998794556}

@knolleary knolleary merged commit 8c28f4e into main Jul 4, 2023
3 checks passed
@knolleary knolleary deleted the better-http-logging branch July 4, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants