feat: use macro to declare metric constants#1129
Merged
SuperFluffy merged 3 commits intomainfrom Jun 4, 2024
Merged
Conversation
ac155db to
5596ddf
Compare
SuperFluffy
commented
May 31, 2024
| }; | ||
|
|
||
| pub const TRANSACTIONS_PER_SUBMISSION: &str = | ||
| concat!(env!("CARGO_CRATE_NAME"), "_transaction_per_submission"); |
Contributor
Author
There was a problem hiding this comment.
The macro (and test) caught this const being oddly named. This is now astria_composer_transactions_per_submission
Fraser999
approved these changes
Jun 4, 2024
Contributor
Fraser999
left a comment
There was a problem hiding this comment.
Nice upgrade! I made a couple of suggestions, but both non-blocking.
I also think the unit tests aren't needed (except for the one in astria-telemetry) and could be removed since they're likely to become a source of frustration as we'll inevitably change metrics over time.
I was planning to add metrics snapshot testing of some sort in an upcoming PR, and I think if that's in place, these unit tests are really only testing the macro, which has its own unit test :)
5596ddf to
9fe63a0
Compare
Contributor
Author
|
Rebased on top of recent main and used the new macro for the new bridge-withdrawer service |
steezeburger
added a commit
that referenced
this pull request
Jun 5, 2024
* main: fix(charts): conductor configmap fix (#1146) feat(sequencer): add `allowed_fee_asset_ids` abci query and `sequencer_client` support (#1127) chore(conductor): release conductor 0.17 (#1139) feat: use macro to declare metric constants (#1129) refactor(merkle): remove source of panics in audit API (#1137) feat(conductor): skip outdated block metadata (#1120) refactor(sequencer): remove mint module (#1134) feat(bridge-withdrawer): add justfile (#1135) chore(chart): change evm back to latest on dev (#1132) feat(conductor, proto)!: celestia base heights in commitment state (#1121)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduce a macro
declare_metric_const!to avoid repetition and common typos when declaring string consts used as metric names.Background
Noticed some common errors in reviews and when writing metrics: mismatch between the const's name and the actual value. Missing underscores. Annoying repetiton of
env!("CARGO_CRATE_NAME");Changes
declare_metric_const!and define all consts in terms of it.Testing
Metrics
astria_composer_transactions_per_submissionreplacesastria_composer_transaction_per_submission