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 debug packet functionality #162

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add debug packet functionality #162

wants to merge 1 commit into from

Conversation

gabrieljackson
Copy link
Contributor

This allows for the cloud plugin to request a debug packet for a given installation via the cloud provisioner. The packet currently contains pprof data for each Mattermost server instance in the server cluster.


Screenshot 2024-11-27 at 10 36 05 AM
Screenshot 2024-11-27 at 10 36 51 AM

Fixes https://mattermost.atlassian.net/browse/CLD-8609

Add debug packet functionality

This allows for the cloud plugin to request a debug packet for a
given installation via the cloud provisioner. The packet currently
contains pprof data for each Mattermost server instance in the
server cluster.
@mm-cloud-bot mm-cloud-bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Nov 27, 2024
@gabrieljackson gabrieljackson added 2: Dev Review Requires review by a core committer kind/feature Categorizes issue or PR as related to a new feature. labels Nov 27, 2024
@gabrieljackson gabrieljackson marked this pull request as ready for review November 27, 2024 15:49
Comment on lines +39 to +52
p.API.SendEphemeralPost(extra.UserId, &model.Post{
UserId: p.BotUserID,
ChannelId: extra.ChannelId,
Message: fmt.Sprintf("Gathering debug data for `%s` now. Please wait as this may take a while.", installToExec.Name),
})

err = p.execGetDebugPacket(installToExec.ID, extra.UserId, name)
if err != nil {
return nil, false, err
}

resp := "Debug packet generated. Check your direct messages from the cloud bot."

return getCommandResponse(model.CommandResponseTypeEphemeral, resp, extra), false, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we wrap the exec in a go routine, so that a pprof that takes too long to generate won't run into timeout issues from Nginx?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2: Dev Review Requires review by a core committer kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants