Skip to content
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

Script to generate breaking field changes list #10405

Merged
merged 2 commits into from
Feb 6, 2019

Conversation

ruflin
Copy link
Member

@ruflin ruflin commented Jan 29, 2019

This script generates a list with breaking field changes based on ecs-migration.yml. For each Beat it can generate the list containing libbeat fields + the fields from the Beat itself. For now it's included in the Breaking changes for 7.0 and one table exists for each Beat. Few questions:

  • Should we have this in libbeat or as part of each Beat breaking changes?
  • How will this conflict with the breaking changes listed in auditbeat?
  • Should we add more details on how the fields changed like in some cases there is a scaling factor or the content changed. Most of this info is already in ecs-migration.yml
  • Who do we do about the changes where we changed the type. It's not yet in the ecs-migration.yml files.

An example output looks as following:

In version 7.0 the following fields were renamed.

.Renamed Fields in 7.0
[frame="topbot",options="header"]
|======================
|Old Field|New Field
|`apache2.access.body_sent.bytes`            |`http.response.body.bytes`
|`beat.hostname`            |`agent.hostname`
|`beat.name`            |`host.name`
|`beat.timezone`            |`event.timezone`
|`beat.version`            |`agent.version`
|`docker.container.id`            |`container.id`
|`docker.container.image`            |`container.image.name`
|`docker.container.labels`            |`container.labels`
|`docker.container.name`            |`container.name`
|`elasticsearch.slowlog.took_millis`            |`event.duration`
|`haproxy.http.request.time_active_ms`            |`event.duration`
|`haproxy.total_waiting_time_ms`            |`event.duration`
|`iis.access.body_received.bytes`            |`http.request.body.bytes`
|`iis.access.body_sent.bytes`            |`http.response.body.bytes`
|`iis.access.request_time_ms`            |`event.duration`
|`meta.cloud.availability_zone`            |`cloud.availability_zone`
|`meta.cloud.instance_id`            |`cloud.instance.id`
|`meta.cloud.instance_name`            |`cloud.instance.name`
|`meta.cloud.machine_type`            |`cloud.machine.type`
|`meta.cloud.project_id`            |`cloud.project.id`
|`meta.cloud.provider`            |`cloud.provider`
|`meta.cloud.region`            |`cloud.region`
|`mysql.slowlog.query_time.sec`            |`event.duration`
|`nginx.access.body_sent.bytes`            |`http.response.body.bytes`
|`postgresql.log.duration`            |`event.duration`
|`process.exe`            |`process.executable`
|`traefik.access.body_sent.bytes`            |`http.response.body.bytes`
|`traefik.access.duration`            |`event.duration`
|======================

@ruflin ruflin added docs in progress Pull request is currently in progress. libbeat ecs labels Jan 29, 2019
@ruflin
Copy link
Member Author

ruflin commented Jan 29, 2019

@dedemorton Where should we place these fields? I assume either inside breaking changes or linked from there?

@andrewkroh I saw in your breaking changes you also listed the type changes. I wonder if we should now add the type changes we did also to ecs-migration.yml file to also generate this or if it would be overkill.

@ruflin ruflin mentioned this pull request Jan 29, 2019
@dedemorton
Copy link
Contributor

Where should we place these fields? I assume either inside breaking changes or linked from there?

@ruflin I would definitely put the list under breaking changes. Right now, we have all the BC content for each release in a single html topic. If we change this (break the topic down into multiple topics in the published docs), we will need to modify the book structure to accommodate another level of nesting in the TOC (this is a more complicated change than you'd expect it to be).

For now, it might be easier to generate a file and include it where relevant. If necessary, we can break the existing source file into multiple files to make it easier to automate adding the content.

If you generate a file with the following heading and add an include to the existing BC file in the right place, you'll get a heading at the same level as the other headings, and all the BC content will be in a single topic.

[[breaking-changes-fields]]
==== Field name changes

@ruflin ruflin added the v7.0.0 label Feb 4, 2019
@ruflin ruflin requested a review from a team as a code owner February 5, 2019 08:30
@ruflin ruflin changed the title [WIP] Script to generate breaking field changes list Script to generate breaking field changes list Feb 5, 2019
@ruflin
Copy link
Member Author

ruflin commented Feb 5, 2019

I updated the PR to generate a table for each Beat. @andrewkroh At the moment this also contains the fields which you already have put into the Breaking Change doc for auditbeat.

My suggestion for now is to move forward with this and get it into master. We should adjust it as soon as we start tackling the breaking changes docs because there is more needed then just these fields.

@ruflin ruflin added review Team:Integrations Label for the Integrations team and removed in progress Pull request is currently in progress. labels Feb 5, 2019
@ruflin ruflin self-assigned this Feb 5, 2019
@ruflin ruflin mentioned this pull request Feb 5, 2019
9 tasks
Copy link
Contributor

@adriansr adriansr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This script generates a list with breaking field changes based on ecs-migration.yml. For each Beat it can generate the list containing libbeat fields + the fields from the Beat itself. For now it's included in the Breaking changes for 7.0 and one table exists for each Beat. Few questions:

* Should we have this in libbeat or as part of each Beat breaking changes?
* How will this conflict with the breaking changes listed in auditbeat?
* Should we add more details on how the fields changed like in some cases there is a scaling factor or the content changed. Most of this info is already in ecs-migration.yml
* Who do we do about the changes where we changed the type. It's not yet in the ecs-migration.yml files.

An example output looks as following:

```
In version 7.0 the following fields were renamed.

.Renamed Fields in 7.0
[frame="topbot",options="header"]
|======================
|Old Field|New Field
|`apache2.access.body_sent.bytes`            |`http.response.body.bytes`
|`beat.hostname`            |`agent.hostname`
|`beat.name`            |`host.name`
|`beat.timezone`            |`event.timezone`
|`beat.version`            |`agent.version`
|`docker.container.id`            |`container.id`
|`docker.container.image`            |`container.image.name`
|`docker.container.labels`            |`container.labels`
|`docker.container.name`            |`container.name`
|`elasticsearch.slowlog.took_millis`            |`event.duration`
|`haproxy.http.request.time_active_ms`            |`event.duration`
|`haproxy.total_waiting_time_ms`            |`event.duration`
|`iis.access.body_received.bytes`            |`http.request.body.bytes`
|`iis.access.body_sent.bytes`            |`http.response.body.bytes`
|`iis.access.request_time_ms`            |`event.duration`
|`meta.cloud.availability_zone`            |`cloud.availability_zone`
|`meta.cloud.instance_id`            |`cloud.instance.id`
|`meta.cloud.instance_name`            |`cloud.instance.name`
|`meta.cloud.machine_type`            |`cloud.machine.type`
|`meta.cloud.project_id`            |`cloud.project.id`
|`meta.cloud.provider`            |`cloud.provider`
|`meta.cloud.region`            |`cloud.region`
|`mysql.slowlog.query_time.sec`            |`event.duration`
|`nginx.access.body_sent.bytes`            |`http.response.body.bytes`
|`postgresql.log.duration`            |`event.duration`
|`process.exe`            |`process.executable`
|`traefik.access.body_sent.bytes`            |`http.response.body.bytes`
|`traefik.access.duration`            |`event.duration`
|======================
```

add breaking changes list

add fields
Run the script again:

```
python renamed_fields.py > ../libbeat/docs/field-name-changes.asciidoc
```
@ruflin
Copy link
Member Author

ruflin commented Feb 6, 2019

I rebased again on master and run the script again to get last minute changes in.

@ruflin ruflin merged commit 0134aca into elastic:master Feb 6, 2019
@ruflin
Copy link
Member Author

ruflin commented Feb 6, 2019

Merged for now to at least have a list of the breaking fields in. The command to rerun the script is:

python renamed_fields.py > ../libbeat/docs/field-name-changes.asciidoc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants