Commit 79702be
[receiver/prometheusremotewrite] skip emitting empty metrics (#44149)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
We should ideally empty a metric only if it has some datapoints in it.
Right now, we can emit empty metric if the `target_info` arrives first
and normal metrics arrives in subsequent request.
This PR adds a simple check to skip `ConsumeMetrics` if metric count is
0.
<!--Describe what testing was performed and which tests were added.-->
#### Testing
Updated tests
---------
Co-authored-by: Yang Song <[email protected]>1 parent d835619 commit 79702be
File tree
3 files changed
+38
-23
lines changed- .chloggen
- receiver/prometheusremotewritereceiver
3 files changed
+38
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
197 | 201 | | |
198 | 202 | | |
199 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1509 | 1509 | | |
1510 | 1510 | | |
1511 | 1511 | | |
1512 | | - | |
1513 | | - | |
1514 | | - | |
1515 | | - | |
1516 | | - | |
1517 | | - | |
1518 | | - | |
1519 | | - | |
1520 | | - | |
1521 | | - | |
1522 | | - | |
1523 | | - | |
1524 | | - | |
1525 | | - | |
1526 | | - | |
1527 | 1512 | | |
1528 | 1513 | | |
1529 | 1514 | | |
| |||
1568 | 1553 | | |
1569 | 1554 | | |
1570 | 1555 | | |
1571 | | - | |
1572 | | - | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
1573 | 1559 | | |
1574 | | - | |
1575 | | - | |
1576 | 1560 | | |
1577 | 1561 | | |
1578 | 1562 | | |
| |||
1768 | 1752 | | |
1769 | 1753 | | |
1770 | 1754 | | |
1771 | | - | |
1772 | | - | |
1773 | | - | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
1774 | 1758 | | |
1775 | | - | |
| 1759 | + | |
1776 | 1760 | | |
1777 | 1761 | | |
1778 | 1762 | | |
| |||
0 commit comments