Class PrometheusRegistry
java.lang.Object
io.prometheus.metrics.model.registry.PrometheusRegistry
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classStores the registration details for a Collector at registration time.private static classStores the registration details for a single metric within a MultiCollector.private static classTracks registration information for each metric name to enable validation of type consistency, label schema uniqueness, and help/unit consistency. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ConcurrentHashMap<Collector, PrometheusRegistry.CollectorRegistration> static final PrometheusRegistryprivate final ConcurrentHashMap<MultiCollector, List<PrometheusRegistry.MultiCollectorRegistration>> private final Set<MultiCollector> private final ConcurrentHashMap<String, PrometheusRegistry.RegistrationInfo> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()immutableLabelNames(Set<String> labelNames) Returns an immutable set of label names for storage.voidvoidregister(MultiCollector collector) scrape()scrape(PrometheusScrapeRequest scrapeRequest) scrape(Predicate<String> includedNames, PrometheusScrapeRequest scrapeRequest) voidunregister(Collector collector) voidunregister(MultiCollector collector) private voidunregisterLabelSchema(String prometheusName, Set<String> labelNames) Removes the label schema for the given metric name.private voidvalidateRegistration(String prometheusName, MetricType metricType, Set<String> normalizedLabels, String help, Unit unit) Validates the registration of a metric with the given parameters.
-
Field Details
-
defaultRegistry
-
collectors
-
multiCollectors
-
registered
-
collectorMetadata
private final ConcurrentHashMap<Collector, PrometheusRegistry.CollectorRegistration> collectorMetadata -
multiCollectorMetadata
private final ConcurrentHashMap<MultiCollector, List<PrometheusRegistry.MultiCollectorRegistration>> multiCollectorMetadata
-
-
Constructor Details
-
PrometheusRegistry
public PrometheusRegistry()
-
-
Method Details
-
immutableLabelNames
-
validateRegistration
-
register
-
register
-
unregister
-
unregister
-
unregisterLabelSchema
-
clear
public void clear() -
scrape
-
scrape
-
scrape
-
scrape
public MetricSnapshots scrape(Predicate<String> includedNames, PrometheusScrapeRequest scrapeRequest)
-