Closed yuanbohan closed 18 hours ago
May you try to add some descriptions and related code?
I'd like to do this issue.
@JetSquirrel The issue description is updated with more information. Assigned and please go ahead :D
@yuanbohan I instrument some metrics, do you think this metrics is enugh or we need add more? And how about the format of metrics , it's as expected or need to modify?
$ curl localhost:4010/metrics
# HELP greptime_client_go_request_count
# TYPE greptime_client_go_request_count counter
greptime_client_go_request_count 3
# HELP greptime_client_go_request_duration_histogram
# TYPE greptime_client_go_request_duration_histogram histogram
greptime_client_go_request_duration_histogram_bucket{le="0.001"} 0
greptime_client_go_request_duration_histogram_bucket{le="0.01"} 3
greptime_client_go_request_duration_histogram_bucket{le="0.1"} 3
greptime_client_go_request_duration_histogram_bucket{le="0.3"} 3
greptime_client_go_request_duration_histogram_bucket{le="0.6"} 3
greptime_client_go_request_duration_histogram_bucket{le="1"} 3
greptime_client_go_request_duration_histogram_bucket{le="3"} 3
greptime_client_go_request_duration_histogram_bucket{le="6"} 3
greptime_client_go_request_duration_histogram_bucket{le="10"} 3
greptime_client_go_request_duration_histogram_bucket{le="20"} 3
greptime_client_go_request_duration_histogram_bucket{le="60"} 3
greptime_client_go_request_duration_histogram_bucket{le="+Inf"} 3
greptime_client_go_request_duration_histogram_sum 0.006428089
greptime_client_go_request_duration_histogram_count 3
# HELP grpc_client_handled_total Total number of RPCs completed by the client, regardless of success or failure.
# TYPE grpc_client_handled_total counter
grpc_client_handled_total{grpc_code="OK",grpc_method="Handle",grpc_service="greptime.v1.GreptimeDatabase",grpc_type="unary"} 3
# HELP grpc_client_msg_received_total Total number of RPC stream messages received by the client.
# TYPE grpc_client_msg_received_total counter
grpc_client_msg_received_total{grpc_method="Handle",grpc_service="greptime.v1.GreptimeDatabase",grpc_type="unary"} 3
# HELP grpc_client_msg_sent_total Total number of gRPC stream messages sent by the client.
# TYPE grpc_client_msg_sent_total counter
grpc_client_msg_sent_total{grpc_method="Handle",grpc_service="greptime.v1.GreptimeDatabase",grpc_type="unary"} 3
# HELP grpc_client_started_total Total number of RPCs started on the client.
# TYPE grpc_client_started_total counter
grpc_client_started_total{grpc_method="Handle",grpc_service="greptime.v1.GreptimeDatabase",grpc_type="unary"} 3
@JetSquirrel Thanks a lot for your time and commitment.
These metrics are enough for the first version. But We can discuss the following concerns:
greptimedb_ingester_go_
(or a better option)unary
or stream
SHOULD BE a label in metricgreptime_client_go_request_duration_bucket
(which is a Prometheus histogram, and I omited the histogram
in the metric name) and greptime_client_go_request_duration_count
contains the totol request. Is greptime_client_go_request_count
needed?msg
in _msg_sent_total
and _msg_received_total
? _started_total
and _handled_total
?By the way, we should:
/metrics
endpoint or not (users may have already instrumented their apps already, and do not want sdk to export a port)To save your time, we can discuss the metrics pattern before you implement them. 👍
@JetSquirrel By the way, if you have time to acquire more practical and pragmatic patterns from the following links, it may help a better solution:
Purpose
help users to gain insight into the sdk behavior
How To
Config
, like: gorm prometheusMetrics
Reference