Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ type MetricValueWithName<T extends string> = MetricValue<T> & {

type LabelValues<T extends string> = T extends NoLabelNameType
? Partial<Record<string, never>>
: Partial<Record<T, string | number>>;
: Partial<Record<T, string | number | string[]>>;

interface MetricConfiguration<T extends string> {
name: string;
Expand Down
2 changes: 2 additions & 0 deletions test/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ const registry = new Registry();
const counter = new Counter({
name: 'typescript_test_counter',
help: 'TypeScript test counter',
labelNames: ['handler'],
registers: [registry],
});
counter.inc({ handler: ['/a', '/b'] });

const metricsText: Promise<string> = registry.getMetricsAsString(counter);
const gatewayWithRegistry = new Pushgateway('http://127.0.0.1:9091', registry);
Expand Down