You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
axum_prometheus::metrics::describe_gauge!("test_where","ASD");let(prometheus_layer, metric_handle) = PrometheusMetricLayerBuilder::new().with_prefix("builder-example")// ignore reporting requests that match "/metrics".with_ignore_pattern("/metrics")// if the any of the second argument matches, report them at the `/foo` endpoint.with_group_patterns_as("/foo",&["/foo/:bar","/foo/:bar/:baz"])// build a custom PrometheusHandle.with_metrics_from_fn(|| {PrometheusBuilder::new().set_buckets_for_metric(Matcher::Full(AXUM_HTTP_REQUESTS_DURATION_SECONDS.to_string()),SECONDS_DURATION_BUCKETS,).unwrap().install_recorder().unwrap()}).build_pair();// build our application with a single routelet app = Router::new().route("/",get(
|ConnectInfo(remote_addr):ConnectInfo<SocketAddr>| asyncmove{
log::error!("hm");
axum_prometheus::metrics::increment_gauge!("test_where",42.0,&[("chain_id","composable")]);format!("Hello, {remote_addr:?}!\r\n")},),).route("/metrics",get(|| asyncmove{ metric_handle.render()})).layer(prometheus_layer);
I open main page several times. Only what I see are axum metrics, never added by me.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have next code.
I open main page several times. Only what I see are axum metrics, never added by me.
Beta Was this translation helpful? Give feedback.
All reactions