-
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
docker autodiscover not ECS ready #10757
Comments
Leaving comments on the investigation in case someone picks up later: The data seems to come form these two lines: https://github.com/elastic/beats/blob/master/libbeat/autodiscover/providers/docker/docker.go#L153 and https://github.com/elastic/beats/blob/master/libbeat/autodiscover/providers/docker/docker.go#L170 It's not clear to me yet how this data makes it into the events themself. |
The The structure in autodiscovery for the It means these have to be changed from @exekias @jsoriano As the enrichment of the autodiscovery events does not use the same code base as the add_host_metadata processor we should find a way to make sure the file structure and fields we provide with the two stay in sync. |
I put up a first WIP PR with a potential fix but still some things need clarification to make sure it doesn't break anything else: #10758 |
I have been talking with @kaiyan-sheng about this, for the record I am transcribing here some of the things we talked: Autodiscover metadata is only used internally for the communication between autodiscover providers and the autodiscover framework, and to resolve the conditions and templates of autodiscover configuration. This data is collected by autodiscover providers and [afaik] in principle it is not used in events sent to the outputs. Kaiyan also mentioned that she saw that changing the autodiscover metadata didn't change the fields in events, what would confirm that. Migrating this metadata to ECS-like fields would have its benefits: fields available would match fields stored following ECS, and some configurations could be the same with docker and kubernetes autodiscover. But I think it is important to remember that this metadata doesn't affect the stored events. I also think it'd be important here to keep backwards compatibility even in 7.X. We cannot use aliases or other things we have used for ECS migration, but I think it can be easily done here by just duplicating the info sent in autodiscover events. This would prevent lots of headaches in upgrades, it is already a bit tricky to debug some problems with autodiscover. Other things to take into account:
|
@roncohen Is it too late to migrate docker and kubernetes module to ECS since we are already in feature freeze? |
thanks @jsoriano. I think there might be some confusion around what the ECS migration entails and what the current state of things are. current state: Here's the version i used:
Here's a screenshot showing the non-ECS fields being written: required state: There's an opt-in option to create backwards compatible aliases. That would be an alias pointing from I don't think it's particularly important to change the meta data used internally for the communication between autodiscover providers and the autodiscover framework, but it's very important to change the resulting events to be ECS compatible, so we need to prioritize that. Not supporting ECS is a bug for 7.0 so we can change it after feature freeze. Let me know if there's something i misunderstood. |
thanks @kaiyan-sheng. There's also this one which may be useful: #10758 |
Fields injected by docker autodiscover provider were being placed in alias fields introduced for ECS, change them to the new location and add selectors accordingly. This PR includes #10862 and #10758 As a summary: * Autodiscover selectors using ECS structure are added to autodiscover events, old selectors are kept for backwards compatibility * Autodiscover generated metadata follows ECS * Dedotting of labels is added, enabled by default, will be backported for 6.7, but disabled `docker.containers.labels` is not migrated, as it wasn't for `add_docker_metadata` (see #9412) Fixes #10757 Co-Authored-By: kaiyan-sheng <kaiyan.sheng@elastic.co> Co-Authored-By: Nicolas Ruflin <spam@ruflin.com>
Fields injected by docker autodiscover provider were being placed in alias fields introduced for ECS, change them to the new location and add selectors accordingly. This PR includes elastic#10862 and elastic#10758 As a summary: * Autodiscover selectors using ECS structure are added to autodiscover events, old selectors are kept for backwards compatibility * Autodiscover generated metadata follows ECS * Dedotting of labels is added, enabled by default, will be backported for 6.7, but disabled `docker.containers.labels` is not migrated, as it wasn't for `add_docker_metadata` (see elastic#9412) Fixes elastic#10757 Co-Authored-By: kaiyan-sheng <kaiyan.sheng@elastic.co> Co-Authored-By: Nicolas Ruflin <spam@ruflin.com> (cherry picked from commit 1bf8087)
Fields injected by docker autodiscover provider were being placed in alias fields introduced for ECS, change them to the new location and add selectors accordingly. This PR includes #10862 and #10758 As a summary: * Autodiscover selectors using ECS structure are added to autodiscover events, old selectors are kept for backwards compatibility * Autodiscover generated metadata follows ECS * Dedotting of labels is added, enabled by default, will be backported for 6.7, but disabled `docker.containers.labels` is not migrated, as it wasn't for `add_docker_metadata` (see #9412) Fixes #10757 (cherry picked from commit 1bf8087) Co-Authored-By: kaiyan-sheng <kaiyan.sheng@elastic.co> Co-Authored-By: Nicolas Ruflin <spam@ruflin.com>
With the creation of aliases for ECS we have found that some features weren't being migrated and were writing to aliases (like in #10757). Consider writing to an alias field an error.
since we moved docker fields from
docker.container.*
tocontainer.*
as part of ECS, we need to update docker autodiscover to use the new fields.The text was updated successfully, but these errors were encountered: