20
20
import java .util .HashMap ;
21
21
import java .util .Map ;
22
22
23
- import org .springframework .boot .actuate .metrics .export .prometheus .PrometheusPushGatewayManager .ShutdownOperation ;
24
23
import org .springframework .boot .context .properties .ConfigurationProperties ;
25
24
26
25
/**
@@ -45,12 +44,6 @@ public class PrometheusProperties {
45
44
*/
46
45
private boolean descriptions = true ;
47
46
48
- /**
49
- * Configuration options for using Prometheus Pushgateway, allowing metrics to be
50
- * pushed when they cannot be scraped.
51
- */
52
- private final Pushgateway pushgateway = new Pushgateway ();
53
-
54
47
/**
55
48
* Additional properties to pass to the Prometheus client.
56
49
*/
@@ -85,123 +78,8 @@ public void setEnabled(boolean enabled) {
85
78
this .enabled = enabled ;
86
79
}
87
80
88
- public Pushgateway getPushgateway () {
89
- return this .pushgateway ;
90
- }
91
-
92
81
public Map <String , String > getProperties () {
93
82
return this .properties ;
94
83
}
95
84
96
- /**
97
- * Configuration options for push-based interaction with Prometheus.
98
- */
99
- public static class Pushgateway {
100
-
101
- /**
102
- * Enable publishing over a Prometheus Pushgateway.
103
- */
104
- private Boolean enabled = false ;
105
-
106
- /**
107
- * Base URL for the Pushgateway.
108
- */
109
- private String baseUrl = "http://localhost:9091" ;
110
-
111
- /**
112
- * Login user of the Prometheus Pushgateway.
113
- */
114
- private String username ;
115
-
116
- /**
117
- * Login password of the Prometheus Pushgateway.
118
- */
119
- private String password ;
120
-
121
- /**
122
- * Frequency with which to push metrics.
123
- */
124
- private Duration pushRate = Duration .ofMinutes (1 );
125
-
126
- /**
127
- * Job identifier for this application instance.
128
- */
129
- private String job ;
130
-
131
- /**
132
- * Grouping key for the pushed metrics.
133
- */
134
- private Map <String , String > groupingKey = new HashMap <>();
135
-
136
- /**
137
- * Operation that should be performed on shutdown.
138
- */
139
- private ShutdownOperation shutdownOperation = ShutdownOperation .NONE ;
140
-
141
- public Boolean getEnabled () {
142
- return this .enabled ;
143
- }
144
-
145
- public void setEnabled (Boolean enabled ) {
146
- this .enabled = enabled ;
147
- }
148
-
149
- public String getBaseUrl () {
150
- return this .baseUrl ;
151
- }
152
-
153
- public void setBaseUrl (String baseUrl ) {
154
- this .baseUrl = baseUrl ;
155
- }
156
-
157
- public String getUsername () {
158
- return this .username ;
159
- }
160
-
161
- public void setUsername (String username ) {
162
- this .username = username ;
163
- }
164
-
165
- public String getPassword () {
166
- return this .password ;
167
- }
168
-
169
- public void setPassword (String password ) {
170
- this .password = password ;
171
- }
172
-
173
- public Duration getPushRate () {
174
- return this .pushRate ;
175
- }
176
-
177
- public void setPushRate (Duration pushRate ) {
178
- this .pushRate = pushRate ;
179
- }
180
-
181
- public String getJob () {
182
- return this .job ;
183
- }
184
-
185
- public void setJob (String job ) {
186
- this .job = job ;
187
- }
188
-
189
- public Map <String , String > getGroupingKey () {
190
- return this .groupingKey ;
191
- }
192
-
193
- public void setGroupingKey (Map <String , String > groupingKey ) {
194
- this .groupingKey = groupingKey ;
195
- }
196
-
197
- public ShutdownOperation getShutdownOperation () {
198
- return this .shutdownOperation ;
199
- }
200
-
201
- public void setShutdownOperation (ShutdownOperation shutdownOperation ) {
202
- this .shutdownOperation = shutdownOperation ;
203
- }
204
-
205
- }
206
-
207
85
}
0 commit comments