GreptimeTeam / greptimedb-ingester-go

A Go ingester for GreptimeDB, which is compatible with GreptimeDB protocol and lightweight.
Apache License 2.0
10 stars 5 forks source link

collect critical metrics #8

Closed yuanbohan closed 18 hours ago

yuanbohan commented 7 months ago

Purpose

help users to gain insight into the sdk behavior

How To

Metrics

Reference

tisonkun commented 6 months ago

May you try to add some descriptions and related code?

JetSquirrel commented 5 months ago

I'd like to do this issue.

tisonkun commented 5 months ago

@JetSquirrel The issue description is updated with more information. Assigned and please go ahead :D

JetSquirrel commented 5 months ago

@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
yuanbohan commented 4 months ago

@JetSquirrel Thanks a lot for your time and commitment.

These metrics are enough for the first version. But We can discuss the following concerns:

By the way, we should:

To save your time, we can discuss the metrics pattern before you implement them. 👍

yuanbohan commented 4 months ago

@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: