stacks-network / stacks-core

The Stacks blockchain implementation
https://docs.stacks.co
GNU General Public License v3.0
3.01k stars 671 forks source link

fix: use lower-cardinality prometheus metrics in signer #5196

Closed hstove closed 2 months ago

hstove commented 2 months ago

The signer exposes prometheus metrics, but because many of the RPC timers use the "raw" RPC path, it exposes a risk of high cardinality (ie many unique labels), especially when many signers are used across many networks.

To reduce that cardinality, the PR updates some of the RPC call timers to use a more "generic" path. For example, instead of /v2/accounts/SP123, it uses /v2/accounts/:stacks_address. Similarly, for read-only functions, the contract address is replaced with :principal, which will make the label the same across mainnet and testnet.

Reviewers: please double check the RPC timer labels in stacks_client.rs to ensure there aren't other timers that have dynamic values in them. Additionally, please double check that the labels are still descriptive enough.

blockstack-devops commented 3 weeks ago

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.