Package com.persequor.extension.metrics
Interface IMetric
- All Known Implementing Classes:
Metric
public interface IMetric
Represent one measurement of a metric. This is inspired by Prometheus Metric Types.
TODO: Find out how to handle
Histogram
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
This must be set when a metric is node specific -
Method Summary
Modifier and TypeMethodDescriptiongetId()
The id of the metric, this must be unique.getValue()
Add a labelAdd a suffix to be appended at the end of the metric name like so example_metric -> example_metric_suffix An example suffix is _avg so example_metric -> example_metric_avg This does not affect the IMetricFamily name.
-
Field Details
-
PARAM_NODE_ID
This must be set when a metric is node specific- See Also:
-
-
Method Details
-
getId
String getId()The id of the metric, this must be unique.- Returns:
- the unique id of the metric
-
getSuffix
String getSuffix() -
getTimestamp
Instant getTimestamp()- Returns:
- When the measurement was made.
-
getValue
Object getValue()- Returns:
- the value of the measurement/metric.
-
getLabels
ILabelList getLabels()- Returns:
- Additional parameters for the metric/measurement
-
getMetricFamily
IMetricFamily getMetricFamily() -
suffix
Add a suffix to be appended at the end of the metric name like so example_metric -> example_metric_suffix An example suffix is _avg so example_metric -> example_metric_avg This does not affect the IMetricFamily name.- Parameters:
suffix
- - The suffix to be appended. Should follow the OpenMetrics specification.- Returns:
- the IMetric with the added suffix
-
label
Add a label- Parameters:
name
- - name of the labelvalue
- - value of the label- Returns:
- the IMetric instance containing the added label
-