openGemini / opengemini-client-go

CNCF openGemini Go Client Library
https://opengemini.org/
Apache License 2.0
24 stars 17 forks source link

feat: support prometheus metrics #76

Closed xuthus5 closed 5 months ago

xuthus5 commented 5 months ago

Background To enhance monitoring and observability, we have introduced Prometheus metrics support in the project. These metrics will help us better understand the system's performance and identify potential bottlenecks.

New Features In this PR, we have added the following eight Prometheus metrics:

  1. opengemini_client_query_total Count all queries
  2. opengemini_client_query_database_total Count of opengemini queries and classify using database
  3. opengemini_client_query_latency Calculate the average of the queries
  4. opengemini_client_query_database_latency Calculate the average of the queries and classify using database
  5. opengemini_client_write_total Count of opengemini writes
  6. opengemini_client_write_database_total Count of opengemini writes and classify using database
  7. opengemini_client_write_latency Calculate the average of the writes
  8. opengemini_client_write_database_latency Calculate the average of the writes and classify using database

Impact This change does not affect existing functionality; it solely adds monitoring metrics. Ensure that the Prometheus server configuration in the deployment environment is set up to scrape these new metrics. Prometheus dependency was introduced for this project, and the project dependency is no longer pure.

Chenxulin97 commented 5 months ago

how to define the metric of writing when using auto-batch point write method?using inner batch writing request's time costing as the metric?

xuthus5 commented 5 months ago

how to define the metric of writing when using auto-batch point write method?using inner batch writing request's time costing as the metric?

specify a tag to distinguish between batch and single write? whether the batch feature is enabled or not, there is always one request sent. We only need to count the time spent on this request.

shoothzj commented 5 months ago

how to define the metric of writing when using auto-batch point write method?using inner batch writing request's time costing as the metric?

specify a tag to distinguish between batch and single write? whether the batch feature is enabled or not, there is always one request sent. We only need to count the time spent on this request.

I agree, it seems no valuable to split them.

xuthus5 commented 5 months ago

@shoothzj @Chenxulin97 PTAL,it can work well on my local machine.

2024-06-25 23-20-04