@@ -737,6 +737,39 @@ for family in text_string_to_metric_families(u"my_gauge 1.0\n"):
737
737
print (" Name: {0} Labels: {1} Value: {2} " .format(* sample))
738
738
```
739
739
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
+
740
773
# # Links
741
774
742
775
* [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