Skip to content

Introduce "egress-enabled" for sflow per-interface config - #1593

Open
travisc-arista wants to merge 10 commits into
openconfig:masterfrom
travisc-arista:sflow-egress
Open

travisc-arista wants to merge 10 commits into
openconfig:masterfrom
travisc-arista:sflow-egress

Conversation

@travisc-arista

Copy link
Copy Markdown

Change Scope

  • Introduce a new field "egress-enabled" under grouping sflow-interfaces-config and be alongside the original "enabled" leaf. This new field will appear both in the config and state. Also updated the documentation for the original "enabled" leaf in sflow-interfaces-config to clarify it is only enabling ingress sampling.
  • This change is backwards compatible.

Note: This is a revision of #1569. We have decided to discard the old PR and create this new PR.

Platform Implementations

Tree View

 module: openconfig-sampling-sflow
 
   augment /oc-sampling:sampling:
     +--rw sflow
        +--rw config
        |  +--rw enabled?                 boolean
        |  +--rw agent-id-ipv4?           oc-inet:ipv4-address
        |  +--rw agent-id-ipv6?           oc-inet:ipv6-address
        |  +--rw dscp?                    oc-inet:dscp
        |  +--rw sample-size?             uint16
        |  +--rw polling-interval?        uint16
        |  +--rw ingress-sampling-rate?   uint32
        |  +--rw egress-sampling-rate?    uint32
        +--ro state
        |  +--ro enabled?                 boolean
        |  +--ro agent-id-ipv4?           oc-inet:ipv4-address
        |  +--ro agent-id-ipv6?           oc-inet:ipv6-address
        |  +--ro dscp?                    oc-inet:dscp
        |  +--ro sample-size?             uint16
        |  +--ro polling-interval?        uint16
        |  +--ro ingress-sampling-rate?   uint32
        |  +--ro egress-sampling-rate?    uint32
        +--rw collectors
        |  +--rw collector* [address port]
        |     +--rw address    -> ../config/address
        |     +--rw port       -> ../config/port
        |     +--rw config
        |     |  +--rw address?             oc-inet:ip-address
        |     |  +--rw port?                oc-inet:port-number
        |     |  +--rw source-address?      oc-inet:ip-address
        |     |  +--rw max-datagram-size?   uint16
        |     |  +--rw network-instance?    oc-netinst:network-instance-ref
        |     +--ro state
        |        +--ro address?             oc-inet:ip-address
        |        +--ro port?                oc-inet:port-number
        |        +--ro source-address?      oc-inet:ip-address
        |        +--ro max-datagram-size?   uint16
        |        +--ro network-instance?    oc-netinst:network-instance-ref
        |        +--ro packets-sent?        oc-yang:counter64
        +--rw interfaces
           +--rw interface* [name]
              +--rw name      -> ../config/name
              +--rw config
              |  +--rw name?                    oc-if:base-interface-ref
              |  +--rw enabled?                 boolean
+             |  +--rw egress-enabled?          boolean
              |  +--rw polling-interval?        uint16
              |  +--rw ingress-sampling-rate?   uint32
              |  +--rw egress-sampling-rate?    uint32
              +--ro state
                 +--ro name?                    oc-if:base-interface-ref
                 +--ro enabled?                 boolean
+                +--ro egress-enabled?          boolean
                 +--ro polling-interval?        uint16
                 +--ro ingress-sampling-rate?   uint32
                 +--ro egress-sampling-rate?    uint32
                 +--ro packets-sampled?         oc-yang:counter64

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the openconfig-sampling-sflow model by introducing granular control over sFlow sampling on interfaces. By adding an egress-enabled leaf and refining the documentation for the existing enabled leaf, the model now explicitly distinguishes between ingress and egress sampling configurations. These changes maintain backward compatibility while providing better alignment with network monitoring requirements.

Highlights

  • New Configuration Leaf: Added the egress-enabled leaf to the sflow-interfaces-config grouping to allow for independent control of egress sFlow sampling.
  • Documentation Clarification: Updated the description of the existing enabled leaf to explicitly state that it controls ingress sFlow sampling.
  • Model Versioning: Incremented the OpenConfig model version to 1.2.0 and added a corresponding revision entry for the changes.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the openconfig-sampling-sflow.yang model to introduce support for egress sFlow sampling on interfaces via a new egress-enabled leaf, while clarifying that the existing enabled leaf controls ingress sFlow. The review feedback points out that only Arista EOS strongly supports egress sFlow among the compared network operating systems. To align with vendor-neutral modeling guidelines, the reviewer suggests adding a note to the egress-enabled description indicating that support is platform-dependent.

@dplore dplore moved this to Ready to discuss in OC Operator Review Nov 6, 2026
@dplore dplore self-assigned this Nov 6, 2026
@dplore

dplore commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Industry implementation references:

NOS Equivalent config Match Public reference
Arista EOS Per interface: sflow enable (ingress) and sflow egress enable (egress), each set on its own; global default: sflow interface egress enable default Strong. Direct 1:1 mapping to enabled / egress-enabled https://www.arista.com/en/um-eos/eos-sflow
SONiC config sflow interface sample-direction <rx|tx|both> <ifname>, plus a global sample-direction (default rx) Strong. Egress can be turned on per interface, but through a direction enum rather than separate booleans https://github.com/sonic-net/SONiC/blob/master/doc/sflow/sflow_hld.md
Cisco IOS-XR (8000) flow datalinkframesection monitor-map <m> sampler <s> egress on the interface Strong. Per-interface, per-direction attachment. NCS 5500 is generally ingress-only https://www.cisco.com/c/en/us/td/docs/iosxr/cisco8000/netflow/configuration-guide/netflow-configuration-ios-xr-8000/monitor-traffic-using-sflow/flow-monitoring-on-egress-interface.html
Juniper Junos set protocols sflow interfaces <if> sample-rate egress <N> Moderate. Egress is supported per interface, but enabled implicitly by setting a rate. There's no separate boolean https://www.juniper.net/documentation/us/en/software/junos/network-mgmt/topics/concept/sflow-support-on-routers.html
Nokia SR Linux interface ethernet-1/1 sflow { admin-state enable; egress-sampling-rate N } (srl_nokia-interfaces.yang, v26.7.2) Moderate. Egress is supported per interface, controlled by a single interface admin-state plus a rate for each direction. There's no egress boolean https://documentation.nokia.com/srlinux/26-3/books/oam/sflow.html
NVIDIA Cumulus Linux n/a No match. The docs say "Cumulus Linux does not support sFlow egress sampling." https://docs.nvidia.com/networking-ethernet-software/cumulus-linux/Monitoring-and-Troubleshooting/Network-Troubleshooting/Monitoring-System-Statistics-and-Network-Traffic-with-sFlow/

@dplore dplore left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The latest description edit (commit 22aecbb) deleted the closing "; on the egress-enabled description. Running yanglint on the PR head fails with a parse error. Two

@travisc-arista

Copy link
Copy Markdown
Author

Thanks Darren on spotting this, I have updated the description

@dplore

dplore commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

/gcbrun

@OpenConfigBot

Copy link
Copy Markdown

No major YANG version changes in commit fbe5f18

@dplore

dplore commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

/gcbrun

@travisc-arista

Copy link
Copy Markdown
Author

Oh fixed the trailing whitespace, just saw that job failed

@dplore

dplore commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

/gcbrun

1 similar comment
@dplore

dplore commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

/gcbrun

@dplore dplore left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Please push a commit to the repository to re-trigger the checks. There appeared to be a temporary github issue that stalled checks on your last update.

@dplore dplore moved this from Ready to discuss to last-call in OC Operator Review Nov 10, 2026
@dplore

dplore commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Setting last call to Nov 24, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: last-call

Development

Successfully merging this pull request may close these issues.

4 participants