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

Field formats specified in package not being applied in data view #2886

Closed
ebeahan opened this issue Mar 23, 2022 · 7 comments
Closed

Field formats specified in package not being applied in data view #2886

ebeahan opened this issue Mar 23, 2022 · 7 comments
Labels
bug Something isn't working, use only for issues Integration:system System Stalled Team:Fleet Label for the Fleet team [elastic/fleet]

Comments

@ebeahan
Copy link
Member

ebeahan commented Mar 23, 2022

Kibana version:

8.1.1

Describe the bug:

Data views created by Fleet at package install do not apply the format option, if format is included on a field definition in the package config.

Example: the system package defines the field system.memory.total:

https://github.com/elastic/package-storage/blob/production/packages/system/1.6.4/data_stream/memory/fields/fields.yml#L6

The field includes format: bytes, but the data view created in Kibana is not setting the Bytes format.

Screen Shot 2022-03-23 at 4 33 02 PM

Expected behavior:

The format specified in the package's field definitions would be applied in the Kibana data view:

Screen Shot 2022-03-23 at 4 35 35 PM

Any additional context:

Many ECS and non-ECS fields index as an Elasticsearch numeric type. However, when viewed in Kibana are better displayed as a String or a Byte value.

Examples:

  • Process IDs (pids) and TCP/UDP port numbers. These values should display as 12345 not 12,345
  • Some metric values, like memory totals and usage, can use the Bytes format: 5GB vs. 5,123,456,789

The Beats docs also discuss the format field: https://github.com/elastic/beats/blob/main/docs/devguide/newdashboards.asciidoc#generate-index-pattern

@ebeahan ebeahan added bug Something isn't working, use only for issues Team:Fleet Label for the Fleet team [elastic/fleet] labels Mar 23, 2022
@elasticmachine
Copy link

Pinging @elastic/fleet (Team:Fleet)

@jen-huang
Copy link
Contributor

From elastic/kibana#119527, Fleet no longer declares a list of fields on Kibana data views, therefore we do not prescriptively apply a format to package fields:

However, as of 7.12, index patterns generate their fields dynamically at runtime, ignoring the fields key on the saved object, meaning these dashboard errors are visible. This has allowed me to remove all field generation code and move the index pattern creation to before the package is installed.

I believe the Beats documentation is old and does not take into account the above changes to how Kibana handles index pattern/data view fields now. Actually, the package spec does not even support format property for field definitions: https://github.com/elastic/package-spec/blob/02e9a7fd88fec29302517e89d49879da2f6a3050/versions/1/data_stream/fields/fields.spec.yml

In this case system.memory.total field type could just be changed to bytes and Kibana will apply the default bytes formatting.

For fields that declared as integer or long type, Kibana automatically applies numeric formatting.

I will move this to integrations repo for further discussion about cleaning up system field definitions (and maybe other packages too?).

@jen-huang jen-huang transferred this issue from elastic/kibana Mar 24, 2022
@jen-huang jen-huang added Team:Integrations Label for the Integrations team Integration:system System and removed Team:Fleet Label for the Fleet team [elastic/fleet] labels Mar 24, 2022
@elasticmachine
Copy link

Pinging @elastic/integrations (Team:Integrations)

@ebeahan
Copy link
Member Author

ebeahan commented Mar 24, 2022

Thanks for the background, @jen-huang.

Some fields use a numeric type but look unconventional with the Kibana default numeric formatting, like PIDs or port numbers. Users are likely to note the change after migrating from Beats to Agent. Migrating existing fields using the 64-bit long to an 8-bit byte type isn't likely an easy option.

The past solution was to set the format, which would override the index pattern/data view field format. If that's no longer feasible because of the referenced Fleet change, integrations should still have some sort of mechanism to override a field's format.

Related, I did open a separate issue proposing to add format to the spec: elastic/package-spec#302.

@andrewkroh
Copy link
Member

I will move this to integrations repo for further discussion about cleaning up system field definitions (and maybe other packages too?).

Doing this cleanup would be great. Currently there is no strict validation of the keys used "fields.yml" files. I think this stems from an incomplete definition of the keys in the spec. I noted this in elastic/package-spec#271 (comment).

@jen-huang Perhaps we could get some help from your team telling us what fields are actually honored by Fleet and I can update the spec to reflect this. Then we can turn on strict validation and remove invalid keys from packages.

@botelastic
Copy link

botelastic bot commented Mar 28, 2023

Hi! We just realized that we haven't looked into this issue in a while. We're sorry! We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1. Thank you for your contribution!

@botelastic botelastic bot added the Stalled label Mar 28, 2023
@jen-huang jen-huang added Team:Fleet Label for the Fleet team [elastic/fleet] and removed Team:Integrations Label for the Integrations team labels Mar 29, 2023
@botelastic botelastic bot removed the Stalled label Mar 29, 2023
@botelastic
Copy link

botelastic bot commented Mar 28, 2024

Hi! We just realized that we haven't looked into this issue in a while. We're sorry! We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1. Thank you for your contribution!

@botelastic botelastic bot added the Stalled label Mar 28, 2024
@botelastic botelastic bot closed this as completed Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working, use only for issues Integration:system System Stalled Team:Fleet Label for the Fleet team [elastic/fleet]
Projects
None yet
Development

No branches or pull requests

4 participants