CSoulode opened a new pull request, #61420:
URL: https://github.com/apache/doris/pull/61420

   issue: #60791
   
   Add missing labels for compaction task state and compaction io metrics to 
avoid duplicate Prometheus time series.
   
   ### What problem does this PR solve?
   
   Issue Number: close #60791 
   
   Related PR: #N/A
   
   Problem Summary:
   
   This PR fixes duplicate Prometheus time series exported by BE compaction 
metrics.
   
   Although issue #60791 was reported in compute-storage decoupled mode, the 
root cause is not specific to cloud mode itself. The duplicate series come from 
shared BE metric definitions/export semantics, where multiple internal metrics 
were exported with the same metric name and the same label set.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [ ] Regression test
       - [ ] Unit Test
       - [x] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason <!-- Add your reason?  -->
   
   Manual test:
   1. Start a local Doris cluster and prepare a tablet with compaction 
candidates.
   2. Trigger cumulative compaction:
   ```bash
   curl -X POST 
"http://$BE_HOST:$BE_HTTP/api/compaction/run?tablet_id=$TABLET_ID&compact_type=cumulative";
   ```
   3. Check exported compaction task metrics:
   ```bash
   curl -s "http://$BE_HOST:$BE_HTTP/metrics"; \
     | grep '^doris_be_compaction_task_state_total' \
     | sed -E 's/ [^ ]+$//' \
     | sort \
     | uniq -c
   ```
   Before:
   ```text
   2 doris_be_compaction_task_state_total{type="base"}
   2 doris_be_compaction_task_state_total{type="cumulative"}
   ```
   After:
   ```text
   1 doris_be_compaction_task_state_total{state="pending",type="base"}
   1 doris_be_compaction_task_state_total{state="pending",type="cumulative"}
   1 doris_be_compaction_task_state_total{state="running",type="base"}
   1 doris_be_compaction_task_state_total{state="running",type="cumulative"}
   ```
   
   - Behavior changed:
       - [ ] No.
       - [x] Yes. <!-- Explain the behavior change --> The exported metric 
labels in /metrics are changed to avoid duplicate Prometheus series.
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes. <!-- Add document PR link here. eg: 
https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should 
merge into -->
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to