diff --git a/README.md b/README.md index 1487a50e..348a5bff 100644 --- a/README.md +++ b/README.md @@ -356,7 +356,7 @@ Typescript can also enforce label names using `as const` ```typescript import * as client from 'prom-client'; -const gauge = new client.Counter({ +const counter = new client.Counter({ name: 'metric_name', help: 'metric_help', // add `as const` here to enforce label names @@ -364,11 +364,11 @@ const gauge = new client.Counter({ }); // Ok -gauge.inc({ method: 1 }); +counter.inc({ method: 1 }); // this is an error since `'methods'` is not a valid `labelName` // @ts-expect-error -gauge.inc({ methods: 1 }); +counter.inc({ methods: 1 }); ``` #### Default Labels (segmented by registry)