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

chore(logging): improve logging with instrument and request-id span #290

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

geekbrother
Copy link
Contributor

@geekbrother geekbrother commented Nov 28, 2023

Description

This PR introduces the following changes:

  • removing custom x-request-id implementation in a favor of tower request_id:
  • adding instrument to handlers and functions for the proper logs span:

Resolves #142

How Has This Been Tested?

Started the server locally with the tracing log level and got test logs with the span and request_id like:

2023-11-28T19:01:33.829273Z DEBUG http-request{method=GET request_id="06d1e80a-dc05-4c0c-9b5a-4ecb83a11534" uri=/health}: started processing request
2023-11-28T19:01:33.829604Z  INFO http-request{method=GET request_id="06d1e80a-dc05-4c0c-9b5a-4ecb83a11534" uri=/health}:handler: health check
2023-11-28T19:01:33.829726Z DEBUG http-request{method=GET request_id="06d1e80a-dc05-4c0c-9b5a-4ecb83a11534" uri=/health}: finished processing request latency=0 ms status=200

Due Diligence

  • Breaking change
  • Requires a documentation update
  • Requires a e2e/integration test update

@geekbrother geekbrother self-assigned this Nov 28, 2023
@arein arein added the accepted The issue has been accepted into the project label Nov 28, 2023
@geekbrother geekbrother changed the title chore: improve logging chore: improve logging with instrument and request-id span Nov 28, 2023
@geekbrother geekbrother force-pushed the max/fix/use_tower_request_id branch 4 times, most recently from 1b2283b to df3e24a Compare November 28, 2023 20:20
@geekbrother geekbrother marked this pull request as ready for review November 28, 2023 20:36
@geekbrother geekbrother changed the title chore: improve logging with instrument and request-id span chore(logging): improve logging with instrument and request-id span Nov 28, 2023
Copy link
Member

@chris13524 chris13524 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@geekbrother geekbrother merged commit 21ec1ed into main Nov 28, 2023
6 checks passed
@geekbrother geekbrother deleted the max/fix/use_tower_request_id branch November 28, 2023 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted The issue has been accepted into the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve logging
3 participants