-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add filestream stream IDs to k8s manifests. #2788
Conversation
Each filestream data stream also needs a unique ID, in addition to the input ID. The input ID is used by the agent itself, the stream level ID is what is used in the Filebeat registry.
This pull request does not have a backport label. Could you fix it @cmacknz? 🙏
NOTE: |
🌐 Coverage report
|
@@ -340,7 +340,8 @@ data: | |||
data_stream: | |||
namespace: default | |||
streams: | |||
- data_stream: | |||
- id: container-log-${kubernetes.pod.name}-${kubernetes.container.id} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we need this ID in streams' level too? How is this different to the one that already exists at
- id: container-log-${kubernetes.pod.name}-${kubernetes.container.id} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explained here: #2573 (comment)
The input level ID is used by the agent to keep track of the input state. For filestream specifically, each data stream becomes an independent instance of the filestream input in Beats. We need the ID at the stream level to give each filestream input in Beats a unique ID.
There is a one to many mapping between a filestream
input in the agent policy and the number of filestream inputs created in Filebeat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although, for kubernetes use case it seems like an one to one mapping, as each agent policy filestream input can only contain one stream, as they both point to one pod-container pair.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The input itself uses variable substitution here, so the number of inputs would depend on the number of monitored containers wouldn't it?
Either way, the official examples should use a stream level ID as well so that someone modifying it will a correct example to start from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cmacknz why we need both pod.name and container.id? Can we keep only container.id as it is unique afterall?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume because a pod can contain multiple containers, this is the same thing we use for the input level ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So reading #2573 (comment) I understand that we need the id
also on the streams
level. Based on this the change looks good to me but could we add a reference to any docs or the used GH comment to avoid any confusion in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, we don't have a place in the official docs where we document how to configure each input type in the standalone agent. I just pasted a summary of how this works in the reference YAML and the k8s manifests. Hopefully it helps clarify things.
f661a00
to
8381fa1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Add filestream stream IDs to k8s manifests. Each filestream data stream also needs a unique ID, in addition to the input ID. The input ID is used by the agent itself, the stream level ID is what is used in the Filebeat registry. * Add filestream docs to the reference configuration. * Describe what IDs are used for in cfg files. * Document IDs in the k8s configuration. (cherry picked from commit 6a6720e) # Conflicts: # _meta/config/common.p2.yml.tmpl # elastic-agent.yml
) * Add filestream stream IDs to k8s manifests. (#2788) * Add filestream stream IDs to k8s manifests. Each filestream data stream also needs a unique ID, in addition to the input ID. The input ID is used by the agent itself, the stream level ID is what is used in the Filebeat registry. * Add filestream docs to the reference configuration. * Describe what IDs are used for in cfg files. * Document IDs in the k8s configuration. (cherry picked from commit 6a6720e) # Conflicts: # _meta/config/common.p2.yml.tmpl # elastic-agent.yml * Resolve conflict. --------- Co-authored-by: Craig MacKenzie <[email protected]>
Each filestream data stream also needs a unique ID, in addition to the input ID. The input ID is used by the agent itself, the stream level ID is what is used in the Filebeat registry.