Commit 5d3ca01
Allow creation of Metric from data structure without __name__ (#306)
* Allow creation of Metric from datastructure without __name__
When applying a function to a time series in a query to Prometheus,
the Prometheus server returns a data structure without __name__ key.
Apart from that aspect, the time series could still be used to create
a Metric object.
This PR proposes to set "metric_name" to None when __name__ is missing.
* Update prometheus_api_client/metric.py
Co-authored-by: Copilot <[email protected]>
---------
Co-authored-by: Anand Sanmukhani <[email protected]>
Co-authored-by: Copilot <[email protected]>1 parent 61adf20 commit 5d3ca01
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | | - | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
0 commit comments