PPPoE Session Count

Sampling the number of active PPPoE sessions is an example for an index based metric. The PPPoE sessions are stored in the local.pppoe.ppp.sessions table. The active session count can be determined by sampling the active-entry-count attribute of the pppoe_ppp_session_index. The listing below shows the JSON object to sample the active PPPoE sessions:

Listing 12 - JSON object to enable PPPoE session count sampling
{
    "rtbrick-config:metric": {
        "name": "pppoe_session_count",
        "table-name": "local.pppoe.ppp.sessions",
        "bds-type": "index-metric",
        "prometheus-type": "gauge",
        "description": "session count",
        "attribute": [
            {
                "attribute-name": "active-entry-count"
            }
        ]
    }
}
The active PPPoE session count can increase and decrease. Therefore the metric type must be gauge rather than counter.

Run rtb pppoed.1 show datastore schema table table-name local.pppoe.ppp.sessions to inspect the definition of the local.pppoe.ppp.sessions table.

Listing 13 - Excerpt of the table definition CLI output
$ rtb pppoed.1 show datastore schema table table-name  local.pppoe.ppp.sessions
...
        "index"   : [
        {
            "name"      : "pppoe_ppp_session_index",
            "type"      : "bplus",
            "immutable" : true ,
            "key"       : [
                "ifp_name",
                "outer_vlan",
                "inner_vlan",
                "client_mac",
                "session_id"
            ]
        },
...