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

Add "type" to membership queue metrics #300

Merged
merged 2 commits into from
Jan 25, 2021
Merged

Add "type" to membership queue metrics #300

merged 2 commits into from
Jan 25, 2021

Conversation

Half-Shot
Copy link
Contributor

Fixes #297

@Half-Shot Half-Shot requested a review from a team January 25, 2021 11:53
@@ -103,7 +103,7 @@ export class MembershipCache {
return Object.keys(this.membershipMap[roomId]);
}
const members = [];
for (const [userId, [membership, profile]] of Object.entries(this.membershipMap[roomId])) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Random linter error I spotted

Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this an error?
The value of profile isn't used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, warning. The linter wasn't happy that profile wasn't used.

Copy link
Contributor

Choose a reason for hiding this comment

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

I also read this the commit wrong way, thinking that profile got added.
Nevermind. 🙈

@@ -103,7 +103,7 @@ export class MembershipCache {
return Object.keys(this.membershipMap[roomId]);
}
const members = [];
for (const [userId, [membership, profile]] of Object.entries(this.membershipMap[roomId])) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this an error?
The value of profile isn't used.

src/components/membership-queue.ts Outdated Show resolved Hide resolved
@@ -0,0 +1 @@
Fix a bug that would cause membership queue failures to not be reported as metrics
Copy link
Contributor

@jaller94 jaller94 Jan 25, 2021

Choose a reason for hiding this comment

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

  1. I don't understand what this means. Why are failures reported "as metrics"? Do you mean "as part of the metrics"?
  2. I also don't understand how adding the label "type" fixes some failures not being reported.

Copy link
Contributor

Choose a reason for hiding this comment

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

Update about 2): After having read the issue I found the code where "type" is being used as a label later.
I now understand that this is about handing over all labels on the initial sync of metrics.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorta. Prom-client will get angry if you use a label not defined in the schema. This PR just ensures we define it. Have updated the changelog entry to make it a bit easier to see the bug?

@Half-Shot Half-Shot requested a review from jaller94 January 25, 2021 13:08
Copy link
Contributor

@jaller94 jaller94 left a comment

Choose a reason for hiding this comment

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

Thanks for clarifying the change in the news file.

@Half-Shot Half-Shot merged commit 8fc30dc into develop Jan 25, 2021
@jaller94 jaller94 deleted the hs/metric-bug branch January 25, 2021 15:54
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.

Membership Sync - Error: Added label "type" is not included in initial labelset: [ 'errcode', 'http_status' ]
2 participants