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

[Fleet] Generate time_series_metric when metric_type is set #148666

Merged
merged 2 commits into from
Jan 11, 2023

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented Jan 10, 2023

Summary

Resolve #148057

Generate time_series_metric for every field when metric_type is set.
The previous implementation was only doing it for scaled float.

That PR also remove metric_type from meta as the original issue mentioned to keep only meta.unit #115621

@nchaulet nchaulet self-assigned this Jan 10, 2023
@nchaulet nchaulet added bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.7.0 labels Jan 10, 2023
@nchaulet nchaulet marked this pull request as ready for review January 10, 2023 20:11
@nchaulet nchaulet requested a review from a team as a code owner January 10, 2023 20:11
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@nchaulet nchaulet requested a review from juliaElastic January 10, 2023 20:15
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @nchaulet

Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

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

Thanks for fixing 🚀

@nchaulet nchaulet merged commit c29f619 into elastic:main Jan 11, 2023
@nchaulet nchaulet deleted the fix-mapping-metric-type branch January 11, 2023 12:00
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jan 11, 2023
@ruflin
Copy link
Contributor

ruflin commented Jan 11, 2023

The new implementation does not do any validation if the field supports metric_type. This might have the advantage, that if more field types are added in the future, no code changes are needed. As this code is used by packages, it should be ensured that elastic-package does the validation.

@nchaulet
Copy link
Member Author

The new implementation does not do any validation if the field supports metric_type. This might have the advantage, that if more field types are added in the future, no code changes are needed. As this code is used by packages, it should be ensured that elastic-package does the validation.

@ruflin it will be great if elastic-package validate this and it will probably improve a lot the developper experience, but worse case scenario currently the package installation will fail, and the package developper will still have some feedback something is not correct

For example adding metric_type on a keyword field
Screen Shot 2023-01-11 at 8 39 53 AM

@ruflin
Copy link
Contributor

ruflin commented Jan 11, 2023

@nchaulet Looks good. Can you follow up on the spec validation?

@nchaulet
Copy link
Member Author

@ruflin @kpollich Looks like that change break some dashboard the elastic_agent one for example (system too) some aggregation seems to not work anymore we get the following error for fields defining metric type

Screen Shot 2023-01-11 at 2 16 12 PM

Should we generate time_series_metric only if the datastream enabled index mode timeserie?

@kpollich
Copy link
Member

Should we generate time_series_metric only if the datastream enabled index mode timeserie?

Yes this seems like a safe bet - better to not assume any and all fields will have time series indexing enabled at some point in the future.

@ruflin
Copy link
Contributor

ruflin commented Jan 12, 2023

Should we generate time_series_metric only if the datastream enabled index mode timeserie?

Yes! Otherwise it is tricky to test the feature. I expect many packages will add the field but still have time series off but turn it on first for testing.

jennypavlova pushed a commit to jennypavlova/kibana that referenced this pull request Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

metric_type does not work for all the expected fields
7 participants