Class DefaultSampleBuilder
- java.lang.Object
-
- io.prometheus.client.dropwizard.samplebuilder.DefaultSampleBuilder
-
- All Implemented Interfaces:
SampleBuilder
public class DefaultSampleBuilder extends Object implements SampleBuilder
Default implementation ofSampleBuilder. Sanitises the metric name if necessary.- See Also:
Collector.sanitizeMetricName(String)
-
-
Constructor Summary
Constructors Constructor Description DefaultSampleBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.prometheus.client.Collector.MetricFamilySamples.SamplecreateSample(String dropwizardName, String nameSuffix, List<String> additionalLabelNames, List<String> additionalLabelValues, double value)Creates a newCollector.MetricFamilySamples.Samplefor the given parameters.
-
-
-
Constructor Detail
-
DefaultSampleBuilder
public DefaultSampleBuilder()
-
-
Method Detail
-
createSample
public io.prometheus.client.Collector.MetricFamilySamples.Sample createSample(String dropwizardName, String nameSuffix, List<String> additionalLabelNames, List<String> additionalLabelValues, double value)
Description copied from interface:SampleBuilderCreates a newCollector.MetricFamilySamples.Samplefor the given parameters.- Specified by:
createSamplein interfaceSampleBuilder- Parameters:
dropwizardName- Metric name coming from Dropwizard.nameSuffix- Optional suffix to add.additionalLabelNames- Optional additional label names. Needs to have same size as additionalLabelValues.additionalLabelValues- Optional additional label values. Needs to have same size as additionalLabelNames.value- Metric value- Returns:
- A new
Collector.MetricFamilySamples.Sample.
-
-