-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 complete k8s metadata through composable provider #27691
Changes from all commits
73b67bd
6d801f9
578ef96
7a8c55f
a478678
595cb27
c21d8e9
5132b5e
e2fec82
848c275
818e296
2699f16
5002ce5
acab1a1
48bc841
aaa4b0e
e702b31
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ package kubernetes | |
import ( | ||
"time" | ||
|
||
"github.com/elastic/beats/v7/libbeat/common/kubernetes/metadata" | ||
"github.com/elastic/beats/v7/libbeat/logp" | ||
) | ||
|
||
|
@@ -25,6 +26,16 @@ type Config struct { | |
|
||
// Needed when resource is a Pod or Node | ||
Node string `config:"node"` | ||
|
||
AddResourceMetadata *metadata.AddResourceMetadataConfig `config:"add_resource_metadata"` | ||
IncludeLabels []string `config:"include_labels"` | ||
ExcludeLabels []string `config:"exclude_labels"` | ||
|
||
LabelsDedot bool `config:"labels.dedot"` | ||
AnnotationsDedot bool `config:"annotations.dedot"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this just be the default? Do we need this configurable now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
// Undocumented settings, to be deprecated in favor of `drop_fields` processor: | ||
IncludeCreatorMetadata bool `config:"include_creator_metadata"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If undocumented and deprecated, why add it? Being this is all new to Elastic Agent, it could be the time to remove it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right this one is not exposed so it should be removed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually this touches code that is used by beats too. I will remove it in follow up PR target 8.0 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PR: #28006 |
||
} | ||
|
||
// Resources config section for resources' config blocks | ||
|
@@ -44,6 +55,9 @@ func (c *Config) InitDefaults() { | |
c.CleanupTimeout = 60 * time.Second | ||
c.SyncPeriod = 10 * time.Minute | ||
c.Scope = "node" | ||
c.IncludeCreatorMetadata = true | ||
c.LabelsDedot = true | ||
c.AnnotationsDedot = true | ||
} | ||
|
||
// Validate ensures correctness of config | ||
|
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.
Where is
IncludeLabels
andExcludeLabels
used? I was not able to find them in the diff.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.
These are passed and used deeper in meta Generators, which is already existent codebase.