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

PMM-1901 Metrics endpoint and collectors filtering. #40

Closed
wants to merge 11 commits into from

Conversation

AlekSi
Copy link

@AlekSi AlekSi commented Feb 12, 2020

#23

@claassistantio
Copy link

claassistantio commented Feb 12, 2020

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Anton Kucherov seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@AlekSi AlekSi closed this Feb 12, 2020
assert.Equal(t, expected, len(descs), "%+v", descs)
}

func TestCollector_Describe_WithOverlappingMetrics(t *testing.T) {

Choose a reason for hiding this comment

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

func TestCollector_Describe_WithOverlappingMetrics is unused (from unused)

@@ -13,19 +13,36 @@ import (
"github.com/percona/rds_exporter/sessions"
)

func getExporter(t *testing.T) *Exporter {
func getExporter(t *testing.T, enableMetrics OverlappingMetrics) *Exporter {

Choose a reason for hiding this comment

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

func getExporter is unused (from unused)

assert.Equal(t, expected, len(metrics), "%+v", metrics)
}

func TestCollector_Collect_WithOverlappingMetrics(t *testing.T) {

Choose a reason for hiding this comment

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

func TestCollector_Collect_WithOverlappingMetrics is unused (from unused)

func New(config *config.Config, sessions *sessions.Sessions, enableOverlapping OverlappingMetrics) *Exporter {
var m []Metric
m = append(m, Metrics...)
if enableOverlapping {

Choose a reason for hiding this comment

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

only one cuddle assignment allowed before if statement (from wsl)

t.Helper()

cfg, err := config.Load("../config.yml")
require.NoError(t, err)
client := client.New()
sess, err := sessions.New(cfg.Instances, client.HTTP(), false)
require.NoError(t, err)
return New(cfg, sess)
return New(cfg, sess, enableMetrics)

Choose a reason for hiding this comment

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

return statements should not be cuddled if block has more than two lines (from wsl)

log.Warnln("Couldn't create filtered metrics handler:", err)
w.WriteHeader(http.StatusBadRequest)
_, err := w.Write([]byte(fmt.Sprintf("Couldn't create filtered metrics handler: %s", err)))
if err != nil {

Choose a reason for hiding this comment

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

only one cuddle assignment allowed before if statement (from wsl)

}
return
}
filteredHandler.ServeHTTP(w, r)

Choose a reason for hiding this comment

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

expressions should not be cuddled with blocks (from wsl)

if err := registry.Register(c); err != nil {
return nil, err
}
log.Infof("Collector '%s' was registered", name)

Choose a reason for hiding this comment

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

expressions should not be cuddled with blocks (from wsl)

if err := registry.Register(c); err != nil {
return nil, err
}
log.Infof("Collector '%s' was registered", name)

Choose a reason for hiding this comment

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

expressions should not be cuddled with blocks (from wsl)

@@ -0,0 +1,63 @@
package factory

Choose a reason for hiding this comment

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

ST1000: at least one file in a package should have a package comment (from stylecheck)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants