Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.HashMap;
import java.util.Map;

import org.springframework.boot.actuate.metrics.export.prometheus.PrometheusPushGatewayManager.ShutdownOperation;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
Expand All @@ -45,12 +44,6 @@ public class PrometheusProperties {
*/
private boolean descriptions = true;

/**
* Configuration options for using Prometheus Pushgateway, allowing metrics to be
* pushed when they cannot be scraped.
*/
private final Pushgateway pushgateway = new Pushgateway();

/**
* Additional properties to pass to the Prometheus client.
*/
Expand Down Expand Up @@ -85,123 +78,8 @@ public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

public Pushgateway getPushgateway() {
return this.pushgateway;
}

public Map<String, String> getProperties() {
return this.properties;
}

/**
* Configuration options for push-based interaction with Prometheus.
*/
public static class Pushgateway {

/**
* Enable publishing over a Prometheus Pushgateway.
*/
private Boolean enabled = false;

/**
* Base URL for the Pushgateway.
*/
private String baseUrl = "http://localhost:9091";

/**
* Login user of the Prometheus Pushgateway.
*/
private String username;

/**
* Login password of the Prometheus Pushgateway.
*/
private String password;

/**
* Frequency with which to push metrics.
*/
private Duration pushRate = Duration.ofMinutes(1);

/**
* Job identifier for this application instance.
*/
private String job;

/**
* Grouping key for the pushed metrics.
*/
private Map<String, String> groupingKey = new HashMap<>();

/**
* Operation that should be performed on shutdown.
*/
private ShutdownOperation shutdownOperation = ShutdownOperation.NONE;

public Boolean getEnabled() {
return this.enabled;
}

public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}

public String getBaseUrl() {
return this.baseUrl;
}

public void setBaseUrl(String baseUrl) {
this.baseUrl = baseUrl;
}

public String getUsername() {
return this.username;
}

public void setUsername(String username) {
this.username = username;
}

public String getPassword() {
return this.password;
}

public void setPassword(String password) {
this.password = password;
}

public Duration getPushRate() {
return this.pushRate;
}

public void setPushRate(Duration pushRate) {
this.pushRate = pushRate;
}

public String getJob() {
return this.job;
}

public void setJob(String job) {
this.job = job;
}

public Map<String, String> getGroupingKey() {
return this.groupingKey;
}

public void setGroupingKey(Map<String, String> groupingKey) {
this.groupingKey = groupingKey;
}

public ShutdownOperation getShutdownOperation() {
return this.shutdownOperation;
}

public void setShutdownOperation(ShutdownOperation shutdownOperation) {
this.shutdownOperation = shutdownOperation;
}

}

}
Loading