apache / apache/dubbo

Add metrics naming convention for prometheus

Open
#11,321 5 comments 1 reaction 0 assignees View on GitHub
type/proposal
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

## Describe the proposal

[Prometheus naming](https://prometheus.io/docs/practices/naming/)

### Add prefixes (based on business scenarios)
For provider: `dubbo.provider`, such as `dubbo.provider.rt.qps.seconds`
For consumer: `dubbo.consumer`, such as `dubbo. consumer.rt.qps.seconds`
For registry: `dubbo.registry`, such as `dubbo.registry.requests.total`

### Add suffix

#### Step 1: add [base-units](https://prometheus.io/docs/practices/naming/#base-units)
- Time: suffix with `seconds`, such as `dubbo.rt.qps.seconds`
- Length: meters
- Bytes: bytes
...

#### Step 2: add suffix by metrics type
- Counter: suffix with `total`, such as `dubbo.rt.requests.total`

#### Step 3: add other suffix
- The num of metrics: `count`, such as `dubbo.rt.seconds.count`
- Summary value: `sum`, such as `dubbo.rt.seconds.sum`
- Minimum value: `min`, such as `dubbo.rt.seconds.min`
- Maximum value: `max`, such as `dubbo.rt.seconds.max`
- Average value: `avg`, such as `dubbo.rt.seconds.avg`
- P99 value: `avg`, such as `dubbo.rt.seconds.p99`
- P95 value: `avg`, such as `dubbo.rt.seconds.p95`

Contributor guide

Open the contributing guide

Research direction

Start with the linked Prometheus naming guidance and inspect Dubbo's existing metrics implementation and exposed metric names. Clarify which files, metric families, and naming rules are in scope; done should mean the agreed provider, consumer, and registry names follow the documented prefix and suffix conventions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, prometheus
Domain
observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.