Commit 5e6a33d
committed
Introduce
Motivation:
A single `RequestLogProperty` can be received through
`RequestLog.whenAvailable()`, but it is not straightforward to receive
all events published by `RequestLog` using `.whenAvailable()`.
To address the limitation, I propose introducing an interface that
listens to all events by adding it to `RequestLog`. This will also
simplify the integration of other implmentations used for collecting
metrics.
Motifications:
- Introduced `RequestLogListener` API that can be attached to
`RequestLog`.
- `RequestLogAccess.addListener()` API was added and
`DefaultRequestLog` implmemeted it.
- The listener will be notified whenever a new property is set to
`RequestLog`. If some properties have already been set, they will
notified of them immediately.
- Add `REQUEST_COMPLETE`, `RESPONSE_COMPLETE` and `ALL_COMPLETE` to
`RequestLogProperty`.
- Previously, there were APIs such as `whenRequestComplete()` and
`whenComplete()` that computed and signaled request or response
completion and but no explicit properties exists for them.
`RequestLogProperty` should represent all states in
`RequestLogListener`, I added the new completion properties.
- Simplied child log propagation in `DefaultRequestLog` and
the `Observation{Service,Client} implementations by using
`RequestLogListener`.
Result:
You can now use `RequestLogListener` to observe all `RequestLog` events.RequestLogListener
1 parent b97b391 commit 5e6a33d
File tree
8 files changed
+532
-188
lines changed- core/src
- main/java/com/linecorp/armeria
- client/observation
- common/logging
- server/observation
- test/java/com/linecorp/armeria/common/logging
8 files changed
+532
-188
lines changedLines changed: 21 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
138 | 137 | | |
139 | 138 | | |
140 | 139 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
160 | 161 | | |
161 | 162 | | |
0 commit comments