[Bug] Prometheus metrics format bug
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 64/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- grafana, java, prometheus
- Área
- observability
Línea de trabajo
Locate the metric-name processing methods replaceSlashInKey and replaceDotDashInKey shown in the issue, then trace where hugegraph-server builds the /metrics output. Reproduce a Prometheus scrape with a metric containing '~' and verify that the exposed names use valid characters and are parsed successfully.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug Type (问题类型)
None
Before submit
- 我已经确认现有的 Issues 与 FAQ 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)
Environment (环境信息)
3 pd
3 server
5 store
Expected & Actual behavior (期望与实际表现)
I pulled the latest version of the HugeGraph source code, compiled and deployed it, and then deployed a Prometheus + Grafana monitoring environment.
During the monitoring test, I found that the metrics exposed by hugegraph-server (/metrics) could not be scraped correctly by Prometheus. After checking the logs, I found that some metric names contained the illegal character ~, which does not comply with the Prometheus metric naming specification. As a result, Prometheus failed to parse the metrics data, causing the server monitoring metrics collection to fail.
I located the issue in the metric name processing logic and modified the related code to correctly replace the illegal characters in metric names. After recompiling and redeploying HugeGraph Server, the metrics format was fixed, and Prometheus was able to successfully scrape the server monitoring metrics.
public static String replaceSlashInKey(String orgKey) {
return orgKey.replace("/", "_");
}
->
public static String replaceSlashInKey(String orgKey) {
return orgKey.replace("/", "_").replace("~", "_");
}
I also modified the following code section. However, I am not sure whether this change has any effect. What I can confirm is that the code above definitely needs to be modified, because I first modified the code below, recompiled and redeployed the project, but the issue still occurred. After modifying the code above, recompiling and redeploying HugeGraph Server successfully resolved the problem.
public static String replaceDotDashInKey(String orgKey) {
return orgKey.replace(".", "").replace("-", "").replace("/", "").replace("$", "");
}
->
public static String replaceDotDashInKey(String orgKey) {
return orgKey.replace(".", "").replace("-", "").replace("/", "").replace("$", "").replace("~", "_");
}
Vertex/Edge example (问题点 / 边数据举例)
Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
- Lenguaje dominante
- Java
- Estrellas
- 3.2k
- Forks
- 637
- Merge medio
- 3 d 21 h
- PR fusionados (30 d)
- 21
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/hugegraph
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
apache/hugegraph#3231 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 2 días
-
apache help wanted
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
apache/hugegraph#3242 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 2 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
apache/hugegraph#3238 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
Todos los issues de apache/hugegraph
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
beehive-lab/TornadoVM#1151 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
(cbor) `maxStringLength` not consistently checked for chunked (indefinite-length) text valuesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
FasterXML/jackson-dataformats-binary#823 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día