-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
Description
Component(s)
pkg/ottl
Is your feature request related to a problem? Please describe.
OTTL currently validates that a context "consumes" all segments in a path, but does not validate that all a path's keys are used. This means users can do something like name["foo"] in the span context and get back the name of the span, completely ignoring the foo key. In this scenario the context is allowing parsing to succeed when it shouldnt. To simplify this process for all the different contexts, we can build something into OTTL, similar to Path validation, but for Keys.
Things to consider:
- Should we validate just the first key? - [pkg/ottl] Don't check that all keys are used #30047 (comment)
- How will key validation interact with dynamic indexing? If we don't know the value of the key until hot path execution, how should we validate that all keys are being considered?
- Should we have a way for contexts to declare that they've reached a point where the map is arbitrarily deep? So a context exposing a path of underlying type
map[string]stringwould not declare this sincestringMap["key"]["nestedKey"]would be invalid. But a context would declare this for an attributes path since the type ismap[string]anyandattributes["key1"]["key2"][...]is valid. - Originally from [pkg/ottl] Don't check that all keys are used #30047 (comment)