Commit a569698
authored
[Discover][Logs] Unify value treatment for log.level and error.log.level (elastic#245891)
## Summary
Closes elastic#245348.
With the introduction of improvements to the log overview for
errors/exceptions ([PR](elastic#241342)),
we added `error.log.level` information to be shown as a badge, in the
same way we do for `log.level`.
<img width="1668" height="969" alt="Screenshot 2025-12-10 at 17 50 58"
src="https://github.com/user-attachments/assets/938789b4-9b64-494e-bb27-68a7c55d6afd"
/>
We recently noticed that `error.log.level` was showing the value with
the plain highlight tags.
<img width="1427" height="566"
alt="522848417-3f9d9b1f-2ac4-4dad-b32c-9e8437a8cd68"
src="https://github.com/user-attachments/assets/de4cf722-bd92-4d91-bb87-257c8134db3c"
/>
The issue was that `log.level` was using in `getLogDocumentOverview` its
raw value, ignoring the formatted information that ES provides, which
includes highlighting when a filter matches.
The logical change here is to make the badge behave consistently for all
"log level" data types. If `log.level` didn’t originally have
highlighting, then other values displayed with the same UI and the same
user-facing value shouldn’t have it either.
So, the change is straightforward: treat `error.log.level` in the same
way as `log.level`.
|Before|After|
|-|-|
|<img width="1627" height="969" alt="Screenshot 2025-12-10 at 18 16 01"
src="https://github.com/user-attachments/assets/98fa7337-e4ef-4da2-8444-9bf96890e5ff"
/>|<img width="1627" height="969" alt="Screenshot 2025-12-10 at 18 13
40"
src="https://github.com/user-attachments/assets/59255df5-de05-40ff-a952-a61be5eb1129"
/>|
## Out of scope of the related issue, but worth fixing
While taking screenshots, I noticed that documents can contain
`timestamp` in an array, not just as a plain string.
This caused the “current document” annotation not to appear in the
Similar Errors chart
([PR](elastic#244665)), so I included a
quick fix for that in this PR.
<img width="867" height="216" alt="Screenshot 2025-12-04 at 11 47 47"
src="https://github.com/user-attachments/assets/44e2bcb8-a5f3-4ded-b7a8-57f6988fb37e"
/>
## Future considerations
(not to be tackled in this PR, but cc @roshan)
- Why is `log.level` ignoring the highlight tags? Should we consider
highlighting it?
- Worth noting that highlighting is only available in Classic mode at
the moment.
- `log.level` has its own cell renderer in the Discover results, showing
the badge. Should we do the same for `error.log.level`?1 parent 7c01ff3 commit a569698
File tree
3 files changed
+53
-11
lines changed- src/platform
3 files changed
+53
-11
lines changedLines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
| |||
147 | 150 | | |
148 | 151 | | |
149 | 152 | | |
150 | | - | |
| 153 | + | |
151 | 154 | | |
152 | 155 | | |
153 | 156 | | |
| |||
Lines changed: 44 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
140 | 143 | | |
141 | 144 | | |
142 | 145 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
148 | 157 | | |
149 | 158 | | |
150 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
151 | 167 | | |
152 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
153 | 188 | | |
154 | 189 | | |
0 commit comments