How to use the prom-client.register.setDefaultLabels function in prom-client

To help you get started, we’ve selected a few prom-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Hydractify / kanna_kobayashi / src / structures / Client.ts View on Github external
public constructor(options: ClientOptions)
	{
		super(options);

		this.commandHandler = new CommandHandler(this);
		this.commandHandler.loadCategoriesIn(join(__dirname, '..', 'commands'));

		// Pad the number with zeros at the beginning for sorting
		const shardId: string = (this.options.shards as [number])[0]
			.toString()
			.padStart(this.options.shardCount!.toString().length, '0');

		/* eslint-disable-next-line @typescript-eslint/camelcase */
		register.setDefaultLabels({ shard_id: shardId });

		// To get a stat here, not simply nothing
		this.errorCount.inc(0);

		registerListeners(this);
	}