Skip to content

Conversation

camilamacedo86
Copy link
Contributor

@camilamacedo86 camilamacedo86 commented Feb 27, 2020

Description of the change:

  • Update the docs and scaffold to make clear how works the metrics and what is required to do for third party API's.

Motivation for the change:

Closes #2577
Closes #1858

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 27, 2020
@camilamacedo86 camilamacedo86 changed the title make clear the behaviour of metrics with third part APIS Update the docs and scaffold to make clear how works the metrics and what is required to do for third party API's. Feb 27, 2020
@camilamacedo86 camilamacedo86 added metrics kind/documentation Categorizes issue or PR as related to documentation. labels Feb 27, 2020
@camilamacedo86
Copy link
Contributor Author

Hi @jmccormick2001,

Really thank you for your input. Let me know what do you think now?

estroz
estroz previously requested changes Feb 27, 2020

#### 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:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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`:

```go
func serveCRMetrics(cfg *rest.Config) error {

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Comment on lines 222 to 225
// 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.
Copy link
Member

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.

Copy link
Contributor Author

@camilamacedo86 camilamacedo86 Feb 27, 2020

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.

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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// 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.
Copy link
Member

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>
@camilamacedo86 camilamacedo86 dismissed estroz’s stale review March 9, 2020 13:26

eric is in PTO, however, all his suggestions were accepted and done.

@camilamacedo86
Copy link
Contributor Author

All changes and suggestions made by @estroz are applied
Also, it has the approval of another team member as well. So, all shows ok for we are able to move forward with.

@camilamacedo86 camilamacedo86 merged commit 0e032d5 into operator-framework:master Mar 9, 2020
@camilamacedo86 camilamacedo86 deleted the metrics-third-party-clarifications branch March 9, 2020 13:35
camilamacedo86 added a commit that referenced this pull request Mar 10, 2020
…lded files. #2625 - Add info over the changes required in the default scaffold done in the `main.go` file to address bug fixes and improvements made in metrics. Related to PR's #2606, #2603 and #2601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/documentation Categorizes issue or PR as related to documentation. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

4 participants