influxdata / influxdata/influxdb
metrics: Database-Level Performance
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
# Database Performance Metrics
Right now, we serve a good number of metrics for understanding writes and queries. But we need to track a few missing pieces. Primarily, we need to add the database as a parameter to the outputs as that'll help us better understand if specific databases are being hammered more than others.
Update the `/metrics` endpoint to serve the following metrics:
### New Metrics:
- [ ] **http_request_active**: Total number of currently active requests, per database.
### Update Metrics:
- [ ] **http_request_duration_seconds_[sum,bucket,count]:** Add database as parameter
- [ ] **http_response_body_size_bytes_[sum,bucket,count]:** Add database as parameter
- [ ] **http_requests_total:** Add database as parameter
## New Endpoint Parameters:
Right now we're only tracking the v2 and v3 endpoints for writes and queries. We should include v1 endpoints to ensure we're capturing all info. We don't have to worry about `ping` or `debug` endpoints for v1.
For example, we current have:
```
http_request_duration_seconds_sum{method="POST",method_path="POST /api/v2/write",path="/api/v2/write",status="ok"}
```
Let's add one for the v1 write endpoint as well.
```
http_request_duration_seconds_count{method="POST",method_path="POST /write",path="//write",status="ok"}
```
### Updated Endpoints
- [ ] All versions of **http_request_duration_seconds_[sum,bucket,count]:** Add /write, /query endpoints
- [ ] All versions of **http_response_body_size_bytes_[sum,bucket,count]:** Add /write, /query endpoints
- [ ] All versions of **http_requests_total:** Add /write, /query endpoints
Contributor guide
Research direction
Start by locating the /metrics endpoint and the existing http_request_duration_seconds, http_response_body_size_bytes, and http_requests_total instrumentation. Trace how v2 and v3 write/query endpoints are labeled, then cover the v1 /write and /query endpoints and add database labels, including the new http_request_active metric; verify the emitted metric names and labels for each endpoint.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100