You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat (processor/k8sattributes): wait for synced when starting k8sattributes processor. (#32622)
**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.-->
When starting `k8sattributes` processor, block until an initial
synchronization has been completed. This solves #32556
**Link to tracking Issue:** <Issue number if applicable>
fix#32556
**Testing:** <Describe what testing was performed and which tests were
added.>
Tested in a cluster with constant high span traffic, no more spans with
unassociated k8s metadata after adding this pr.
**Documentation:** <Describe the documentation added.>
---------
Co-authored-by: Christos Markou <[email protected]>
# Use this changelog template to create an entry for release notes.
2
+
3
+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4
+
change_type: bug_fix
5
+
6
+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7
+
component: processor/k8sattributes
8
+
9
+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10
+
note: Block when starting until the metadata have been synced, to fix that some data couldn't be associated with metadata when the agent was just started.
11
+
12
+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13
+
issues: [32556]
14
+
15
+
# (Optional) One or more lines of additional information to render under the primary note.
16
+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17
+
# Use pipe (|) for multiline entries.
18
+
subtext:
19
+
20
+
# If your change doesn't affect end users or the exported elements of any package,
21
+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22
+
# Optional: The change log or logs in which this entry should be included.
23
+
# e.g. '[user]' or '[user, api]'
24
+
# Include 'user' if the change is relevant to end users.
25
+
# Include 'api' if there is a change to a library API.
Copy file name to clipboardExpand all lines: processor/k8sattributesprocessor/README.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -198,6 +198,21 @@ the processor associates the received trace to the pod, based on the connection
198
198
}
199
199
```
200
200
201
+
By default, the processor will be ready as soon as it starts, even if no metadata has been fetched yet.
202
+
If data is sent to this processor before the metadata is synced, there will be no metadata to enrich the data with.
203
+
204
+
To wait for the metadata to be synced before the processor is ready, set the `wait_for_metadata` option to `true`.
205
+
Then the processor will not be ready until the metadata is fully synced. As a result, the start-up of the Collector will be blocked. If the metadata cannot be synced, the Collector will ultimately fail to start.
206
+
If a timeout is reached, the processor will fail to start and return an error, which will cause the collector to exit.
207
+
The timeout defaults to 10s and can be configured with the `metadata_sync_timeout` option.
208
+
209
+
example for setting the processor to wait for metadata to be synced before it is ready:
210
+
211
+
```yaml
212
+
wait_for_metadata: true
213
+
wait_for_metadata_timeout: 10s
214
+
```
215
+
201
216
## Extracting attributes from pod labels and annotations
202
217
203
218
The k8sattributesprocessor can also set resource attributes from k8s labels and annotations of pods, namespaces and nodes.
0 commit comments