-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
✨ Initialize the Grafana plugin #2718
✨ Initialize the Grafana plugin #2718
Conversation
Hi @Kavinjsir. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
cbafd02
to
02cd2ed
Compare
02cd2ed
to
cc599f8
Compare
pkg/plugins/optional/grafana/alphav1/scaffolds/internal/templates/overall.go
Outdated
Show resolved
Hide resolved
pkg/plugins/optional/grafana/alphav1/scaffolds/internal/templates/overall.go
Outdated
Show resolved
Hide resolved
pkg/plugins/optional/grafana/alphav1/scaffolds/internal/templates/overall.go
Outdated
Show resolved
Hide resolved
cc599f8
to
aefb041
Compare
75f103b
to
071265a
Compare
"enable": true, | ||
"hide": true, | ||
"iconColor": "rgba(0, 211, 255, 1)", | ||
"name": "Annotations & Alerts", |
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.
should we have a dashaboard with all or could we divide per category?
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.
should we have a dashaboard with all or could we divide per category?
Are we talking about displaying all default metrics in dashboards? (If so, I feel like having multiple dashboards for different groups of metrics makes more sense, since there are so many..)
Talking about one single dashboard, it is available to divide panels into different folders, so that some folders can be folded up in case of the limited web page size.
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 we need many folders?
Could not be dashboards and we have <metric_category>.json
pkg/plugins/optional/grafana/alphav1/scaffolds/internal/templates/overall.go
Outdated
Show resolved
Hide resolved
071265a
to
4343371
Compare
dacff4f
to
3a57b94
Compare
pkg/plugins/optional/grafana/alphav1/scaffolds/internal/templates/runtime.go
Outdated
Show resolved
Hide resolved
3a57b94
to
f3a6ba4
Compare
f3a6ba4
to
de641bd
Compare
/test pull-kubebuilder-e2e-k8s-1-18-20 |
cmd/main.go
Outdated
@@ -33,6 +33,7 @@ import ( | |||
deployimagev1alpha1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/deploy-image/v1alpha1" | |||
golangv2 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v2" | |||
golangv3 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3" | |||
grafana "sigs.k8s.io/kubebuilder/v3/pkg/plugins/optional/grafana/alphav1" |
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.
grafana "sigs.k8s.io/kubebuilder/v3/pkg/plugins/optional/grafana/alphav1" | |
grafanaalphav1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/optional/grafana/alphav1" |
Could we change the alias to have alphav1 so that we follow its standards?
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.
@camilamacedo86 @Kavinjsir Wdyt about renaming the directory to v1alpha
instead of alphav1
, to make it in sync with other plugin naming.
The path would be sigs.k8s.io/kubebuilder/v3/pkg/plugins/optional/grafana/v1alpha
, the alias would be grafanav1alpha
*/ | ||
|
||
package alphav1 | ||
|
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.
See that code for init and edit are the same. Therefore we can centralize the content by:
a) creating a new file constants.go and adding all contacts there for the examples and descriptions
b) creating a new file commons.go and centralize the code that is used in both by encapsulating them with cohesion to be called in the subcommand implementations.
@@ -1,6 +1,8 @@ | |||
domain: testproject.org | |||
layout: | |||
- go.kubebuilder.io/v3 | |||
plugins: | |||
grafana.kubebuilder.io/v1-alpha: {} |
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.
Terrific 🥇
docs/book/src/SUMMARY.md
Outdated
@@ -112,6 +112,7 @@ | |||
- [go/v2 plugin (Deprecated)](./plugins/go-v2-plugin.md) | |||
- [go/v3 plugin](./plugins/go-v3-plugin.md) | |||
- [Declarative V1](./plugins/declarative-v1.md) | |||
- [Grafana V1](./plugins/grafana-v1-alpha.md) |
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.
we ne
- [Grafana V1](./plugins/grafana-v1-alpha.md) | |
- [grafana/v1-alpha](./plugins/grafana-v1-alpha.md) |
|
||
The plugin will create a new directory and scaffold the JSON files under it (i.e. `grafana/controller-runtime-metrics.json`). | ||
|
||
#### Grafana Manifest Usage |
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.
#### Grafana Manifest Usage | |
#### Now, let's check how to use the Grafana Dashboards |
cmd/main.go
Outdated
@@ -33,6 +33,7 @@ import ( | |||
deployimagev1alpha1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/deploy-image/v1alpha1" | |||
golangv2 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v2" | |||
golangv3 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3" | |||
grafana "sigs.k8s.io/kubebuilder/v3/pkg/plugins/optional/grafana/alphav1" |
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.
@camilamacedo86 @Kavinjsir Wdyt about renaming the directory to v1alpha
instead of alphav1
, to make it in sync with other plugin naming.
The path would be sigs.k8s.io/kubebuilder/v3/pkg/plugins/optional/grafana/v1alpha
, the alias would be grafanav1alpha
<img width="644" alt="Screen Shot 2022-06-28 at 3 40 22 AM" src="https://user-images.githubusercontent.com/18136486/176121955-1c4aec9c-0ba4-4271-9767-e8d1726d9d9a.png"> | ||
4. Select the data source for Prometheus metrics | ||
<img width="633" alt="Screen Shot 2022-06-28 at 3 41 26 AM" src="https://user-images.githubusercontent.com/18136486/176122261-e3eab5b0-9fc4-45fc-a68c-d9ce1cfe96ee.png"> | ||
5. Once `import` the json, the dashboard is ready. |
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.
Nit
5. Once `import` the json, the dashboard is ready. | |
5. Once the json is imported in grafana, the dashboard is ready. |
de641bd
to
fae8f05
Compare
/test pull-kubebuilder-e2e-k8s-1-18-20 |
1 similar comment
/test pull-kubebuilder-e2e-k8s-1-18-20 |
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.
Looks good, nice work @Kavinjsir!
/lgtm
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.
/approved
/hold cancel
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, Kavinjsir, varshaprasad96 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description of the Change
Initialize the Grafana plugin with the basic function to scaffold raw json manifest that can be copied to Grafana Web UI to visualize the controller/operator status.
Plugin Basic Function
grafana
folder with dashboard manifests (raw json to be imported to Grafana UI)Sample Usage
Motivation
This is the starting entry for developing the Grafana plugin.
Relative EP is in PR: #2708