Class PrometheusScrapeEndpoint
java.lang.Object
org.springframework.boot.actuate.metrics.export.prometheus.PrometheusScrapeEndpoint
@Endpoint
that outputs metrics in a format that can be scraped by the
Prometheus server.- Since:
- 2.0.0
- Author:
- Jon Schneider, Johnny Lim, Moritz Halbritter
-
Constructor Summary
ConstructorDescriptionPrometheusScrapeEndpoint
(io.prometheus.metrics.model.registry.PrometheusRegistry prometheusRegistry) Deprecated, for removal: This API element is subject to removal in a future version.PrometheusScrapeEndpoint
(io.prometheus.metrics.model.registry.PrometheusRegistry prometheusRegistry, Properties exporterProperties) Creates a newPrometheusScrapeEndpoint
. -
Method Summary
Modifier and TypeMethodDescriptionWebEndpointResponse<byte[]>
scrape
(PrometheusOutputFormat format, Set<String> includedNames)
-
Constructor Details
-
PrometheusScrapeEndpoint
@Deprecated(since="3.3.1", forRemoval=true) public PrometheusScrapeEndpoint(io.prometheus.metrics.model.registry.PrometheusRegistry prometheusRegistry) Deprecated, for removal: This API element is subject to removal in a future version.since 3.3.1 for removal in 3.5.0 in favor ofPrometheusScrapeEndpoint(PrometheusRegistry, Properties)
Creates a newPrometheusScrapeEndpoint
.- Parameters:
prometheusRegistry
- the Prometheus registry to use
-
PrometheusScrapeEndpoint
public PrometheusScrapeEndpoint(io.prometheus.metrics.model.registry.PrometheusRegistry prometheusRegistry, Properties exporterProperties) Creates a newPrometheusScrapeEndpoint
.- Parameters:
prometheusRegistry
- the Prometheus registry to useexporterProperties
- the properties used to configure Prometheus'ExpositionFormats
- Since:
- 3.3.1
-
-
Method Details
-
scrape
@ReadOperation(producesFrom=PrometheusOutputFormat.class) public WebEndpointResponse<byte[]> scrape(PrometheusOutputFormat format, @Nullable Set<String> includedNames)
-
PrometheusScrapeEndpoint(PrometheusRegistry, Properties)