wankai123 opened a new pull request #6864: URL: https://github.com/apache/skywalking/pull/6864
### Fix MAL function would miss samples name after creating new samples. - [X] Add a unit test to verify that the fix works. - [X] Explain briefly why the bug exists and how to fix it. - [X] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #6857 - [X] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/CHANGES.md). When MAL do `aggregate` like `sum/max/min` or do `avg`/`histogram`, there used `InternalOps.newSample`. But this function missed the samples name:  That is impacted the `rate/irate/increase` functions because when we do increase count we use sample `name` and `labels` as the `id` to separate the samples.  So, in some scenario, for example: ```yaml - name: cpu_total_percentage exp: (node_cpu_seconds_total * 100).tagNotEqual('mode' , 'idle').sum(['node_identifier_host_name']).rate('PT1M') - name: disk_written exp: node_disk_written_bytes_total.sum(['node_identifier_host_name']).rate('PT1M') ``` These 2 expressions will make the samples have the same labels if the sample name missed the `id` above would the same. The cache and calculate of the value would incorrect, this caused issue #6857. -- 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]
