- Notifications
You must be signed in to change notification settings - Fork 1.8k
Update the docs and scaffold to make clear how works the metrics and what is required to do for third party API's. #2606
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
Update the docs and scaffold to make clear how works the metrics and what is required to do for third party API's. #2606
Conversation
Hi @jmccormick2001, Really thank you for your input. Let me know what do you think now? |
doc/user-guide.md Outdated
| ||
#### Default Metrics exported with 3rd party resource | ||
| ||
By default the projects built with SDK will be implemented to export metrics. For further information check the [metrics section][metrics_doc]. Then, in the `main.go` you will see: |
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.
By default the projects built with SDK will be implemented to export metrics. For further information check the [metrics section][metrics_doc]. Then, in the `main.go` you will see: | |
By default, SDK operator projects are set up to [export metrics][metrics_doc] through `serveCRMetrics` in `cmd/manager/main.go`: |
doc/user-guide.md Outdated
| ||
```go | ||
func serveCRMetrics(cfg *rest.Config) error { | ||
|
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.
internal/scaffold/cmd.go Outdated
// Note that if you are adding third party API schemas, probably you will need to customize this implementation | ||
// to not face issues such as; "Failed to list *unstructured.Unstructured:" which may occur because | ||
// the operator has not permission to List the schemas added. See that when a schema is added | ||
// it also may add others schemas which are required by it and then, they will not be filtered by default. |
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.
Discussing errors in cmd/manager/main.go
in depth is unnecessary. If anything, link to the relevant user guide section.
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.
I tried to improve that. Let me know if it is ok for you now.
internal/scaffold/cmd.go Outdated
func serveCRMetrics(cfg *rest.Config) error { | ||
// Below function returns filtered operator/CustomResource specific GVKs. | ||
// For more control override the below GVK list with your own custom logic. | ||
// The function below returns filtered operator/CR specific GVKs. For more control, override the GVK list below |
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.
// The function below returns filtered operator/CR specific GVKs. For more control, override the GVK list below | |
// The function below returns a list of filtered operator-/CR-specific GVKs. | |
// To collect metrics on fewer types, filter the GVK list below further. |
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.
I'd rather see this wording than the wording you're currently using. There is no "overriding" here, just further filtering.
Co-Authored-By: Eric Stroczynski <estroczy@redhat.com>
eric is in PTO, however, all his suggestions were accepted and done.
All changes and suggestions made by @estroz are applied |
Description of the change:
Motivation for the change:
Closes #2577
Closes #1858