Add a metric to the metric family. Args: labels: A list of label values value: A float
(self, labels: Sequence[str], value: float, timestamp: Optional[Union[Timestamp, float]] = None)
| 168 | self.add_metric([], value) |
| 169 | |
| 170 | def add_metric(self, labels: Sequence[str], value: float, timestamp: Optional[Union[Timestamp, float]] = None) -> None: |
| 171 | """Add a metric to the metric family. |
| 172 | |
| 173 | Args: |
| 174 | labels: A list of label values |
| 175 | value: A float |
| 176 | """ |
| 177 | self.samples.append(Sample(self.name, dict(zip(self._labelnames, labels)), value, timestamp)) |
| 178 | |
| 179 | |
| 180 | class SummaryMetricFamily(Metric): |