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

PMM-9403 Add extra label for replicaset metrics #804

Merged
merged 2 commits into from
May 22, 2024

Conversation

BupycHuk
Copy link
Member

@BupycHuk BupycHuk commented Feb 27, 2024

PMM-9403 (optional, if ticket reported)

  • Links to related pull requests (optional).
    FB

Below we provide a basic checklist of things that would make it a good PR:

  • Make sure to sign the CLA (Contributor License Agreement).
  • Make sure all tests pass.
  • Keep current with the target branch and fix conflicts if necessary.
  • Update jira ticket description if necessary.
  • Attach screenshots and/or console output to the jira ticket to confirm new behavior, if applicable.
  • Leave notes to the reviewers if you need to focus their attention on something specific.

Once all checks pass and the code is ready for review, please add pmm-review-exporters team as the reviewer. That would assign people from the review team automatically. Report any issues on our Forum.

@BupycHuk BupycHuk requested a review from a team as a code owner February 27, 2024 14:16
@BupycHuk BupycHuk requested review from ademidoff and JiriCtvrtka and removed request for a team February 27, 2024 14:16
@@ -999,8 +999,8 @@ func oplogStatus(ctx context.Context, client *mongo.Client) ([]prometheus.Metric
return []prometheus.Metric{headMetric, tailMetric}, nil
}

func replSetMetrics(m bson.M) []prometheus.Metric {
replSetGetStatus, ok := m["replSetGetStatus"].(bson.M)
func replSetMetrics(d bson.M) []prometheus.Metric {

Choose a reason for hiding this comment

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

🚫 [golangci-lint] reported by reviewdog 🐶
Function 'replSetMetrics' has too many statements (41 > 40) (funlen)

@@ -999,8 +999,8 @@ func oplogStatus(ctx context.Context, client *mongo.Client) ([]prometheus.Metric
return []prometheus.Metric{headMetric, tailMetric}, nil
}

func replSetMetrics(m bson.M) []prometheus.Metric {
replSetGetStatus, ok := m["replSetGetStatus"].(bson.M)
func replSetMetrics(d bson.M) []prometheus.Metric {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just out of curiosity. Why "d"? Since it is bson.M not bson.D.

Copy link
Member Author

Choose a reason for hiding this comment

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

because it's diagnostic data, needed some other variable, because m was reused below for members.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. Thanks

Copy link
Member

@ademidoff ademidoff left a comment

Choose a reason for hiding this comment

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

@BupycHuk Unrelated, but still: can we remove this line before merging?

@BupycHuk
Copy link
Member Author

BupycHuk commented Mar 4, 2024

@ademidoff let's do it in a separate PR

@BupycHuk BupycHuk merged commit 6bc689d into main May 22, 2024
7 checks passed
@BupycHuk BupycHuk deleted the PMM-9403-add-extra-self-label-for-replicaset branch May 22, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants