-
Notifications
You must be signed in to change notification settings - Fork 729
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
Homogenize logs #1168
Homogenize logs #1168
Conversation
operators/pkg/controller/elasticsearch/remotecluster/elasticsearch.go
Outdated
Show resolved
Hide resolved
Nice work! I like the standardization on using namespace and name. I have a small fear that this leads to confusion in some cases. For example it can be the name of an Elasticsearch cluster, a pod or a secret and sometimes for me it will be not clear. I'm wondering if we should add a |
I can see the prefix making sense since some things might have more than one relevant item (e.g. you might want to log the ES cluster name and the pod name in the same message), so a separate |
operators/cmd/manager/main.go
Outdated
opts.MetricsBindAddress = fmt.Sprintf(":%d", metricsPort) | ||
log.Info(fmt.Sprintf("Exposing Prometheus metrics on /metrics%s", opts.MetricsBindAddress)) | ||
} | ||
log.Info("Exposing Prometheus metrics on /metrics", "port", metricsPort) |
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.
Looks like this is changing the behaviour?
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.
Ah you're right, this was sloppy. That said I wonder if we do just want to set a default port (probably 80?) and always expose prometheus metrics
@@ -101,6 +101,8 @@ func (p *Process) updateState(action string, signal syscall.Signal, lastErr erro | |||
|
|||
err := p.state.Write() | |||
if err != nil { | |||
// TODO (sabo): is this necessary? seems helpful since it will be structured and easier to parse than an exit message |
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.
+1, I think we can keep it
@@ -201,7 +201,7 @@ func buildCAFromSecret(caInternalSecret corev1.Secret) *CA { | |||
} | |||
privateKey, err := ParsePEMPrivateKey(privateKeyBytes) | |||
if err != nil { | |||
log.Info("Cannot parse PEM private key from CA secret, will create a new one", "err", err) | |||
log.Error(err, "Cannot parse PEM private key from CA secret]") |
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.
Is the ]
a typo here?
Also, I liked the "will create a new one" part.
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 had removed the "will create a new one" because this function isn't doing that. This is just returning a CA if it can, or returning nil if it can't.
This is ready for re-review, I think I addressed your all's comments and added prefixes where necessary. |
More than 3 and it's perfect. Thank you for doing this job a bit ungrateful. |
@@ -67,7 +67,7 @@ func (b Builder) InitTestSteps(k *test.K8sClient) test.StepList { | |||
return err | |||
} | |||
if err == nil { | |||
return fmt.Errorf("elasticsearch %s is still there", b.Elasticsearch.Name) | |||
return fmt.Errorf("elasticsearch %s is still there", k8s.ExtractNamespacedName(&stack.Elasticsearch)) |
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.
CI reported:
test/e2e/test/elasticsearch/steps_init.go:70:87: undefined: stack
PR #1170 did a massive refactoring of E2E tests, in particular to remove the stack
concept. So the stack Stack
became a b Builder
.
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.
LGTM!
It remains one small bit to change related to the #1170 refactoring.
* Support for APM server configuration (#1181) * Add a config section to the APM server configuration * APM: Add support for keystore * Factorize ElasticsearchAuthSettings * Update dev setup doc + fix GKE bootstrap script (#1203) * Update dev setup doc + fix GKE bootstrap script * Update wording of container registry authentication * Ensure disks removal after removing cluster in GKE (#1163) * Update gke-cluster.sh * Implement cleanup for unused disks in GCP * Update Makefile * Update CI jobs to do proper cleanup * Normalize the raw config when creating canonical configs (#1208) This aims at counteracting the difference between JSON centric serialization and the use of YAML as the serialization format in canonical config. If not normalizing numeric values like 1 will differ when comparing configs as JSON deserializes integer numbers to float64 and YAML to uint64. * Homogenize logs (#1168) * Don't run tests if only docs are changed (#1216) * Update Jenkinsfile * Simplify notOnlyDocs() * Update Jenkinsfile * Push snapshot ECK release on successful PR build (#1184) * Update makefile's to support snapshots * Add snapshot releases to Jenkins pipelines * Cleanup * Rename RELEASE to USE_ELASTIC_DOCKER_REGISTRY * Update Jenkinsfile * Add a note on EKS inbound traffic & validating webhook (#1211) EKS users must explicitly enable communication from the k8s control plane and nodes port 443 in order for the control plane to reach the validating webhook. Should help with #896. * Update PodSpec with Hostname from PVC when re-using (#1204) * Bind the Debug HTTP server to localhost by default (#1220) * Run e2e tests against custom Docker image (#1135) * Add implementation * Update makefile's * Update Makefile * Rename Jenkisnfile * Fix review comments * Update e2e-custom.yml * Update e2e-custom.yml * Return deploy-all-in-one to normal * Delete GKE cluster only if changes not in docs (#1223) * Add operator version to resources (#1224) * Warn if unsupported distribution (#1228) The operator only works with the official ES distributions to enable the security available with the basic (free), gold and platinum licenses in order to ensure that all clusters launched are secured by default. A check is done in the prepare-fs script by looking at the existence of the Elastic License. If not present, the script exit with a custom exit code. Then the ES reconcilation loop sends an event of type warning if it detects that a prepare-fs init container terminated with this exit code. * Document Elasticsearch update strategy change budget & groups (#1210) Add documentation for the `updateStrategy` section of the Elasticsearch spec. It documents how (and why) `changeBudget` and `groups` are used by ECK, and how both settings can be specified by the user.
Part of resolving #305
Moves all logs to either Info or Debug (
V(1)
).Standardizes on using
namespace
andname
fields where appropriate for easy searching of logsRemoves any use of
Info(fmt.Sprintf())
Small refactor: removes unnecessary
resource
parameter inreconcileFinalizers()