generated from TrueCloudLab/basic
Export gRPC client and server metrics #6
No reviewers
Labels
No labels
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-observability#6
Loading…
Reference in a new issue
No description provided.
Delete branch "acid-ant/frostfs-observability:feature/4-export-grpc-metrics"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Close #4
Description for gRPC metrics copied from open repositories, but this code licensed under Apache 2.0.
@fyrchik, @realloc could this be an obstacle for us?
Links to sources:
https://github.com/grpc-ecosystem/go-grpc-middleware/blob/main/providers/prometheus/server_metrics.go
https://github.com/grpc-ecosystem/go-grpc-middleware/blob/main/providers/prometheus/client_metrics.go
Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com
@ -21,0 +58,4 @@
VariableLabels: []string{"grpc_type", "grpc_service", "grpc_method"},
},
}
metrics.MustRegister(clientMetrics, descs...)
Why export
MustRegister
instead of using ourNew*
wrappers? Not saying this is a bad thing.Because all methods in
grpcprom.ServerMetrics
are private, there are no possibility to initialize them.@ -8,3 +9,3 @@
)
var serverMetrics *grpcprom.ServerMetrics = grpcprom.NewServerMetrics(
var serverMetrics = grpcprom.NewServerMetrics(
How is it different from what was before? We register metric descriptions, but the implementation is still in the imported package?
Didn't catch your question. You propose to create our own metrics instead of predefined?
Yes, but ok, let's do it in a separate task. It is not ideal currently -- definitions are decoupled from the actual metrics, so it is easy to miss something.
@ -16,2 +17,3 @@
func init() {
metrics.Register(serverMetrics)
// Description copied from grpc-ecosystem:
// https://github.com/grpc-ecosystem/go-grpc-middleware/blob/main/providers/prometheus/server_metrics.go
Can we use a permalink here (replace
main
with a tag)?Updated.
607c7db018
to6349e91b1b
6349e91b1b
to7960099809