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