Class PushGateway.Builder
java.lang.Object
io.prometheus.metrics.exporter.pushgateway.PushGateway.Builder
- Enclosing class:
- PushGateway
-
Method Summary
Modifier and TypeMethodDescriptionAddress of the Pushgateway in formathost:port.Username and password for HTTP basic auth when pushing to the Pushgateway.bearerToken(String token) Bearer token authorization when pushing to the Pushgateway.build()connectionFactory(HttpConnectionFactory connectionFactory) Custom connection factory.Default isFormat.PROMETHEUS_PROTOBUF.groupingKey(String name, String value) Grouping keys to be used when pushing/deleting metrics.Convenience method for adding the current IP address as an "instance" label.Thejoblabel to be used when pushing metrics.registry(io.prometheus.metrics.model.registry.PrometheusRegistry registry) Push metrics from this registry instead ofPrometheusRegistry.defaultRegistry.Specify if metrics should be pushed using HTTP or HTTPS.
-
Method Details
-
format
Default isFormat.PROMETHEUS_PROTOBUF. -
address
Address of the Pushgateway in formathost:port. Default islocalhost:9091. Can be overwritten at runtime with theio.prometheus.exporter.pushgateway.addressproperty. -
basicAuth
Username and password for HTTP basic auth when pushing to the Pushgateway. -
bearerToken
Bearer token authorization when pushing to the Pushgateway. -
scheme
Specify if metrics should be pushed using HTTP or HTTPS. Default is HTTP. Can be overwritten at runtime with theio.prometheus.exporter.pushgateway.schemeproperty. -
connectionFactory
Custom connection factory. Default isDefaultHttpConnectionFactory.The
PushGatewayTestAppinintegration-tests/it-pushgateway/has an example of a custom connection factory that skips SSL certificate validation for HTTPS connections. -
job
Thejoblabel to be used when pushing metrics. If not provided, the name of the JAR file will be used by default. Can be overwritten at runtime with theio.prometheus.exporter.pushgateway.jobproperty. -
groupingKey
Grouping keys to be used when pushing/deleting metrics. Call this method multiple times for adding multiple grouping keys. -
instanceIpGroupingKey
Convenience method for adding the current IP address as an "instance" label.- Throws:
UnknownHostException
-
registry
public PushGateway.Builder registry(io.prometheus.metrics.model.registry.PrometheusRegistry registry) Push metrics from this registry instead ofPrometheusRegistry.defaultRegistry. -
build
-