autometrics-dev / am

Autometrics Companion CLI app
Apache License 2.0
16 stars 2 forks source link

[am list] [Rust] Detect autometricization when the attribute is hidden by `cfg_attr` #144

Open gagbo opened 1 year ago

gagbo commented 1 year ago

I didn't test this, so I am pretty sure that currently am list will not detect the autometrics macro if it uses any kind of conditional compilation flag:

#[cfg_attr(feature = "extra-metrics", autometrics::autometrics(objective = super::API_SLO))]
fn api_route_handler(args: Args) -> ApiResult<()> {
    Ok(())
}

We should add a test for this case on Rust queries, and make sure that it's properly detected as well when listing "instrumented functions"