-
Notifications
You must be signed in to change notification settings - Fork 9
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
coordinator: uniform gRPC metric prefix #583
Merged
Merged
Conversation
This file contains 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
burgerdev
force-pushed
the
burgerdev/move-userapi
branch
4 times, most recently
from
June 14, 2024 21:21
a1c91b3
to
484b0eb
Compare
burgerdev
commented
Jun 17, 2024
burgerdev
commented
Jun 17, 2024
katexochen
reviewed
Jun 18, 2024
katexochen
approved these changes
Jun 18, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should keep the first commit to retain history.
|
burgerdev
added
changelog
PRs that should be part of the release notes
and removed
no changelog
PRs not listed in the release notes
labels
Jun 18, 2024
burgerdev
force-pushed
the
burgerdev/move-userapi
branch
3 times, most recently
from
June 18, 2024 15:38
257d564
to
a7335ce
Compare
burgerdev
changed the title
coordinator: move userapi into authority
coordinator: uniform gRPC metric prefix after refactoring
Jun 19, 2024
burgerdev
changed the title
coordinator: uniform gRPC metric prefix after refactoring
coordinator: uniform gRPC metric prefix
Jun 19, 2024
This simply moves the files without modification, in order to keep the history intact. *This commit is not expected to compile!*
Makes the necessary adjustments to userapi and recoveryapi after moving them from main to the authority package.
burgerdev
force-pushed
the
burgerdev/move-userapi
branch
from
June 19, 2024 06:14
a7335ce
to
cf571cd
Compare
This was referenced Jun 19, 2024
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.
During a refactoring, we discovered that the gRPC metrics include the service in both the metric name and a label:
Since it's both more consistent to report all gRPC methods under the same metric, and easier to maintain the gRPC metrics when there is only one instance, we decided to move all of them under a common prefix,
contrast_
.Future list of metrics
contrast_attestation_failures 8 contrast_coordinator_manifest_generation 1 contrast_grpc_server_handled_total contrast_grpc_server_handling_seconds_bucket contrast_grpc_server_handling_seconds_count contrast_grpc_server_handling_seconds_sum contrast_grpc_server_msg_received_total contrast_grpc_server_msg_sent_total contrast_grpc_server_started_total
Below is the original PR description with the motivation for refactoring userapi etc.
This PR moves the gRPC handlers for
userapi
andrecoveryapi
into theauthority
module. In the main module remain gRPC server setup (credentials, metrics, listener).I'm mostly driven by the increasing complexity of changing code in both
authority
anduserapi
. We had to change theAuthority
API a couple of times, and adjusting theuserapi
test accordingly is cumbersome. Given that theAuthority
API is closely coupled to the gRPC API, it is probably for the best to merge the two and remove the currentAuthority
API.To keep things simple, I'm refactoring in several steps. This is the first step, which does the bare minimum to keep the boat afloat after the move. There are still some rough edges (I left a couple of TODOs), but it already allows to resolve this and that TODO, which are blocking RFC004 - the former here and the latter in a PoC commit [here].
Next, I need to consolidate the former
Authority
API with theuserapi
, which will mostly involve moving code around, and adapt the tests. Fortunately, these changes can now be interleaved with the recovery effort.Review Recommendation
I split the PR into
userapi*.go
andrecoveryapi.go
It is probably easier to restrict the
Changes from
in the review tab to the second commit, so that you only see the actual changes. Otherwise, git does not consider the files related and the diffs are the entire files.TODO: