---
title: "danog\\BetterPrometheus\\BetterSummary: A better prometheus summary."
description: ""

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

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

A better prometheus summary.  




## Constants
* `danog\BetterPrometheus\BetterSummary::RESERVED_LABELS`: 

* `danog\BetterPrometheus\BetterSummary::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 = [], int $maxAgeSeconds = 600, ?non-empty-list<float> $quantiles = 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 = [], int $maxAgeSeconds = 600, ?non-empty-list<float> $quantiles = NULL)`




Parameters:

* `$adapter`: `\Prometheus\Storage\Adapter`   
* `$namespace`: `string`   
* `$name`: `string`   
* `$help`: `string`   
* `$labels`: `array<string, string>`   
* `$maxAgeSeconds`: `int`   
* `$quantiles`: `?non-empty-list<float>`   


#### 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' => '404', 'opcode' => 'SOME_OP']  


#### See also: 
* `double`




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