Skip to content

Commit 7b51946

Browse files
committed
README update
1 parent e898a80 commit 7b51946

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ New metric constructors use separate `PUSH_REGISTRY` as a default, not to interf
2525

2626
### Default labelvalues
2727

28-
With regular prometheus_client, defaults may be defined for either _none_ or _all_ the labels (with `labelvalues`), but that's not enough. Moreover `labelvalues` sometimes doesn't work as expected.
28+
With regular `prometheus_client`, defaults may be defined for either _none_ or _all_ the labels (with `labelvalues`), but that's not enough. Moreover `labelvalues` sometimes doesn't work as expected.
2929

30-
We probably want to define _some_ defaults, like `hostname`, or more importantly, **if we use VictoriaMetrics cluster**, we always need to push label `VictoriaMetrics_AccountID=<int>` (usually 1) or else our metrics will be ignored.
30+
We probably want to define _some_ defaults, like `hostname`, or more importantly, **if we use VictoriaMetrics cluster**, `VictoriaMetrics_AccountID=<tenant_id>` (try 0 as a default) label must always be set, and metrics without it will be ignored.
3131

3232
Following example shows how to use defaults, and how to override them if necessary.
3333

@@ -39,7 +39,7 @@ counter1 = ppc.Counter(
3939
name="c1",
4040
labelnames=["VictoriaMetrics_AccountID", "host", "event_type"],
4141
default_labelvalues={
42-
"VictoriaMetrics_AccountID": 1,
42+
"VictoriaMetrics_AccountID": 0,
4343
"host": socket.gethostname(),
4444
}
4545
)
@@ -57,13 +57,13 @@ counter1.labels("non-default", "login").inc()
5757

5858
Metrics with no labels are initialized at creation time. This can have unpleasant side-effect: if we initialize lots of metrics not used in currently running job, batch clients will have to push their non-changing values in every synchronization session.
5959

60-
To avoid that we'll have to properly isolate each task's metrics, which can be impossible or rather tricky, or we can create metrics with default, non-changing labels (like `hostname`). Such metrics will be initialized on fisrt use (inc), and we'll be pushing only those we actually used.
60+
To avoid that we'll have to properly isolate each task's metrics, which can be impossible or rather tricky, or we can create metrics with default, non-changing labels (like `hostname`). Such metrics will be initialized on first use (inc), and we'll be pushing only those we actually utilized.
6161

6262
## Batch clients
6363

6464
Batch clients spawn synchronization jobs "in background" (meaning in a thread or asyncio task) to periodically send all metrics from `ppc.PUSH_REGISTRY` to the destination.
6565

66-
Clients will attempt to stop gracefully, synchronizing registry "one last time" after job exits or crashes. Sometimes this _may_ mess up Grafana sampling, but the worst picture I could artifically create looks like this:
66+
Clients will attempt to stop gracefully, synchronizing registry "one last time" after job exits or crashes. Sometimes this _may_ mess up sampling, but the worst case I could artifically create looks like this:
6767

6868
![graceful push effect](./docs/img/graceful_stop_effect01.png)
6969

@@ -120,4 +120,4 @@ def statsd_udp_stream(host, port):
120120

121121
Usage is completely identical to batch clients' decorators / context managers.
122122

123-
:warning: Histogram and Summary `.time() decorator` doesn't work in this mode atm, because it can't be easily monkey-patched.
123+
:warning: Histogram and Summary `.time() decorator` doesn't work in this mode atm, because it can't be monkey-patched easily.

0 commit comments

Comments
 (0)