Class Exporter
java.lang.Object
io.prometheus.client.servlet.common.exporter.Exporter
The MetricsServlet class exists to provide a simple way of exposing the metrics values.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
private CollectorRegistry
-
Constructor Summary
ConstructorsConstructorDescriptionExporter
(CollectorRegistry registry, Predicate<String> sampleNameFilter) Construct a MetricsServlet for the given registry. -
Method Summary
-
Field Details
-
NAME_MUST_BE_EQUAL_TO
- See Also:
-
NAME_MUST_NOT_BE_EQUAL_TO
- See Also:
-
NAME_MUST_START_WITH
- See Also:
-
NAME_MUST_NOT_START_WITH
- See Also:
-
registry
-
sampleNameFilter
-
-
Constructor Details
-
Exporter
Construct a MetricsServlet for the given registry.- Parameters:
registry
- collector registrysampleNameFilter
- programmatically set aSampleNameFilter
. If there are any filter options configured inServletConfig
, they will be merged so that samples need to pass both filters to be exported. sampleNameFilter may benull
indicating that nothing should be filtered.
-
-
Method Details
-
init
- Throws:
ServletConfigurationException
-
doGet
public void doGet(HttpServletRequestAdapter req, HttpServletResponseAdapter resp) throws IOException - Throws:
IOException
-
parse
-
doPost
public void doPost(HttpServletRequestAdapter req, HttpServletResponseAdapter resp) throws IOException - Throws:
IOException
-