@@ -130,6 +130,30 @@ def push_to_gateway(gateway, job, registry, grouping_key=None, timeout=None, han
130
130
Defaults to None
131
131
`timeout` is how long push will attempt to connect before giving up.
132
132
Defaults to None
133
+ `handler` is an optional function which can be provided to perform
134
+ requests to the 'gateway'.
135
+ Defaults to None, in which case an http or https request
136
+ will be carried out by a default handler.
137
+ If not None, the argument must be a function which accepts
138
+ the following arguments:
139
+ url, method, timeout, headers, and content
140
+ May be used to implement additional functionality not
141
+ supported by the built-in default handler (such as SSL
142
+ client certicates, and HTTP authentication mechanisms).
143
+ 'url' is the URL for the request, the 'gateway' argument
144
+ described earlier will form the basis of this URL.
145
+ 'method' is the HTTP method which should be used when
146
+ carrying out the request.
147
+ 'timeout' requests not successfully completed after this
148
+ many seconds should be aborted. If timeout is None, then
149
+ the handler should not set a timeout.
150
+ 'headers' is a list of ("header-name","header-value") tuples
151
+ which must be passed to the pushgateway in the form of HTTP
152
+ request headers.
153
+ The function should raise an exception (e.g. IOError) on
154
+ failure.
155
+ 'content' is the data which should be used to form the HTTP
156
+ Message Body.
133
157
134
158
This overwrites all metrics with the same job and grouping_key.
135
159
This uses the PUT HTTP method.'''
@@ -148,6 +172,12 @@ def pushadd_to_gateway(gateway, job, registry, grouping_key=None, timeout=None,
148
172
Defaults to None
149
173
`timeout` is how long push will attempt to connect before giving up.
150
174
Defaults to None
175
+ `handler` is an optional function which can be provided to perform
176
+ requests to the 'gateway'.
177
+ Defaults to None, in which case an http or https request
178
+ will be carried out by a default handler.
179
+ See the 'prometheus_client.push_to_gateway' documentation
180
+ for implementation requirements.
151
181
152
182
This replaces metrics with the same name, job and grouping_key.
153
183
This uses the POST HTTP method.'''
@@ -165,6 +195,12 @@ def delete_from_gateway(gateway, job, grouping_key=None, timeout=None, handler=N
165
195
Defaults to None
166
196
`timeout` is how long delete will attempt to connect before giving up.
167
197
Defaults to None
198
+ `handler` is an optional function which can be provided to perform
199
+ requests to the 'gateway'.
200
+ Defaults to None, in which case an http or https request
201
+ will be carried out by a default handler.
202
+ See the 'prometheus_client.push_to_gateway' documentation
203
+ for implementation requirements.
168
204
169
205
This deletes metrics with the given job and grouping_key.
170
206
This uses the DELETE HTTP method.'''
0 commit comments