Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix duplicate typeline for prometheus type #3137

Merged
merged 1 commit into from Mar 29, 2022

Conversation

shoothzj
Copy link
Member

Fixes #3136

Descriptions of the changes in this PR:

Motivation

fix duplicate typeline for prometheus type

Changes

remember the prometheus type, record in set, incase print again

Master Issue: #3136

@shoothzj
Copy link
Member Author

@eolivelli @dlg99 PTAL

@@ -172,6 +172,7 @@ public StatsLogger getStatsLogger(String scope) {

@Override
public void writeAllMetrics(Writer writer) throws IOException {
PrometheusTextFormatUtil.reset();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a sign of something going wrong.

What happens with two concurrent calls to this method?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eolivelli you are right, we don't know what will happen. Let me push a fix.

@shoothzj
Copy link
Member Author

@eolivelli PTAL again thanks, I refractor PrometheusTextFormatUtil to PrometheusTextFormat to make it can serve two concurrent calls.

For an alternate approach, I can add HashSet params to every method in PrometheusTextFormatUtil. I think that the former is better.

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@eolivelli eolivelli merged commit 38dc328 into apache:master Mar 29, 2022
@shoothzj shoothzj deleted the fix-duplicate-type branch May 3, 2022 00:54
hangc0276 pushed a commit to streamnative/bookkeeper-achieved that referenced this pull request May 30, 2023
hangc0276 pushed a commit to hangc0276/bookkeeper that referenced this pull request Jun 26, 2023
@zymap
Copy link
Member

zymap commented Dec 6, 2023

This has already been released since 4.15.0. Remove the 4.15.x label.

@zymap zymap added this to the 4.15.0 milestone Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

second TYPE line for metric name when use metricbeat prometheus module
5 participants