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

Filter/Select by non-key values #130

Open
wisotzky opened this issue Dec 4, 2020 · 5 comments
Open

Filter/Select by non-key values #130

wisotzky opened this issue Dec 4, 2020 · 5 comments

Comments

@wisotzky
Copy link

wisotzky commented Dec 4, 2020

Based on latest path spec, following search options are possible:

/interfaces/interface/state/counters
/interfaces/interface[name=*]/state/counters

To select only specific interfaces, one could provide a specific key value:

/interfaces/interface[name=Ethernet1/2/3]/state/counters

However, there are use-cases for gNMI clients to narrow down the search on objects that have certain properties (non-key). For example one would like stream counters of interfaces that are administrative/operational up:

/interfaces/interface/state[admin-status=UP]/counters

Is there any plan to extend the gNMI PATH SPEC to allow selecting paths based on non-keys like this?

@wisotzky
Copy link
Author

wisotzky commented Dec 4, 2020

Rational:
While the gNMI streaming telemetry client could read the current config/state to determine the list of objects and finally subscribe just the determined objects, such solution comes with quite some overhead and increases the number of paths subscribed, which may become a scaling factor of the vendors gNMI server implementation. Also there is the challenge, that the list of objects that match the selection criteria and so the subscription may need to change as well.
Alternatively one could simply subscribe the entire table and apply client-side filtering aka squelching updates that are out of interest. However, this may come with quite some processing and transport overhead for both server and client.

@aashaikh
Copy link
Contributor

aashaikh commented Dec 4, 2020

There is no plan currently to add these sorts of queries to the gNMI spec -- we've generally tried to bias toward keeping the query language simple since adding features adds more complexity to the device implementation. As you mentioned, this sort of filtering is better done on the client side IMO, where there is likely to be more computational resource and flexibility. Agree there is a trade-off with potentially sending telemetry data that is ultimately not wanted.

@wisotzky
Copy link
Author

wisotzky commented Dec 4, 2020

Thanks @aashaikh,

Actually the advantage of my proposal would be, that the 'gNMI language' would not need to be changed at all. It would just relax the requirement that instead of list-keys other attributes can be used to select objects to be monitored. To me at least this would be the much cleaner approach to avoid updating subscriptions.

@wisotzky
Copy link
Author

wisotzky commented Dec 4, 2020

Maybe worth asking, @aashaikh

Is it really required that filter by key/value pairs is limited to list-keys only? At least in the latest PATH spec I did not found this explicitly mentioned. However, all the examples that are provided in both the gNMI spec and the PATH spec are using list-keys only.

Thx

@gcsl
Copy link
Contributor

gcsl commented Dec 4, 2020 via email

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

No branches or pull requests

3 participants