wankai123 opened a new pull request #6495:
URL: https://github.com/apache/skywalking/pull/6495


   ### Support metrics grouped by scope labels in MAL, no need global labels as 
before
   - [ ] If this is non-trivial feature, paste the links/URLs to the design doc.
   - [ ] Update the documentation to include this new feature.
   - [x] Tests(including UT, IT, E2E) are added to verify the new feature.
   - [ ] If it's UI related, attach the screenshots below.
   
   - [ ] If this pull request closes/resolves/fixes an existing issue, replace 
the issue number. Closes #<issue number>.
   - [x] Update the [`CHANGES` 
log](https://github.com/apache/skywalking/blob/master/CHANGES.md).
   
   For example, the metrics data as below:
   ```
   samples=[
   Sample(name=null, labels={idc=t1}, value=50.0, timestamp=0), 
   Sample(name=null, labels={idc=t3, region=cn, svc=catalog}, value=51.0, 
timestamp=0),
   Sample(name=null, labels={idc=t1, region=us, svc=product}, value=50.0, 
timestamp=0), 
   Sample(name=null, labels={idc=t1, region=us, instance=10.0.0.1}, 
value=100.0, timestamp=0), 
   Sample(name=null, labels={idc=t3, region=cn, instance=10.0.0.1}, value=3.0, 
timestamp=0)
   ]
   ```
   The rule is `http_success_request.sum(['idc']).service(['idc'])`
   
   As before,
   MAL would match the label `idc` value `t1` as the `serviceName` set to 
`MeterEntity` from the **first** sample. Obviously it‘s lost `t3` as another 
`serviceName` and `MeterEntity`. MAL can't support this scenario unless all 
samples label `idc` value are `t1`.
   
   After this PR, 
   MAL would group the samples by scope labels, mapping the grouped samples to 
different `MeterEntity`.
   More scenario can see the testcase code in `ScopeTest.java`
   
   


----------------------------------------------------------------
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.

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


Reply via email to