8000 Simplify example by hardcoding username/password. · dds/client_python@eb9500b · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eb9500b

Browse files
committed
Simplify example by hardcoding username/password.
1 parent 46a9e92 commit eb9500b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,10 @@ you can use a special handler to set the Authorization header.
329329
```python
330330
from prometheus_client import CollectorRegistry, Gauge, push_to_gateway
331331
from prometheus_client.handlers.basic_auth import handler as basic_auth_handler
332-
import os
333332

334333
def my_auth_handler(url, method, timeout, headers, data):
335-
username = os.environ['PUSHGW_USERNAME']
336-
password = os.environ['PUSHGW_PASSWORD']
334+
username = 'foobar'
335+
password = 'secret123'
337336
return basic_auth_handler(url, method, timeout, headers, data, username, password)
338337
registry = CollectorRegistry()
339338
g = Gauge('job_last_success_unixtime', 'Last time a batch job successfully finished', registry=registry)

0 commit comments

Comments
 (0)
0