You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.
Currently, the vector metrics are created on the fly - i.e. once the call is made, the corresponding metric label is registered. So for example, if I have a unary gRPC service "Foo", only after I make a call to "Foo", the metrics with labels grpc_method=Foogrpc_service=FooService will appear in Prometheus' /metrics endpoint.
Would it be possible to add a method/function to pre-warm metrics in the case when one needs a complete set of possible metrics up-front? My use case is integration testing - while checking whether all the metrics are present/registered during integration test, I need to account for all gRPC calls that have been made during that test, which makes it flaky.
Prometheus Go client itself allows calling <metrics_object>.WithLabelValues(...) in order to achieve this.
Thanks in advance for a reply.
The text was updated successfully, but these errors were encountered:
hi @brancz im looking to implement something to initialise the metrics for the client side and was wondering if you had any suggestions? Im think a function that initialises a particular method could be acceptable? let me know your suggestions!
// preRegisterMethod can be invoked on a client method to pre-populate a client method.
func (m *ClientMetrics) PreRegisterMethod(fullMethod string, methodType grpcType) {
serviceName, methodName := splitMethodName(fullMethod)
m.clientStartedCounter.GetMetricWithLabelValues(methodType, serviceName, methodName)
m.clientStreamMsgReceived.GetMetricWithLabelValues(methodType, serviceName, methodName)
m.clientStreamMsgSent.GetMetricWithLabelValues(methodType, serviceName, methodName)
if m.clientHandledHistogramEnabled {
m.clientHandledHistogram.GetMetricWithLabelValues(methodType, serviceName, methodName)
}
for _, code := range allCodes {
m.clientHandledCounter.GetMetricWithLabelValues(methodType, serviceName, methodName, code.String())
}
}
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently, the vector metrics are created on the fly - i.e. once the call is made, the corresponding metric label is registered. So for example, if I have a unary gRPC service "Foo", only after I make a call to "Foo", the metrics with labels
grpc_method=Foo
grpc_service=FooService
will appear in Prometheus'/metrics
endpoint.Would it be possible to add a method/function to pre-warm metrics in the case when one needs a complete set of possible metrics up-front? My use case is integration testing - while checking whether all the metrics are present/registered during integration test, I need to account for all gRPC calls that have been made during that test, which makes it flaky.
Prometheus Go client itself allows calling
<metrics_object>.WithLabelValues(...)
in order to achieve this.Thanks in advance for a reply.
The text was updated successfully, but these errors were encountered: