Add convenience metric
- Dominant language
- Go
- Stars
- 3.7k
- Forks
- 465
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 5
Description
We rely on grafana, prometheus, and alertmanager for our monitoring stack. When metrics are ingested, they contain a non-human-friendly logid such as `entries_added{logid="abcdef1234567890abc"}`. In the [docs](https://github.com/google/trillian/blob/master/docs/api.md) there is an optional display name that can be set per shard. It would be a big help if a metric could be exported that contained the `display_name`, `tree_state`, and `tree_type`.
A metric such as this would be perfect `shard_information{logid="abcdef1234567890abc",display_name="2020",tree_state="active",tree_type="LOG"}`.
With this proposed metric, we would be able to use Prometheus' [group_left](https://www.robustperception.io/using-group_left-to-calculate-label-proportions) and make the rest of our metrics human-friendly.
Here's an example of what we currently do in grafana. Configuring this across multiple dashboards is time consuming, requires manual intervention when adding a new shard, and is prone to error. Additionally, because this is done in grafana, the human-friendly name can't be sent to a prometheus alert.

I've considered writing a database exporter to generate a metric, but I think it would be better suited to be built into trillian instead.
Perhaps this already exists and I've missed it. If not, thank you for considering it.
Contributor guide
Assessment
This issue has not been assessed yet.