-
Notifications
You must be signed in to change notification settings - Fork 842
Closed
Description
ENV
tls_auth_handler_demo.py --> code form README.md
from prometheus_client import CollectorRegistry, Gauge, push_to_gateway
from prometheus_client.exposition import tls_handler
def my_auth_handler(url, method, timeout, headers, data):
certfile = 'client-crt.pem'
keyfile = 'client-key.pem'
return tls_auth_handler(url, method, timeout, headers, data, certfile, keyfile)
registry = CollectorRegistry()
g = Gauge('job_last_success_unixtime', 'Last time a batch job successfully finished', registry=registry)
g.set_to_current_time()
push_to_gateway('localhost:9091', job='batchA', registry=registry, handler=my_auth_handler)python tls_auth_handle_demo.pyLOG
Traceback (most recent call last):
File "/private/tmp/tls_auth_handler_demo.py", line 2, in <module>
from prometheus_client.exposition import tls_handler
ImportError: cannot import name 'tls_handler' from 'prometheus_client.exposition' (/private/tmp/venv/lib/python3.9/site-packages/prometheus_client/exposition.py)SHOULD BE
Line 490 in 4ab083e
| from prometheus_client.exposition import tls_handler |
update to
from prometheus_client.exposition import tls_auth_handlerReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels