[Elastic Agent] Add docker composable dynamic provider.#20842
[Elastic Agent] Add docker composable dynamic provider.#20842blakerouse merged 4 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/ingest-management (Team:Ingest Management) |
ruflin
left a comment
There was a problem hiding this comment.
Nice. How similar is this code from our Beats autodiscovery code?
I really like that this allows us to start playing around with it.
|
|
||
| if err := watcher.Start(); err != nil { | ||
| // warn only; return nil (do nothing) | ||
| c.logger.Warnf("Failed starting docker provider: %s", err) |
There was a problem hiding this comment.
On the Beats code based we tried no to use Warn as it is this strange middleground between info and error. Is user interaction needed or not? Is it a bug or not? I would suggest to move this to the Info level and phrase it more something like: Docker provider not started as docker not available (if we can make this distinction).
This is very, very similar. Because the docker code was so well encapsulated in
|
|
cc @exekias You might want to watch this :) |
|
Nice job! Maybe this means we don't really need to refactor current providers #19271? I see it's possible to pass the config for the provider, how would that look in the YAML? |
|
@exekias I think creating the new providers in Agent will be the most amount of work, but if most of the watcher logic is in For configuring it looks like: |
| } | ||
|
|
||
| // Run runs the environment context provider. | ||
| func (c *dynamicProvider) Run(comm composable.DynamicProviderComm) error { |
There was a problem hiding this comment.
Nit: I would call it Start instead of Run as it is non blocking, but we change that later.
There was a problem hiding this comment.
Its not called Start because there is no Stop. It is stopped only by the cancelling of the passed context. It is up to the provider on how it wants to implement. Example is the local_dynamic provider it just reads the config and returns, as it does need a goroutine to always be running.
| "id": container.ID, | ||
| "name": container.Name, | ||
| "image": container.Image, | ||
| "labels": processorLabelMap, |
There was a problem hiding this comment.
We should revisit later on what the default info is that we ship, if we potentially should reduce it.
There was a problem hiding this comment.
@blakerouse Could you follow up with an issue? I'm pretty sure we will forget otherwise :-D
* Add docker provider. * Add changelog. * Update docker start message to info. (cherry picked from commit f017e24)
…ne-2.0 * upstream/master: (44 commits) Update users.asciidoc (elastic#20802) (elastic#21108) Fix docker provider builder. (elastic#21118) [Elastic Agent] Add docker composable dynamic provider. (elastic#20842) Add new modules/filesets from rsa2elk for 7.10 (elastic#20820) Fix broken links to external websites (elastic#21061) [docs] typo in the command line (elastic#20799) [Filebeat] add panos type and sub_type (elastic#20912) Move the `compute_vm_scalset` to a light metricset and map the cloud metadata (elastic#21038) [Filebeat] Add support for Cloudtrail digest files (elastic#21086) Add metrics collection from cost explorer into aws/billing metricset (elastic#20527) Add vendoring to Google Cloud Functions again (elastic#21070) [Elastic Agent] Add fleet.host.id for sending to endpoint. (elastic#21042) Do not need Google credentials before using it (elastic#21072) [Filebeat][New Module] Zoom webhook module (elastic#20414) Add support for GMT timezone offset in decode_cef (elastic#20993) Filebeat: Fix random error on harvester close (elastic#21048) Add ingress controller dashboards (elastic#21052) Fix loggers in composable module. (elastic#21047) [Ingest Manager] Increase kibana client timeout to 5 minutes (elastic#21037) Add changelog. (elastic#21041) ...
What does this PR do?
Adds a
dockercomposable dynamic provider.Why is it important?
Support generating inputs from discovered docker containers.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration filesCHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.How to test this PR locally
Using the following configuration results in the
inputsresults in a new input per container.Related issues