---
title: "danog\\BetterPrometheus\\BetterCollector: A better prometheus collector."
description: ""

---
# `danog\BetterPrometheus\BetterCollector`
[Back to index](../../index.md)

> Author: Daniil Gentili <daniil@daniil.it>  
  

A better prometheus collector.  



## Properties
* `$storageAdapter`: `Prometheus\Storage\Adapter` Storage adapter
* `$namespace`: `string` Metric namespace
* `$name`: `string` Metric name
* `$help`: `string` Info about the metric
* `$labels`: `array<string, string>` Default labels, i.e. ['instance' => 'instance_1']

## Method list:
* [`__construct(\Prometheus\Storage\Adapter $storageAdapter, string $namespace, string $name, string $help, array $labels = [])`](#__construct)
* [`addLabels(array<string, string> $labels): static`](#addLabels)

## Methods:
### <a name="__construct"></a> `__construct(\Prometheus\Storage\Adapter $storageAdapter, string $namespace, string $name, string $help, array $labels = [])`

Constructor.


Parameters:

* `$storageAdapter`: `\Prometheus\Storage\Adapter`   
* `$namespace`: `string`   
* `$name`: `string`   
* `$help`: `string`   
* `$labels`: `array`   


#### See also: 
* `\Prometheus\Storage\Adapter`




### <a name="addLabels"></a> `addLabels(array<string, string> $labels): static`

Create a new instance of this collector, with these additional labels.


Parameters:

* `$labels`: `array<string, string>`   



---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
