Class PushGateway.Builder
Object
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.Thejob
label to be used when pushing metrics.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.address
property. -
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.scheme
property. -
connectionFactory
Custom connection factory. Default isDefaultHttpConnectionFactory
.The
PushGatewayTestApp
inintegration-tests/it-pushgateway/
has an example of a custom connection factory that skips SSL certificate validation for HTTPS connections. -
job
Thejob
label 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.job
property. -
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
Push metrics from this registry instead ofPrometheusRegistry.defaultRegistry
. -
build
-