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][metrics]wrong metrics text generated when label_cluster specified #17704

Merged
merged 3 commits into from
Sep 27, 2022

Conversation

poorbarcode
Copy link
Contributor

@poorbarcode poorbarcode commented Sep 17, 2022

Motivation

If label_cluster specified cluster_123, the expected metrics text is:

metrics_xxx_total{cluster="cluster_123"} 1.0

but the actual metrics text is :

metrics_xxx_totalcluster="cluster_123"} 1.0

High light: lost a char {

Modifications

Make metrics text generate correct

Documentation

  • doc-required

  • doc-not-needed

  • doc

  • doc-complete

Matching PR in forked repository

PR in forked repository:

@github-actions
Copy link

@poorbarcode Please provide a correct documentation label for your PR.
Instructions see Pulsar Documentation Label Guide.

@poorbarcode
Copy link
Contributor Author

poorbarcode commented Sep 17, 2022

This PR should merge into the following branches:

  • master
  • branch-2.11
  • branch-2.10

@github-actions github-actions bot added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Sep 17, 2022
Copy link
Contributor

@tjiuming tjiuming left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -67,14 +68,21 @@ public static void generateSystemMetrics(SimpleTextOutputStream stream, String c
stream.write(sample.name);
if (!sample.labelNames.contains("cluster")) {
Copy link
Contributor

@gaoran10 gaoran10 Sep 19, 2022

Choose a reason for hiding this comment

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

Maybe we can add this stream.write("{"); before the check if (!sample.labelNames.contains("cluster")). The symbol { is necessary and it's easier to understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good idea. The code has been changed

Copy link
Contributor

@gaoran10 gaoran10 left a comment

Choose a reason for hiding this comment

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

LGTM

import java.util.Collections;
import java.util.UUID;
import org.testng.annotations.Test;

Copy link
Contributor

@gaoran10 gaoran10 Sep 19, 2022

Choose a reason for hiding this comment

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

Please add the test group.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already add test group

@poorbarcode
Copy link
Contributor Author

/pulsarbot rerun-failure-checks

@poorbarcode
Copy link
Contributor Author

/pulsarbot rerun-failure-checks

@poorbarcode
Copy link
Contributor Author

Hi @Technoboy-

Can this PR merge? (^_^)

@nodece nodece merged commit 518cdcd into apache:master Sep 27, 2022
@poorbarcode poorbarcode deleted the fix/metrics_generate branch September 27, 2022 17:30
liangyepianzhou pushed a commit that referenced this pull request Dec 5, 2022
…ed (#17704)

* [fix][metrics]wrong metrics text generated when label_cluster specified

* improve logic branch

* mark test group

(cherry picked from commit 518cdcd)
liangyepianzhou added a commit that referenced this pull request Dec 5, 2022
liangyepianzhou added a commit that referenced this pull request Dec 15, 2022
…ster specified (#17704) (#18919)

Co-authored-by: fengyubiao <yubiao.feng@streamnative.io>
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 10, 2023
…ster specified (apache#17704) (apache#18919)

Co-authored-by: fengyubiao <yubiao.feng@streamnative.io>
(cherry picked from commit a530ab2)
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 11, 2023
…ster specified (apache#17704) (apache#18919)

Co-authored-by: fengyubiao <yubiao.feng@streamnative.io>
(cherry picked from commit a530ab2)
Technoboy- pushed a commit that referenced this pull request Feb 8, 2023
…ed (#17704)

* [fix][metrics]wrong metrics text generated when label_cluster specified

* improve logic branch

* mark test group
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.

8 participants