8000 add restricted registry documentation · prometheus/client_python@f533910 · GitHub
[go: up one dir, main page]

Skip to content

Commit f533910

Browse files
committed
add restricted registry documentation
Signed-off-by: remi <remijouannet@gmail.com>
1 parent 249490e commit f533910

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,39 @@ for family in text_string_to_metric_families(u"my_gauge 1.0\n"):
737737
print("Name: {0} Labels: {1} Value: {2}".format(*sample))
738738
```
739739

740+
## Restricted registry
741+
742+
Registry support querying a specific metric with the GET parameter "name[]".
743+
Since it's an array it can be use multiple times.
744+
745+
```python
746+
curl -v --get --data-urlencode "name[]=python_gc_objects_collected_total" --data-urlencode "name[]=python_info" http://127.0.0.1:9200/metrics
747+
* About to connect() to 127.0.0.1 port 9200 (#0)
748+
* Trying 127.0.0.1...
749+
* Connected to 127.0.0.1 (127.0.0.1) port 9200 (#0)
750+
> GET /metrics?name[]=python_gc_objects_collected_total&name[]=python_info HTTP/1.1
751+
> User-Agent: curl/7.29.0
752+
> Host: 127.0.0.1:9200
753+
> Accept: */*
754+
>
755+
* HTTP 1.0, assume close after body
756+
< HTTP/1.0 200 OK
757+
< Date: Thu, 19 Oct 2023 10:00:38 GMT
758+
< Server: WSGIServer/0.2 CPython/3.9.3
759+
< Content-Type: text/plain; version=0.0.4; charset=utf-8
760+
< Content-Length: 454
761+
<
762+
# HELP python_info Python platform information
763+
# TYPE python_info gauge
764+
python_info{implementation="CPython",major="3",minor="9",patchlevel="3",version="3.9.3"} 1.0
765+
# HELP python_gc_objects_collected_total Objects collected during gc
766+
# TYPE python_gc_objects_collected_total counter
767+
python_gc_objects_collected_total{generation="0"} 73129.0
768+
python_gc_objects_collected_total{generation="1"} 8594.0
769+
python_gc_objects_collected_total{generation="2"} 296.0
770+
* Closing connection 0
771+
```
772+
740773
## Links
741774

742775
* [Releases](https://github.com/prometheus/client_python/releases): The releases page shows the history of the project and acts as a changelog.

0 commit comments

Comments
 (0)
0