Repository navigation
Conversation
d9e34e5 to
0d0ceb0
Compare
|
Thank you for bringing this up. One formal comment to this: Please create a GitHub issue of type enhancement first that references the discussion. Then update this PR to reference the issue. The enhancement you're adding here should be IMHO added to the default KeycloakErrorHandler and should depend on tracing being enabled. Instead of creating a new UUID, it should instead use the current traceId. The advantage of this is that all logs that are connect to the error will already have that traceId in the logs. Let me know your thoughts. cc: @jbman, @tbrandstetter |
Done.
I agree.
Im not sure if this feature should depend on tracing. I mean isn't it useful for people which haven't a tracing system connected to Keycloak isn't it? Furthermore, I think that from the end user's perspective, a shorter ID would be better in terms of readability and handling. Such IDs are often dictated over the phone. |
0d0ceb0 to
39b36bf
Compare
39b36bf to
ea7cdac
Compare
|
Thank you for the udpated PR.
You can run Keycloak with Looking at the code, the error ID is only generated when an error happens. I could see a benefit with a request ID, where the ID is generated at the very beginning of the request and added to the MDC all the time. This would allow you to collect all information connected to the request ID from the logs, even before the error happened. This would have been one of the advantages if the trace ID would be used, although I admit it is longer than the one you suggested. Such a request ID could then also be added to all user and admin events created by Keycloak. Some services also provide a request ID - see https://devcenter.heroku.com/articles/http-request-id for an article. So there might then be a configuration option to use the request ID, or to generate one ourselves. WDYT? |
Ok thats nice.
I think a general request ID is a great idea. If i understand you correctly this doesn't exist at the moment. Do you know what would be the right place to add it to the context? I mean it should be at the very beginning of the request processing. Updated the PR which now contains:
Let me know what you think. |
ea7cdac to
a2e23dd
Compare
|
@ahus1, I would keep the initial approach by @dafenix, to have a generated Error ID displayed to the user. It is important that the error is also logged and contains this ID. Any trace ID should be found in the same log line beside the Error ID. A trace ID provided within HTTP header X-Request-ID may be from a third party. You don't want to display that to a user. Tracing should remain an independent aspect, so that Open Telemetry tracing could be supported and or X-Request-ID or any other trace propagation. The Error ID feature does not need to be aware of this. |
…with it. Beside that this error can be presented to the user on the error page. Signed-off-by: Daniel Weber <mail.weberdaniel@gmail.com>
a2e23dd to
6483251
Compare
|
Hey, any updates on this? |
|
@dafenix - there have been different approaches discussed here with their advantages and disadvantages, and it requires some more discussion. I've added it to our roadmap planning. Eventually we will plan the parent issue for a milestone. Until then, this is on hold while we focus on enhancements on our roadmap. |
|
I consider the other PR which uses the trace ID good enough. Closing this one due to that. |
What do you think about a more readable error id like described in my opening post here? Is it something we should aiming for? |
Given the other items that are on our road map I would like to prioritize other things instead. So this is a no, I'm sorry. |
Related to #42004
Closes #44090
In case of an error, we want to display an ErrorId to the user, which they can provide for further support. To achieve this, it is necessary to intervene in the behavior of the ErrorHandler in order to set the ErrorId there and include it in the Freemarker template. I have already implemented a suggestion for this, which, in addition to the ErrorId, also sets a log marker that enriches the error entry in the log with the ErrorId.
Example:
CustomErrorResponseHandlerProvider.java
META-INF.services/org.keycloak.services.error.ErrorResponseHandlerProviderFactory