Skip to content

Commit d0a113c

Browse files
committed
docs: fix review issues in registry and collector docs
- GCCollector does not support registry=None on CPython; remove that claim - Remove unused CONTENT_TYPE_LATEST import from registry example - Fix 'value vs labels' section to correctly describe Summary (count_value/sum_value) and Histogram (buckets) Signed-off-by: k1chik <107162115+k1chik@users.noreply.github.com>
1 parent a708480 commit d0a113c

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

docs/content/collector/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ other implementations).
9494

9595
| Parameter | Type | Default | Description |
9696
|-----------|------|---------|-------------|
97-
| `registry` | `CollectorRegistry` | `REGISTRY` | Registry to register with. Pass `None` to skip registration. |
97+
| `registry` | `CollectorRegistry` | `REGISTRY` | Registry to register with. |
9898

9999
Metrics exported:
100100

docs/content/collector/custom.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ at registration time instead.
5656

5757
## value vs labels
5858

59-
Every metric family constructor accepts either `value` or `labels`, but not
60-
both.
59+
Every metric family constructor accepts either inline data or `labels`, but not
60+
both. The inline data parameter name varies by type: `value` for Gauge, Counter,
61+
and Info; `count_value`/`sum_value` for Summary; `buckets` for Histogram.
6162

62-
- Pass `value` (and for counters, optionally `created`) to emit a single
63-
unlabelled metric directly from the constructor.
63+
- Pass inline data to emit a single unlabelled metric directly from the constructor.
6464
- Pass `labels` (a sequence of label names) and then call `add_metric` one or
6565
more times to emit labelled metrics.
6666

docs/content/registry/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ for partial scrapes. See [Restricted registry](../restricted-registry/) for
7474
usage with `generate_latest` and the built-in HTTP server.
7575

7676
```python
77-
from prometheus_client import generate_latest, CONTENT_TYPE_LATEST
77+
from prometheus_client import generate_latest
7878

7979
subset = REGISTRY.restricted_registry(['python_info', 'process_cpu_seconds_total'])
8080
output = generate_latest(subset)

0 commit comments

Comments
 (0)