---
title: "danog\\BetterPrometheus\\BetterHistogram: A better prometheus histogram."
description: ""

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

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

A better prometheus histogram.  




## Constants
* `danog\BetterPrometheus\BetterHistogram::TYPE`: 

## 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 $adapter, string $namespace, string $name, string $help, array<string, string> $labels = [], (non-empty-list<float>|null) $buckets = NULL)`](#__construct)
* [`addLabels(array $labels): static`](#addLabels)
* [`observe((double|int) $value, array<string, string> $labels = []): void`](#observe)

## Methods:
### <a name="__construct"></a> `__construct(\Prometheus\Storage\Adapter $adapter, string $namespace, string $name, string $help, array<string, string> $labels = [], (non-empty-list<float>|null) $buckets = NULL)`




Parameters:

* `$adapter`: `\Prometheus\Storage\Adapter`   
* `$namespace`: `string`   
* `$name`: `string`   
* `$help`: `string`   
* `$labels`: `array<string, string>`   
* `$buckets`: `(non-empty-list<float>|null)`   


#### See also: 
* `\Prometheus\Storage\Adapter`
* `non-empty-list`




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




Parameters:

* `$labels`: `array`   



### <a name="observe"></a> `observe((double|int) $value, array<string, string> $labels = []): void`




Parameters:

* `$value`: `(double|int)` e.g. 123  
* `$labels`: `array<string, string>` e.g. ['status' => '201', 'opcode' => 'SOME_OP']  


#### See also: 
* `double`




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