Skip to content

Add YANG models for configurable drop monitor feature#22589

Merged
yxieca merged 2 commits intosonic-net:masterfrom
arista-hpandya:drop-counter-yang
Jun 16, 2025
Merged

Add YANG models for configurable drop monitor feature#22589
yxieca merged 2 commits intosonic-net:masterfrom
arista-hpandya:drop-counter-yang

Conversation

@arista-hpandya
Copy link
Contributor

@arista-hpandya arista-hpandya commented May 10, 2025

This PR adds the YANG model definition for the DEBUG_DROP_MONITOR tables to the SONiC yang models repository. The new YANG model defines the schema for configuring and monitoring persistent drop counters in SONiC.

Changes:

  • Added YANG model definition to sonic-debug-counter.yang
  • Added test cases in tests/ to cover the new YANG model updates, including validation of configuration data and schema.
  • Updated documentation in docs/ to describe the new tables and its attributes.

Why I did it

To provide a standardized and programmatic way to configure and monitor persistent drop counters in SONiC. This enhances the manageability and observability of network traffic.

Work item tracking

Fixes #21675
HLD: sonic-net/SONiC#1912

How I did it

Created a new YANG model file, implemented test cases for validation, and updated the relevant documentation.

How to verify it

  • Verify the presence of the sonic-debug-counter.yang file in the sonic-yang-models/yang/ directory.
  • Run the test cases in tests/ and ensure they pass.
  • Check the updated documentation in docs/ for accuracy and completeness.
  • Deploy the changes to a SONiC device and verify the configuration and monitoring functionality using CLI commands.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

  • 202405
  • 202411

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

image

Added the following tables:

- DEBUG_DROP_MONITOR
- DEBUG_DROP_MONITOR_STATS
- PERSISTENT_DROP_ALERTS

Modified the following tables:

- DEBUG_COUNTER
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

… yang-models

These tables belongs to counters DB and hence should not need a yang model
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@vmittal-msft vmittal-msft left a comment

Choose a reason for hiding this comment

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

@arista-hpandya i left some comments in HLD PR. please share your thoughts on those. Else these changes are mostly in-line with HLD

@abdosi
Copy link
Contributor

abdosi commented Jun 4, 2025

@qiluo-msft : can you also review this ?

@vmittal-msft
Copy link
Contributor

@rlhui @yxieca please help merge.

@yxieca yxieca merged commit 71f938d into sonic-net:master Jun 16, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Feature] Add YANG Model for configurable drop monitor feature

5 participants