Two things,
Full-duplex means you shouldn't add up `ifHCOutOctets` and `ifHCInOctets`. What you probably want is two alerts, one for "Port In Saturation" and one for "Port Out Saturation".
Because ifHighSpeed is megabits/sec, you'll have to do a bit more math. If you want to deal with half-duplex ports, you'll probably need to do some additional scraping of EtherLike-MIB and even a bit more math. It gets a bit complicated.
But the trivial alert would be something like this:
- alert: PortOutSaturation
expr: >
(
sum by (snmp_target,ifIndex,ifAlias,ifDescr,ifName) (rate(ifHCOutOctets[5m]))
* 8
/ 1000000
)
/
avg by (snmp_target,ifIndex,ifAlias,ifDescr,ifName) (avg_over_time(ifHighSpeed[5m]))
* 100
> 90
This would alert when the port is over 90% of the rated link speed.