-
Notifications
You must be signed in to change notification settings - Fork 1
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
Parameterize absent pr name #153
Parameterize absent pr name #153
Conversation
…r -rule "{{ .Namespace }}-{{ .Name }}-absent-metrics"
…r -rule "{{ .metadata.namespace }}-{{ .metadata.name }}-absent-metrics" 2>&1
ba33b18
to
6b88aa2
Compare
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.
Sorry for the late response. I am currently quite busy, but I will try to have one of my teammates look at this soon. As a quick note, can you please run gofmt to clean up the formatting? The easiest way to do this would be through golangci-lint, i.e. make prepare-static-check && golangci-lint run --fix
.
promServer = "default-prometheus" | ||
// return errors.New("no 'prometheus' label found") |
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.
This looks like some leftover debugging code
buf := &bytes.Buffer{} | ||
err = t.Execute(buf, m) | ||
if err != nil { | ||
fmt.Println(err.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.
Please use the standard logging methods used elsewhere in the program
Since we wouldn't be using this feature in our environment, can you add a test case which would fail when executed on the code on master, to prevent that the feature regresses in the future? Also please make sure that static-check is not failing. Right now the existing test suite is failing to compile because one function takes extra arguments.
|
* Patch metrics operatr to work with a hack * Working with ./build/absent-metrics-operator -keep-labels service,tier -rule "{{ .Namespace }}-{{ .Name }}-absent-metrics" * Working with ./build/absent-metrics-operator -keep-labels service,tier -rule "{{ .metadata.namespace }}-{{ .metadata.name }}-absent-metrics" 2>&1 * Clean up --------- Co-authored-by: Conall Prendergast <[email protected]>
* Patch metrics operatr to work with a hack * Working with ./build/absent-metrics-operator -keep-labels service,tier -rule "{{ .Namespace }}-{{ .Name }}-absent-metrics" * Working with ./build/absent-metrics-operator -keep-labels service,tier -rule "{{ .metadata.namespace }}-{{ .metadata.name }}-absent-metrics" 2>&1 * Clean up
This PR adds a
-rule
flag that takes a go template, allowing configuration of the generated absence PrometheusRule API object.eg