-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Ingest Manager] Align namespace validation rules #75846
Comments
Pinging @elastic/ingest-management (Feature:Fleet) |
Pinging @elastic/ingest-management (Team:Ingest Management) |
Consolidating discussion from https://github.com/elastic/kibana/pull/75381/files#r476228944: I think the validation is incorrect,
This mean, type + dataset + namespace <= 255 bytes. Originally posted by @ph in #75381 (comment) what we do in agent is that we put 255 constraint on dataset, namespace and a product of concatenation, so eventaully we will fail when index > 255. Originally posted by @michalpristas in #75381 (comment) |
Namespace is the last part of our indexing strategy. These ES rules only apply to the complete index name. A namespace of
The 255 total index name size in bytes is the reason why I left out that original constraint in Kibana, as we have no way of knowing the size of the other parts of the indexing strategy at the time user enters the namespace. Also, length of string != number of bytes (English alphabet characters are one byte, but Chinese characters are multibyte). Because of these reasons, I don't think we can enforce a rule for namespace that is guaranteed to work across all cases. We can set up a business rule that will work for most cases, such as limiting namespace to 50 characters length maximum in UI and Agent. I doubt many users will reach the index name limit through natural use anyway (I think even 50 characters is more than enough), but enforcing a strict limit will provide some safety. What do you think of this rule? |
Thanks @jen-huang for moving it -- Good points, I think we should come up with a limit for every data_stream field, we have a spec, we can enforce that. data_stream.type is a limited set (traces, logs, metrics, synthetics) 10 is max (20 bytes) The above limits seems goods, assuming that most of theses will be ascii values, maybe namespace could have multibytes chars. cc @ruflin WDYT? |
Changed the maths above.. |
20 bytes for the prefix should definitively be enough. For the other two I'm torn. I can see potential uses cases where dataset can become long, others where the namespace is long. To keep things simple and have a buffer, what about having a limit of 100 for dataset and namespace. This would max out at 222 bytes in the worst case (we have 2 BTW: I think I fail at your math: |
i like the proposal with limits per segment. |
Just to clarify, the 20/175/50 limits are bytes, not characters? |
Yes, bytes. My preference is still on 20/100/100 ;-) |
Hi @michalpristas, I opened #78522 to implement 100 bytes limit on namespace following @ruflin's 20/100/100 proposal. I don't think merging this PR necessarily has to be synced with a corresponding agent PR, so this is just an FYI. |
no it does not, thanks for the ping |
@jen-huang any plans on putting on restrictions on type and dataset ? |
agent pr: elastic/beats#21406 |
@michalpristas |
++ on validating these already in the package-spec. @ycombinator WDYT? |
Agreed. Just make a new issue in the |
I quickly filed elastic/package-spec#57 Would be good to fill in more details. |
With namespace validation introduced here https://github.com/elastic/kibana/pull/75381/files
validation rules are not aligned between kibana and agent (https://github.com/elastic/beats/blob/f06bcc5d401d7b6fc833bc0e516064ace0a68d45/x-pack/elastic-agent/pkg/agent/application/filters/stream_checker.go#L173)
What is missing is
.
but is not allowed to be equal to.
or..
-
,_
or+
we should either add it to fleet validation or remove them from agent.
I took the rules from here: https://github.com/elastic/elasticsearch/blob/master/docs/reference/indices/create-index.asciidoc
cc @jen-huang
The text was updated successfully, but these errors were encountered: