Skip to content

Commit cb6f2e3

Browse files
committed
update readme
1 parent 7ec4d00 commit cb6f2e3

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

README.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,28 @@ This is a first pass at a Python client for Prometheus.
55
## Installation
66

77
```
8-
easy_install prometheus_client
8+
pip install prometheus_client
99
```
1010

1111
## Example Usage
1212

1313
```python
14-
c = Counter('cc', 'A counter')
15-
c.inc()
14+
from prometheus_client import *
15+
from prometheus_client import MetricsHandler
1616

17-
g = Gauge('gg', 'A gauge')
18-
g.set(17)
17+
c = Counter('cc', 'A counter')
18+
c.inc()
1919

20-
s = Summary('ss', 'A summary', ['a', 'b'])
21-
s.labels('c', 'd').observe(17)
20+
g = Gauge('gg', 'A gauge')
21+
g.set(17)
2222

23-
from BaseHTTPServer import HTTPServer
24-
server_address = ('', 8000)
25-
httpd = HTTPServer(server_address, MetricsHandler)
26-
httpd.serve_forever()
23+
s = Summary('ss', 'A summary', ['a', 'b'])
24+
s.labels('c', 'd').observe(17)
25+
26+
from BaseHTTPServer import HTTPServer
27+
server_address = ('', 8000)
28+
httpd = HTTPServer(server_address, MetricsHandler)
29+
httpd.serve_forever()
2730
```
31+
32+
Visit http://localhost:8000/ to view the metrics.

0 commit comments

Comments
 (0)