Skip to content
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

Awkward NIC Metric To OpMon Assignment #144

Open
aeoranday opened this issue Dec 9, 2024 · 0 comments
Open

Awkward NIC Metric To OpMon Assignment #144

aeoranday opened this issue Dec 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@aeoranday
Copy link
Member

if ( std::regex_match(name, match, queue_regex) ) {
auto queue_name = match[1].str() + '-' + match[2].str();
auto & entry = xq[queue_name];
try {
opmonlib::set_value( entry, match[3], m_iface_xstats.m_xstats_values[i] );
} catch ( const ers::Issue & e ) {
ers::warning( MetricPublishFailed( ERS_HERE, name, e) );
}
continue;
}
google::protobuf::Message * metric_p = nullptr;
static std::regex err_regex(R"(.+error.*)");
if ( std::regex_match( name, err_regex ) ) metric_p = & xerrs;
else metric_p = & xinfos;
try {
opmonlib::set_value(*metric_p, name, m_iface_xstats.m_xstats_values[i]);
} catch ( const ers::Issue & e ) {
ers::warning( MetricPublishFailed( ERS_HERE, name, e) );
}

The NIC metrics grabbed by rte_ethdev.h are dependent on the NIC installed to a machine, so this is expected to vary with upgrades, detector servers, etc. However, the assignment to OpMon is direct and is not necessarily tuned to an arbitrary NIC. This results in missed OpMon metric assignment in the case of slight naming differences or a regular emission of warnings for a NIC metric that is not defined in OpMon.

We are likely not interested in tracking all possible NIC metrics, so we should define the set of metrics we are interested in and define them in the OpMon metrics. The translation between NIC and OpMon metrics would then need to be robust to slight naming differences.

An immediate quality-of-life improvement would be to emit these warnings only once instead of every metric poll.

@aeoranday aeoranday added the bug Something isn't working label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant