fix(buffers): buffer_id handling in buffer usage metrics reporting#23507
fix(buffers): buffer_id handling in buffer usage metrics reporting#23507pront merged 6 commits intovectordotdev:masterfrom
Conversation
Signed-off-by: Vitalii Parfonov <vparfono@redhat.com>
Signed-off-by: Vitalii Parfonov <vparfono@redhat.com>
|
I've dug into the counter data usage here, and I'm wondering if the whole Thinking further, this would suggest those values could be lifted into What do you think? |
Maybe it makes sense — the main win would be removing AtomicI64. |
Actually, the main I was thinking of is removing the global
If I'm not mistaken, the events that update the counters are only emitted from the reporting loop, and so such a move does not change the behavior. Are the counters updated elsewhere? |
i mean this one: |
|
Right. I was saying that that loop is the only place that the metrics I am referring to are emitted. That is, it appears they are currently only emitted every two seconds, and I didn't see anything in the changes here or previously that alter that behavior. |
Ok, let me review the code again to be sure. From what I understand, since metrics are only emitted every 2 seconds (regardless of when the underlying counts change), we could move the counters inside the loop. I need some time to figured out how to avoid using HashMap. It does sound reasonable and should make code better |
@bruceg Please take a look #23518 |
There was a problem hiding this comment.
Per #23507 (comment) - approving this to make sure we have the fix in before the next release. I do agree this PR #23518 addresses the issue in a better/cleaner way. We can obviously review that PR independently later.
Signed-off-by: Vitalii Parfonov <vparfono@redhat.com>
…ectordotdev#23507) * buffer_id handling in buffer usage metrics reporting Signed-off-by: Vitalii Parfonov <vparfono@redhat.com> * fix 'cargo clippy' warn Signed-off-by: Vitalii Parfonov <vparfono@redhat.com> * add changelog fragments to changelog.d Signed-off-by: Vitalii Parfonov <vparfono@redhat.com> * cargo fmt * remove changelog - no need to explain bug fix for unreleased change --------- Signed-off-by: Vitalii Parfonov <vparfono@redhat.com> Co-authored-by: Pavlos Rontidis <pavlos.rontidis@gmail.com>
…ectordotdev#23507) * buffer_id handling in buffer usage metrics reporting Signed-off-by: Vitalii Parfonov <vparfono@redhat.com> * fix 'cargo clippy' warn Signed-off-by: Vitalii Parfonov <vparfono@redhat.com> * add changelog fragments to changelog.d Signed-off-by: Vitalii Parfonov <vparfono@redhat.com> * cargo fmt * remove changelog - no need to explain bug fix for unreleased change --------- Signed-off-by: Vitalii Parfonov <vparfono@redhat.com> Co-authored-by: Pavlos Rontidis <pavlos.rontidis@gmail.com>
…ectordotdev#23507) * buffer_id handling in buffer usage metrics reporting Signed-off-by: Vitalii Parfonov <vparfono@redhat.com> * fix 'cargo clippy' warn Signed-off-by: Vitalii Parfonov <vparfono@redhat.com> * add changelog fragments to changelog.d Signed-off-by: Vitalii Parfonov <vparfono@redhat.com> * cargo fmt * remove changelog - no need to explain bug fix for unreleased change --------- Signed-off-by: Vitalii Parfonov <vparfono@redhat.com> Co-authored-by: Pavlos Rontidis <pavlos.rontidis@gmail.com>
…ectordotdev#23507) * buffer_id handling in buffer usage metrics reporting Signed-off-by: Vitalii Parfonov <vparfono@redhat.com> * fix 'cargo clippy' warn Signed-off-by: Vitalii Parfonov <vparfono@redhat.com> * add changelog fragments to changelog.d Signed-off-by: Vitalii Parfonov <vparfono@redhat.com> * cargo fmt * remove changelog - no need to explain bug fix for unreleased change --------- Signed-off-by: Vitalii Parfonov <vparfono@redhat.com> Co-authored-by: Pavlos Rontidis <pavlos.rontidis@gmail.com>
Summary
This change improves how the
buffer_idis used in buffer usage metrics. It ensures thebuffer_idis properly owned and has the right lifetime to be safely included as a label in emitted metrics.Change Type
Is this a breaking change?
Does this PR include user facing changes?
no-changeloglabel to this PR.References