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-61912] Download and install latest Dashboard v2 automatically #872

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

fmartingr
Copy link
Contributor

Summary

Downloads the latest Dashboard v2 revision from the Grafana gallery and installs it into the environment automatically. It naively removes the DS_PROMETHEUS variable from the JSON dashboard code so it automatically uses the primary prometheus source present in the deployment.

Ticket Link

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

metrics: install dashboard v2 (fix var)
@fmartingr fmartingr added the 2: Dev Review Requires review by a core committer label Dec 13, 2024
@fmartingr fmartingr self-assigned this Dec 13, 2024

// Removes the DS_PROMETHEUS variable requirement to allow grafana to use the only prometheus
// datasource available in the load-test envionment.
re := regexp.MustCompile(`,\r?\n\s+\"uid\":\s?\"\$\{DS_PROMETHEUS\}\"`)
Copy link
Member

Choose a reason for hiding this comment

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

Hmm .. I am not a big fan of this. Can we not use the t.UploadDashboard method to upload the dashboard, instead of manually copying over the json file to a folder?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah, I recall thinking about checking that method when I moved this upstream but I forget, sorry, let me make the changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fmartingr fmartingr requested a review from agnivade December 13, 2024 16:36
Copy link
Member

@agarciamontoro agarciamontoro left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

@@ -352,6 +353,29 @@ func (t *Terraform) setupMetrics(extAgent *ssh.ExtAgent) error {
return fmt.Errorf("error while uploading dashboard_json: output: %s, error: %w", out, err)
}

// Download dashboard v2 from and upload it
Copy link
Member

Choose a reason for hiding this comment

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

There's something missing here. From grafana.com, you meant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🦅 👁️ 👍

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants