[Ingest Manager] New structure of agent configuration#19128
[Ingest Manager] New structure of agent configuration#19128michalpristas merged 10 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/ingest-management (Team:Ingest Management) |
| for _, datasourceNode := range datasourcesList.value { | ||
| nsNode, found := datasourceNode.Find("namespace") | ||
| for _, inputNode := range inputsNodeList.value { | ||
| nsNode, found := inputNode.Find("dataset.namespace") |
There was a problem hiding this comment.
Will Find("dataset.namespace") handle the fact that dataset could be a dictionary in the configuration:
dataset:
namespace: default
name: other
There was a problem hiding this comment.
no in fact it will not, i added support for both just to be sure
| vars: | ||
| var: value | ||
| - type: apache/metrics | ||
| dataset.namespace: testing |
There was a problem hiding this comment.
Probably good to add one of these tests files to use:
dataset:
namespace: testing
There was a problem hiding this comment.
do you mean with invalid key?
keys we dont know are passed to input by default
There was a problem hiding this comment.
No I mean add a test to ensure that dataset.namespace: testing or
dataset:
namespace: testing
Both work
| addFieldsMap := &Dict{value: []Node{&Key{"add_fields", processorMap}}} | ||
| processorsList.value = mergeStrategy(r.OnConflict).InjectItem(processorsList.value, addFieldsMap) | ||
|
|
||
| // add this for backwards compatibility remove later |
There was a problem hiding this comment.
Just a general question: When is the remove later?
There was a problem hiding this comment.
up to stack when they remove support for this
There was a problem hiding this comment.
later is now :-) this was only a short transition where we needed it.
|
NOTE: do not merge until @ruflin gives a green light |
| - namespace: default | ||
| inputs: | ||
| - type: system/metrics | ||
| dataset.namespace: default |
There was a problem hiding this comment.
Do you already have support for dataset.type? I don't think we need it in this PR but curious if you added it?
There was a problem hiding this comment.
yep dataset.type is supported
| paths: | ||
| - /var/log/hello1.log | ||
| - /var/log/hello2.log | ||
| dataset: generic |
There was a problem hiding this comment.
Shouldn't this become dataset.name instead of removing it?
There was a problem hiding this comment.
yes this became dataset.name thing is we injected it previously which i think is incorrect as we're providing processor to enrich event. if you think this information is helpful in a final beat config i will add it back but for now i filtered it out
There was a problem hiding this comment.
Even if the Beat does not understand it today, I think in the future the Beat should so having it there already would be helpful. Can happen in a later PR.
| type: testtype | ||
| name: generic | ||
| namespace: default | ||
| - add_fields: |
There was a problem hiding this comment.
Not related to this PR but can you follow up to make sure we clean up the stream fields?
| id: apache-metrics-id | ||
| streams: | ||
| - metricset: status | ||
| dataset: |
There was a problem hiding this comment.
I assume dataset.name and
dataset:
name: foo
work?
There was a problem hiding this comment.
yeah it was a bit tricky as transpiler understands dataset.name as a single key but i made both versions work
| var: value | ||
| - type: logs | ||
| dataset: | ||
| type: testtype |
| if !ok { | ||
| continue | ||
| dsNode, found := inputNode.Find("dataset") | ||
| if found { |
There was a problem hiding this comment.
This looks pretty scary! Would be nice if ew can find a way to simplify this.
| addFieldsMap := &Dict{value: []Node{&Key{"add_fields", processorMap}}} | ||
| processorsList.value = mergeStrategy(r.OnConflict).InjectItem(processorsList.value, addFieldsMap) | ||
|
|
||
| // add this for backwards compatibility remove later |
There was a problem hiding this comment.
later is now :-) this was only a short transition where we needed it.
| func datasetNamespaceFromInputNode(inputNode Node) string { | ||
| const defaultNamespace = "default" | ||
|
|
||
| if namespaceNode, found := inputNode.Find("dataset.namespace"); found { |
There was a problem hiding this comment.
Looks like we have very similar code in several places. Two things I'm wondering: Could go-ucfg to this for you and if not, could we extract it into a method?
|
Tried to test it together with elastic/kibana#69226 but didn't work yet. Not sure if the problem is in KB, Agent or a general issue. Overall changes LGTM. |
|
tested and setting dataset.type to |
|
Makes sense as |
|
Tested with latest kibana changes ok |
* phase 1 * phase 2 * phase 4 * updated configuration * fixed compact form (depends on aprser) * configuration update * fixed tests * mod
* phase 1 * phase 2 * phase 4 * updated configuration * fixed compact form (depends on aprser) * configuration update * fixed tests * mod
What does this PR do?
This PR implements all 4 phases of configuration change described here #19082
Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.