We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9dec7bb commit cba73a0Copy full SHA for cba73a0
README.md
@@ -356,19 +356,19 @@ Typescript can also enforce label names using `as const`
356
```typescript
357
import * as client from 'prom-client';
358
359
-const gauge = new client.Counter({
+const counter = new client.Counter({
360
name: 'metric_name',
361
help: 'metric_help',
362
// add `as const` here to enforce label names
363
labelNames: ['method'] as const,
364
});
365
366
// Ok
367
-gauge.inc({ method: 1 });
+counter.inc({ method: 1 });
368
369
// this is an error since `'methods'` is not a valid `labelName`
370
// @ts-expect-error
371
-gauge.inc({ methods: 1 });
+counter.inc({ methods: 1 });
372
```
373
374
#### Default Labels (segmented by registry)
0 commit comments