-
Notifications
You must be signed in to change notification settings - Fork 829
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 tracing #2446
log tracing #2446
Conversation
We have created an issue in Pivotal Tracker to manage this: https://www.pivotaltracker.com/story/show/185849157 The labels on this github issue will be updated when the story is started. |
A message that I posted in a private slack thread before:
Has this been considered? |
There were tradeoffs wherever we put it. It seems that if someone is parsing the logs, they might have a pattern that looks at the time stamp and the fields following it. So putting the new information just before "----" seemed slightly less likely to break any existing patterns. In fact, there was an acceptance test in But I get what you've said about the scope of the trace ID being broader than the thread ID (and even the Ultimately, though, I don't feel strongly about where we place the new information, and we just made what thought was the least undesirable choice at the time. |
41dd3cc
to
ea83bd4
Compare
- based on this example app using brave lib (https://github.com/openzipkin/brave-example/tree/59215c36ce8ec12cbb2358fd6e7e6b494bc42b29/webmvc4-boot) - aside from the brave docs and example app, we also have to manually add the TracingFilter bean to the filter chain [#185000950] Co-authored-by: Hongchol Sinn <[email protected]> Co-authored-by: Danny Faught <[email protected]>
* This was copied from sample code, doesn't seem to be needed for UAA.
ea83bd4
to
28fb175
Compare
@strehle @torsten-sap In reviewing the comments and discussions, I am inclinded to merge this. Do you feel there is a roadblock that needs to be resolved before merging? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why these changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diff is not very helpful. We just inserted one line and changed the position numbers on the rest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This implements log tracing, where log messages will now include a trace ID and span ID that's either sent in from the API client or otherwise auto-generated. This allows for improved debugging, so transactions can be correlated between different web services that use the same trace ID. In the example below,
- [ace36bc5bdccffef,ace36bc5bdccffef]
is the part that is added:[2023-08-16T00:56:46.060135Z] uaa - 13 [https-jsse-nio-8443-exec-1] - [ace36bc5bdccffef,ace36bc5bdccffef] .... DEBUG --- UaaMetricsFilter: Successfully matched URI: /oauth/token to a group: /oauth-oidc
In some code paths, like startup and rate limiting where the filter that implements log tracing isn't run, the trace and span IDs may be blank:
[2023-08-17T01:53:42.790149Z] uaa/uaa - 17490 [main] - [,] .... INFO --- SpringSecurityCoreVersion: You are running with Spring Security Core 5.7.10
See also a related change for uaa-release to update the log4j format there.
NOTE: This could be a breaking change for any stakeholder who parses UAA logs, because this add information to the middle of each log line in uaa.log.
[#185000950]