Commit 6395ff8
authored
[pkg/stanza] container: move k8s metadata into resource attributes (open-telemetry#33353)
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
Container parser should add k8s metadata as resource attributes and not
as log record attributes.
**Link to tracking Issue:** <Issue number if applicable> Fixes
open-telemetry#33341
**Testing:** <Describe what testing was performed and which tests were
added.>
Manual testing on local k8s cluster:
```console
2024-06-04T06:40:08.219Z info ResourceLog #0
Resource SchemaURL:
Resource attributes:
-> k8s.pod.uid: Str(d5ecc924-e255-4525-b5be-6437939b1e4d)
-> k8s.container.name: Str(busybox)
-> k8s.namespace.name: Str(default)
-> k8s.pod.name: Str(daemonset-logs-dhzcq)
-> k8s.container.restart_count: Str(0)
ScopeLogs #0
ScopeLogs SchemaURL:
InstrumentationScope
LogRecord #0
ObservedTimestamp: 2024-06-04 06:40:08.007370503 +0000 UTC
Timestamp: 2024-06-04 06:40:07.855932421 +0000 UTC
SeverityText:
SeverityNumber: Unspecified(0)
Body: Str(otel logs at 06:40:07)
Attributes:
-> logtag: Str(F)
-> key2: Map({"key_in":"val2"})
-> log.file.path: Str(/var/log/pods/default_daemonset-logs-dhzcq_d5ecc924-e255-4525-b5be-6437939b1e4d/busybox/0.log)
-> time: Str(2024-06-04T06:40:07.855932421Z)
-> log.iostream: Str(stdout)
Trace ID:
Span ID:
Flags: 0
LogRecord #1
ObservedTimestamp: 2024-06-04 06:40:08.007451031 +0000 UTC
Timestamp: 2024-06-04 06:40:07.957875321 +0000 UTC
SeverityText:
SeverityNumber: Unspecified(0)
Body: Str(otel logs at 06:40:07)
Attributes:
-> log.file.path: Str(/var/log/pods/default_daemonset-logs-dhzcq_d5ecc924-e255-4525-b5be-6437939b1e4d/busybox/0.log)
-> log.iostream: Str(stdout)
-> time: Str(2024-06-04T06:40:07.957875321Z)
-> key2: Map({"key_in":"val2"})
-> logtag: Str(F)
Trace ID:
Span ID:
Flags: 0
```
**Documentation:** <Describe the documentation added.> ~
---------
Signed-off-by: ChrsMark <[email protected]>1 parent 982c728 commit 6395ff8
File tree
4 files changed
+104
-54
lines changed- .chloggen
- pkg/stanza
- docs/operators
- operator/parser/container
4 files changed
+104
-54
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
45 | 41 | | |
46 | 42 | | |
47 | 43 | | |
| |||
84 | 80 | | |
85 | 81 | | |
86 | 82 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
138 | 142 | | |
139 | 143 | | |
140 | 144 | | |
| |||
174 | 178 | | |
175 | 179 | | |
176 | 180 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
183 | 191 | | |
184 | 192 | | |
185 | 193 | | |
| |||
227 | 235 | | |
228 | 236 | | |
229 | 237 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
236 | 248 | | |
237 | 249 | | |
238 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
| 303 | + | |
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
161 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
162 | 166 | | |
163 | 167 | | |
164 | 168 | | |
165 | 169 | | |
166 | 170 | | |
167 | | - | |
168 | 171 | | |
169 | | - | |
170 | 172 | | |
171 | 173 | | |
172 | 174 | | |
| |||
212 | 214 | | |
213 | 215 | | |
214 | 216 | | |
215 | | - | |
216 | | - | |
217 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
218 | 224 | | |
219 | 225 | | |
220 | 226 | | |
221 | 227 | | |
222 | 228 | | |
223 | | - | |
224 | 229 | | |
225 | | - | |
226 | 230 | | |
227 | 231 | | |
228 | 232 | | |
| |||
246 | 250 | | |
247 | 251 | | |
248 | 252 | | |
249 | | - | |
250 | | - | |
251 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
252 | 259 | | |
253 | 260 | | |
254 | 261 | | |
255 | 262 | | |
256 | 263 | | |
257 | | - | |
258 | 264 | | |
259 | 265 | | |
260 | 266 | | |
| |||
286 | 292 | | |
287 | 293 | | |
288 | 294 | | |
289 | | - | |
290 | | - | |
291 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
292 | 301 | | |
293 | 302 | | |
294 | 303 | | |
295 | 304 | | |
296 | 305 | | |
297 | | - | |
298 | 306 | | |
299 | 307 | | |
300 | 308 | | |
| |||
326 | 334 | | |
327 | 335 | | |
328 | 336 | | |
329 | | - | |
330 | | - | |
331 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
332 | 344 | | |
333 | 345 | | |
334 | 346 | | |
335 | 347 | | |
336 | 348 | | |
337 | | - | |
338 | 349 | | |
339 | | - | |
340 | 350 | | |
341 | 351 | | |
342 | 352 | | |
| |||
0 commit comments