Class PrometheusExportUtils
Each OpenCensus MetricDescriptor will be converted to a Prometheus Collector.MetricFamilySamples with no Collector.MetricFamilySamples.Samples, and is used for registering Prometheus
Metrics.
Each OpenCensus Metric will be converted to a Prometheus Collector.MetricFamilySamples,
and each Point of the Metric will be converted to Prometheus Collector.MetricFamilySamples.Samples.
io.opencensus.metrics.export.Value.ValueDouble,
io.opencensus.metrics.export.Value.ValueLong will be converted to a single Collector.MetricFamilySamples.Sample.
io.opencensus.metrics.export.Value.ValueSummary will be converted to two Samples
sum and count. io.opencensus.metrics.export.Value.ValueDistribution will be converted to
a list of Collector.MetricFamilySamples.Samples that have the sum, count and histogram buckets.
LabelKey and LabelValue will be converted to Prometheus LabelName and
LabelValue. Null LabelValue will be converted to an empty string.
Please note that Prometheus Metric and Label name can only have alphanumeric characters and underscore. All other characters will be sanitized by underscores.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static booleancontainsDisallowedLeLabelForHistogram(List<String> labelNames, io.prometheus.client.Collector.Type type) (package private) static booleancontainsDisallowedQuantileLabelForSummary(List<String> labelNames, io.prometheus.client.Collector.Type type) convertToLabelNames(List<LabelKey> labelKeys) (package private) static io.prometheus.client.Collector.MetricFamilySamplescreateDescribableMetricFamilySamples(MetricDescriptor metricDescriptor, String namespace) (package private) static io.prometheus.client.Collector.MetricFamilySamplescreateMetricFamilySamples(Metric metric, String namespace) private static StringgetNamespacedName(String metricName, String namespace) (package private) static List<io.prometheus.client.Collector.MetricFamilySamples.Sample> getSamples(String name, List<String> labelNames, List<LabelValue> labelValuesList, Value value) (package private) static io.prometheus.client.Collector.TypegetType(MetricDescriptor.Type type)
-
Field Details
-
SAMPLE_SUFFIX_BUCKET
- See Also:
-
SAMPLE_SUFFIX_COUNT
- See Also:
-
SAMPLE_SUFFIX_SUM
- See Also:
-
LABEL_NAME_BUCKET_BOUND
- See Also:
-
LABEL_NAME_QUANTILE
- See Also:
-
-
Constructor Details
-
PrometheusExportUtils
private PrometheusExportUtils()
-
-
Method Details
-
createMetricFamilySamples
-
createDescribableMetricFamilySamples
static io.prometheus.client.Collector.MetricFamilySamples createDescribableMetricFamilySamples(MetricDescriptor metricDescriptor, String namespace) -
getNamespacedName
-
getType
-
getSamples
-
convertToLabelNames
-
containsDisallowedLeLabelForHistogram
-
containsDisallowedQuantileLabelForSummary
-