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

feat: Support using Prometheus' CounterVec, Gauge, IntGaugeVec, and other types in macros #1239

Open
shuimuliang opened this issue Jun 19, 2023 · 0 comments

Comments

@shuimuliang
Copy link

shuimuliang commented Jun 19, 2023

Contact Details

shuimuliang@gmail.com

Propose-a-new-feature

axon/common/apm-derive/examples/api.rs

#[async_trait]
impl Rpc for RpcExample {
    #[metrics_rpc("eth_sendRawTransaction")]
    async fn send_transaction(&self, tx: SignedTransaction) -> Result<Hash, Error> {
        Ok(tx.transaction.hash)
    }

    #[metrics_rpc("net_listening")]
    fn listening(&self) -> Result<bool, Error> {
        Ok(false)
    }
}

macro metrics_rpc only support IntCounter type in Prometheus

Alternatives you've considered

Describe alternatives you've considered:
extend the macro to support CounterVec, Gauge, IntGaugeVec, and other types.

Anything else?

No response

@shuimuliang shuimuliang changed the title Support using Prometheus' CounterVec, Gauge, IntGaugeVec, and other types in macros feat: Support using Prometheus' CounterVec, Gauge, IntGaugeVec, and other types in macros Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
@shuimuliang and others