-
Notifications
You must be signed in to change notification settings - Fork 42
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
Conversation
Generated only when there is at least one enabled query
config/coordinator.sample.json
Outdated
"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)", |
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 👍
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):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