Improve `consul debug` metric collection
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 39
Description
#### Feature Description
Currently `consul debug` will use the `v1/agent/metrics` endpoint to gather metrics every `interval` seconds. This interval defaults to 30s. The problem is the metrics are being aggregated into 10s intervals so when we poll every 30s we end up missing 2/3 of the metric data.
What would be great is to be able to gather all the metrics in a manner that is accurate. I had thought about being able to temporarily hook in an online stats sink with a new endpoint. We could use the prometheus metrics format. Or even other ways. The "how" doesn't matter so much as the ability to be able to gather these metrics.
#### Use Case(s)
The main use case is when debugging issues with a user often times we need these metrics to aid in that process. Many times we are given screenshots of dashboards or other similar partial views of the metrics. It would be much better to have the raw data that we could pump into our own tools to visualize and analyze without having to have as much back and forth with the user.
Contributor guide
Research direction
Start with the `consul debug` metric collection flow and the `v1/agent/metrics` endpoint, focusing on how the configured interval interacts with the endpoint's 10-second aggregation. Compare possible collection approaches, including Prometheus format or a temporary stats sink. Done means debug output captures accurate raw metric data without missing intervals.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, prometheus
- Domain
- cli, observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100