-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Events producer #954
Events producer #954
Conversation
I was thinking about 2 approaches in the meeting today. @renukamanavalan @bandaru-viswanath, @dgsudharsan @praveen-li we can discuss the pros and cons in the next meeting. 1) Introduce event specific container and reference to the list used for the config-DB table.
} 2) Enhance the container e.g PORT defined already for the config-DB schema to include state information e.g port_state_info as well. grouping port_state_info {
|
Thanks Venkat!
The following are the reasons behind.
|
@venkatmahalingam, can we conclude on this discussion above? |
A gNMI client could subscribe for events with optional filter on event source in streaming mode. Below shows the command & o/p for subscribing all, and receiving BGP events. gnmic --target events --path "/events/" --mode STREAM --stream-mode ON_CHANGE The instance data would indicate YANG module path & revision that is required for validation. o/p Instead of doing the above generic events subscription, if we can follow either approach 1 or 2, it will be cleaner to subscribe particular table state information, right? in the future, we can enhance the subscription for config changes as well. I agree that if it's just an event, we dont need to store it in the DB, we can use another event YANG but what we use is the state information (i.e interface admin/oper status, BGP session status..etc), also, we should support get operation as well on the state information, right? |
Hence gNMI client can only subscribe for /events which is all. The "state" is not the only event reported on an i/f, e.g. PFC-Storm. With the absolute path provided as leafref, helps consumer identify object where needed. |
I understand that state is not the only event being reported, I think, we can report non-state information (absolutely doesnt make sense to have it in DB) in event YANG model. What's the design to handle both the cases 1) interface oper. status changes (stored in the STATE_DB) 2) PFC storm (not in DB)? For the first case, enhance the existing YANG to have state information as well and for the second case, introduce new event specific YANGs and leafref to existing tables if applicable. @renukamanavalan @bandaru-viswanath, @dgsudharsan any concerns on the above design? |
We persist neither in DB. |
Looks good to me @venkatmahalingam |
Added sample gnmi commands
@renukamanavalan can you please add the code PRs by referring to #806? Thanks |
SONiC to stream events occurring in SONiC switch (e.g BGP flap, process not running, ...) in real time via gNMI subscription model.
The events are defined using versioned YANG schema.
For more details, please refer the doc.