Repository navigation
context, registry, auth, auth/token, cmd/registry: context aware logging - #151
Conversation
|
It looks good, there might be some optimizations possible to reduce the number of values checks to get a logger instance. Also I like having it in the registry objects, but we should come up with another way when dealing with the exposed storage interfaces. |
|
Where is "http.request.startedat" supposed to get set? |
There don't seem to be any major changes but we'll update this while we're at it. This dependency is pretty important for coming changes. Signed-off-by: Stephen J Day <[email protected]>
This dependency added a method to access the current standard logger. This is required to properly configure the logger for context awareness. The plan is to have all loggers descend from the standard logger. Signed-off-by: Stephen J Day <[email protected]>
The new context package supports context-aware logging, integrating with logrus. Several utilities are provided to associate http requests with a context, ensuring that one can trace log messages all the way through a context-aware call stack. A full description of this functionality is available in doc.go. Signed-off-by: Stephen J Day <[email protected]>
Signed-off-by: Stephen J Day <[email protected]>
|
Would it also make sense to integrate the dapper like functionality here? Since it is defining a request context, additional variables could be added to logs for trace/parent/span id, and included in the http headers. |
125fe9a to
9530175
Compare
That gets set in |
This is partially the goal. Log fields, like "version", "app.id" and "http.request.id", all contribute to this. However, we don't have a standardized, distributed "request.id" or "session" id to be shared through requests. This is something that we should work towards. |
I'm looking at this now. The simplest modification is this: Basically, we need to be careful about where we can inject the context. The more functions we include it in the signature, the more granularity we get with context reporting. For most use cases, something like this might actually work: There are a few questions with this. How granular do we need the context? Do we use the context as an injection platform? |
9530175 to
41a332c
Compare
This changeset integrates contextual logging into the registry web application. Idiomatic context use is attempted within the current webapp layout. The functionality is centered around making lifecycle objects (application and request context) into contexts themselves. Relevant data has been moved into the context where appropriate. We still have some work to do to factor out the registry.Context object and the dispatching functionality to remove some awkward portions. The api tests were slightly refactored to use a test environment to eliminate common code. Signed-off-by: Stephen J Day <[email protected]>
41a332c to
d2bfb58
Compare
This changeset integrates context with the storage package. Debug messages have been added to exported methods. Existing log messages will now include contextual details through logger fields to aid in debugging. This integration focuses on logging and may be followed up with a metric-oriented change in the future. Signed-off-by: Stephen J Day <[email protected]>
|
auth-related changes LGTM |
|
LGTM |
context, registry, auth, auth/token, cmd/registry: context aware logging
The new context package supports context-aware logging, integrating with logrus. Several utilities are provided to associate http requests with a context, ensuring that one can trace log messages all the way through a context-aware call stack.
With the creation of that package, we've integrated contextual logging into the registry web application. Idiomatic context use is attempted within the current webapp layout. The functionality is centered around making lifecycle objects (application and request context) into contexts themselves. Relevant data has been moved into the context where appropriate. We still have some work to do to factor out the registry.Context object and the dispatching functionality to remove some awkward portions.
The api tests were slightly refactored to use a test environment to eliminate common code.
logrus and uuid have been updated, accordingly.
Closes #86.