Instead if attributes were exposed it would be possible to do something like this:
/// How fast the racecar is going
#[derive(Valuable)]
#[histogram(key="racecar.speed", unit="mph")]
struct RacecarSpeed(f64);
#[tokio::test]
async fn proposed_example() {
tracing::info!("Going at {}mph", speed=RacecarSpeed(777.0012_f64));
}
I think there's two approaches here: expose the attributes directly, or expose the typeid and require subscribers to map that typeid to the attribute
At the moment
tracing-opentelemetry
does a somewhat of a hack to know what fields are metrics. It requires the field name to be prefixedInstead if attributes were exposed it would be possible to do something like this:
I think there's two approaches here: expose the attributes directly, or expose the typeid and require subscribers to map that typeid to the attribute