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

MM-55630: Generate a new dashboard with enabled coordinator metrics #694

Merged
merged 7 commits into from
Feb 19, 2024

Conversation

agarciamontoro
Copy link
Member

Summary

A new Grafana dashboard is dynamically generated when there is at least one enabled query in the coordinator. I had to add a new optional Legend field to the queries configuration so that we can provide a string to use as legend in the panel. The following screenshot shows the generated dashboard with the sample metrics (not very interesting graphs, since it was a dummy test):

image

I didn't add the first panel with the number of connected users as shown in the ticket's screenshot, since that's already in the other dashboard.

Ticket Link

https://mattermost.atlassian.net/browse/MM-55630

@agarciamontoro agarciamontoro added the 2: Dev Review Requires review by a core committer label Feb 13, 2024
config/coordinator.sample.json Outdated Show resolved Hide resolved
deployment/terraform/metrics.go Outdated Show resolved Hide resolved
"Query": "(sum(rate(mattermost_api_time_count{status_code=~\"5..\"}[1m]))/sum(rate(mattermost_api_time_count[1m])))*100",
"Threshold": 0.025,
"MinIntervalSec": 60,
"Alert": true
},
{
"Description": "Average client request duration",
"Legend": "Average duration of all requests as measured from the client side",
"Legend": "Duration in ms (avg)",
Copy link
Member

Choose a reason for hiding this comment

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

You don't even need the unit because it's there in the y axis. But ok to keep this :)

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not, right? And it's seconds, actually! I'll fix it now
image

Copy link
Member

Choose a reason for hiding this comment

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

That's because you haven't mentioned the unit in the display section. If you set that to time in seconds, then it automatically adjusts to ms when it's too low. It's far better that way.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I thought about that. But then we'd have to add yet another field to the coordinator metrics for users to specify the unit. I'd start with this and we can iterate later if needed.

Copy link
Member

Choose a reason for hiding this comment

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

Why do you need user input for that? It's always in seconds right?

Copy link
Member Author

Choose a reason for hiding this comment

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

This particular query is, but the queries are arbitrary and user-defined. Most of the ones we use now are plain percentages.

Copy link
Member

Choose a reason for hiding this comment

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

Ahhh that's true. Forgot that you are templating the dashboard. All good then 👍

@agarciamontoro agarciamontoro added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer labels Feb 19, 2024
@agarciamontoro agarciamontoro merged commit 1ac838c into master Feb 19, 2024
1 check passed
@agarciamontoro agarciamontoro deleted the MM-55630.metrics.dashboard branch February 19, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants