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

Feature/metrics enable flag #100

Merged
merged 5 commits into from
Jul 15, 2020
Merged

Feature/metrics enable flag #100

merged 5 commits into from
Jul 15, 2020

Conversation

kaplanelad
Copy link
Contributor

What type of PR is this?

/Feature

What this PR does / why we need it:
Add the option to enable/disable resource detection according to collector's configuration

Which issue(s) this PR fixes (if exists):

Fixes #94

@kaplanelad kaplanelad added the kind/new-feature New feature label Jul 15, 2020
@kaplanelad kaplanelad requested a review from cregev July 15, 2020 17:26
@kaplanelad kaplanelad self-assigned this Jul 15, 2020
log "github.com/sirupsen/logrus"
)

// ErrResourceNotConfigure defines the error when the resource not configure
Copy link
Contributor

Choose a reason for hiding this comment

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

not configure -> is not configured.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

return metricsResponse, ErrResourceNotConfigure
}

// loop on resource metrics and extract only the enable metrics
Copy link
Contributor

Choose a reason for hiding this comment

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

enable -> enabled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

return metricsResponse, nil
}

// IsResourceEnable checks if the resource configure and enabled
Copy link
Contributor

Choose a reason for hiding this comment

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

configure -> is configured

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

}

if !resource.Enable {
logger.Info("resource has not enable metrics")
Copy link
Contributor

Choose a reason for hiding this comment

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

has not enable --> has not enabled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@kaplanelad kaplanelad requested a review from cregev July 15, 2020 18:06
@cregev cregev added the lgtm label Jul 15, 2020
@kaplanelad kaplanelad merged commit 04ca0cd into master Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the option to to enable/disable resource detection according to collector's configuration
2 participants