Search before asking
Version
master (573c93c)
What's Wrong?
In MetricRepo, the counter HTTP_COUNTER_COPY_INFO_QUERY_ERR is registered with the name of the upload error counter:
|
HTTP_COUNTER_COPY_INFO_UPLOAD_ERR = new LongCounterMetric("http_copy_into_upload_err_total", |
|
MetricUnit.REQUESTS, "http copy into upload err request"); |
|
DORIS_METRIC_REGISTER.addMetrics(HTTP_COUNTER_COPY_INFO_UPLOAD_ERR); |
|
HTTP_COUNTER_COPY_INFO_QUERY_REQUEST = new LongCounterMetric("http_copy_into_query_request_total", |
|
MetricUnit.REQUESTS, "http copy into total query request"); |
|
DORIS_METRIC_REGISTER.addMetrics(HTTP_COUNTER_COPY_INFO_QUERY_REQUEST); |
|
HTTP_COUNTER_COPY_INFO_QUERY_ERR = new LongCounterMetric("http_copy_into_upload_err_total", |
|
MetricUnit.REQUESTS, "http copy into err query request"); |
|
DORIS_METRIC_REGISTER.addMetrics(HTTP_COUNTER_COPY_INFO_QUERY_ERR); |
HTTP_COUNTER_COPY_INFO_UPLOAD_ERR = new LongCounterMetric("http_copy_into_upload_err_total",
MetricUnit.REQUESTS, "http copy into upload err request");
...
HTTP_COUNTER_COPY_INFO_QUERY_ERR = new LongCounterMetric("http_copy_into_upload_err_total",
MetricUnit.REQUESTS, "http copy into err query request");
DorisMetricRegistry keys metrics by name and labels, and MetricList.addMetrics replaces an existing entry with the same key:
|
public void addMetrics(Metric metric) { |
|
// No metric needs to be added to the Checkpoint thread. |
|
// And if you add a metric in Checkpoint thread, it will cause the metric to be added repeatedly, |
|
// and the Checkpoint Catalog may be saved incorrectly, resulting in FE memory leaks. |
|
if (!Env.isCheckpointThread()) { |
|
String labelId = computeLabelId(metric.getLabels()); |
|
metrics.computeIfAbsent(metric.getName(), (k) -> new MetricList()) |
|
.addMetrics(labelId, metric); |
|
} |
|
} |
The query error counter is registered second, so it replaces the upload error counter. As a result:
doris_fe_http_copy_into_upload_err_total reports the query error count.
- The upload error count is never exported.
CopyIntoAction still increments HTTP_COUNTER_COPY_INFO_UPLOAD_ERR, but the registry no longer holds it.
doris_fe_http_copy_into_query_err_total does not exist.
CopyIntoAction increments HTTP_COUNTER_COPY_INFO_QUERY_ERR only on the query path, so the counter is correct but its name is wrong.
What You Expected?
The query error counter is exported as doris_fe_http_copy_into_query_err_total, which matches the naming of the other three copy-into counters (http_copy_into_upload_request_total, http_copy_into_upload_err_total, http_copy_into_query_request_total).
How to Reproduce?
- Start an FE.
- Run
curl http://<fe_host>:<http_port>/metrics | grep http_copy_into.
doris_fe_http_copy_into_upload_err_total appears once and counts query errors. doris_fe_http_copy_into_query_err_total does not appear.
Anything Else?
No response
Are you willing to submit PR?
Code of Conduct
Search before asking
Version
master (573c93c)
What's Wrong?
In
MetricRepo, the counterHTTP_COUNTER_COPY_INFO_QUERY_ERRis registered with the name of the upload error counter:doris/fe/fe-core/src/main/java/org/apache/doris/metric/MetricRepo.java
Lines 834 to 842 in 573c93c
DorisMetricRegistrykeys metrics by name and labels, andMetricList.addMetricsreplaces an existing entry with the same key:doris/fe/fe-core/src/main/java/org/apache/doris/metric/DorisMetricRegistry.java
Lines 42 to 51 in 573c93c
The query error counter is registered second, so it replaces the upload error counter. As a result:
doris_fe_http_copy_into_upload_err_totalreports the query error count.CopyIntoActionstill incrementsHTTP_COUNTER_COPY_INFO_UPLOAD_ERR, but the registry no longer holds it.doris_fe_http_copy_into_query_err_totaldoes not exist.CopyIntoActionincrementsHTTP_COUNTER_COPY_INFO_QUERY_ERRonly on the query path, so the counter is correct but its name is wrong.What You Expected?
The query error counter is exported as
doris_fe_http_copy_into_query_err_total, which matches the naming of the other three copy-into counters (http_copy_into_upload_request_total,http_copy_into_upload_err_total,http_copy_into_query_request_total).How to Reproduce?
curl http://<fe_host>:<http_port>/metrics | grep http_copy_into.doris_fe_http_copy_into_upload_err_totalappears once and counts query errors.doris_fe_http_copy_into_query_err_totaldoes not appear.Anything Else?
No response
Are you willing to submit PR?
Code of Conduct