chenBright opened a new pull request, #3557:
URL: https://github.com/apache/brpc/pull/3557
### What problem does this PR solve?
Issue Number: resolve
Problem Summary:
1. bvar lacks a histogram metric: users cannot export bucketed observations
(Prometheus `histogram` type).
3. A bvar and an mbvar can expose the same Prometheus metric name after
separator normalization. Prometheus rejects the whole scrape when a
metric
name appears with different types/label sets.
5. A `MultiDimension` label may collide with a label reserved by the
underlying
metric (e.g. `le` of Histogram, `quantile` of LatencyRecorder),
producing
conflicting samples.
### What is changed and the side effects?
Changed:
- Add `bvar::Histogram` with explicit bucket bounds (`BucketSchema`),
exporting
`_bucket{le=...}` / `_sum` / `_count` families, with `bvar::Window`
support.
- Add `bvar::detail::PrometheusNameRegistry`: `Variable::expose*` and `
MVariable::expose*` now allocate normalized Prometheus names through one
shared registry, so a name taken by a bvar cannot be re-used by an mbvar
and
vice versa; names are released on `hide()` / `hide_all()`.
- Composite metrics declare themselves via `MetricFamily`; `MultiDimension`
rejects
outer labels that collide with the metric's reserved labels, for builtin
and user-defined
composite metrics alike.
Side effects:
- Performance effects:
- Breaking backward compatibility:
---
### Check List:
- Please make sure your changes are compilable.
- When providing us with a new feature, it is best to add related tests.
- Please follow [Contributor Covenant Code of
Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]