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

feature: add TraceID to logging #816

Open
IvanObreshkov opened this issue Dec 5, 2024 · 1 comment
Open

feature: add TraceID to logging #816

IvanObreshkov opened this issue Dec 5, 2024 · 1 comment

Comments

@IvanObreshkov
Copy link
Collaborator

Brief description:

You said you could set this up for 5 min, that's why I am assigning it to you :D.

As discussed, it's a good idea to add traceID to our logs so that we can trace the operations happening when it comes to handling a request. For this to work, maybe we would need the uvicorn log entries to be in a JSON format as well when it comes to deployed environments.

How to achieve it:

I am not sure but I guess you should do your magic in this file:
https://github.com/AUBGTheHUB/monolith/blob/main/services/py-api/src/server/logger/logger_factory.py

Maybe you could get some inspiration from here, or maybe not:
https://www.w3.org/TR/trace-context/

Ti si znaesh brat.

@IvanObreshkov
Copy link
Collaborator Author

https://www.structlog.org/en/stable/contextvars.html
This might be helpful

@asynchroza asynchroza removed their assignment Jan 6, 2025
@Isak-Bego Isak-Bego changed the title Add TraceID to logging feature: add TraceID to logging Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants