Metric for label set has incorrect name exposed in multiprocess mode
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 52/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 停滯
- 技術堆疊
- python
研究方向
從 metrics.py 的第 201-210 行附近開始,追蹤 multiprocess collector 如何寫入子指標名稱。使用非空的 namespace、subsystem 和 unit 預設值重現此情況,然後驗證程序檔案中的指標名稱不會被建構兩次,且與預期的完整名稱一致。
由索引模型根據 Issue 內容生成。
描述
The following piece of code from the metrics.py
with self._lock:
if labelvalues not in self._metrics:
self._metrics[labelvalues] = self.__class__(
self._name,
documentation=self._documentation,
labelnames=self._labelnames,
unit=self._unit,
_labelvalues=labelvalues,
**self._kwargs
)
passes the self._name as name parameter in the ctor. The problem is that at this point self._name is actually a full name created by _build_full_name(), for example mynamespace_mysubsystem_mymetric_myunit. Unfortunately, this name undergoes a second round of full name construction. In case of default ctor, where namespace, subsystem and unit all have str = '' default value, this is not a big deal. But if a library user has custom ctor with non-empty default values it causes a pretty weird name to be produced:
mydefaultnamespace_mydefaultsubsystem_mynamespace_mysubsystem_mymetric_myunit_mydefaultunit
Now, in non-multiprocess mode this is not a problem as collector takes the metric name from the parent metric and simply append the child metric labels and values. But multiprocess collector takes what is present in the process files, and those have child metric names.
- 主要語言
- Python
- 星號
- 4.4k
- 分支
- 879
- 平均合併
- 8 天 4 小時
- 30 天內合併 PR
- 1
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
prometheus/client_python 的其他 Issue
-
OpenMetrics content negotiation: `escaping=underscores` causes name mismatch between `HELP/TYPE` metadata and sample lines for metrics with colons可能已有人在做 @johnsaurabh 於 124 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 70/100
prometheus/client_python#1177 · 1 則留言 ·
-
難度 4/5 3-5 天 新手友好度 45/100
prometheus/client_python#1210 ·
-
MultiProcessCollector fails permanently on an empty metrics file left by a killed worker可能已有人在做 @dom111 於 55 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 58/100
prometheus/client_python#1199 · 1 個 reaction ·
-
難度 5/5 一週以上 新手友好度 35/100
prometheus/client_python#1176 ·
-
難度 1/5 1-3 小時 新手友好度 52/100
prometheus/client_python#1126 · 2 則留言 ·
查看 prometheus/client_python 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 3 天內回覆
-
Negation with "not" and "no" is ignored during sentiment analysis可能已有人在做 @vivek-3728 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 68/100
techcsispit/mess-mood#11 · 1 則留言 ·
-
changelog investigate
難度 2/5 1-3 小時 新手友好度 68/100
ramnes/notion-sdk-py#408 ·
-
good first issue
難度 2/5 1-3 小時 新手友好度 83/100
btclib-org/btclib-wallet#267 ·
維護者通常 1 天內回覆
-
good first issue tech-debt
難度 2/5 1-3 小時 新手友好度 85/100
knnmelprop/YAADO#111 ·