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

Add logging for call to ES #4958

Merged
merged 3 commits into from
Oct 19, 2021
Merged

Add logging for call to ES #4958

merged 3 commits into from
Oct 19, 2021

Conversation

koneko096
Copy link
Contributor

Fixes #4935

Basically adding a debug log on each client request with only the URL path.

@elasticmachine

This comment has been minimized.

3 similar comments
@elasticmachine

This comment has been minimized.

@elasticmachine

This comment has been minimized.

@elasticmachine
Copy link

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@botelastic botelastic bot added the triage label Oct 14, 2021
@david-kow david-kow added >enhancement Enhancement of existing functionality v1.9.0 labels Oct 15, 2021
@botelastic botelastic bot removed the triage label Oct 15, 2021
Copy link
Contributor

@barkbay barkbay left a comment

Choose a reason for hiding this comment

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

We are almost there 👍
We also need to update the e2e tests, test/e2e/test/elasticsearch/checks_http.go and test/e2e/test/elasticsearch/http_client.go:

index b9b0de4f7..f7063f37d 100644
--- a/test/e2e/test/elasticsearch/checks_http.go
+++ b/test/e2e/test/elasticsearch/checks_http.go
@@ -43,7 +43,7 @@ func CheckHTTPConnectivityWithCA(es esv1.Elasticsearch, k *test.K8sClient, caCer
 
        for _, p := range reconcile.AvailableElasticsearchNodes(pods) {
                url := services.ElasticsearchPodURL(p)
-               esClient := client.NewElasticsearchClient(dialer, url, user, v, caCert, client.Timeout(es))
+               esClient := client.NewElasticsearchClient(dialer, k8s.ExtractNamespacedName(&es), url, user, v, caCert, client.Timeout(es))
                _, err := esClient.GetClusterInfo(context.Background())
                if err != nil {
                        return err
diff --git a/test/e2e/test/elasticsearch/http_client.go b/test/e2e/test/elasticsearch/http_client.go
index 0f39575bf..dab5a343e 100644
--- a/test/e2e/test/elasticsearch/http_client.go
+++ b/test/e2e/test/elasticsearch/http_client.go
@@ -47,6 +47,6 @@ func NewElasticsearchClientWithUser(es esv1.Elasticsearch, k *test.K8sClient, us
        if err != nil {
                return nil, err
        }
-       esClient := client.NewElasticsearchClient(dialer, inClusterURL, user, v, caCert, client.Timeout(es))
+       esClient := client.NewElasticsearchClient(dialer, k8s.ExtractNamespacedName(&es), inClusterURL, user, v, caCert, client.Timeout(es))
        return esClient, nil
 }

You can try to compile the e2e tests with make e2e-compile

pkg/controller/autoscaling/elasticsearch/controller.go Outdated Show resolved Hide resolved
pkg/controller/elasticsearch/client/client_test.go Outdated Show resolved Hide resolved
pkg/controller/elasticsearch/driver/driver.go Outdated Show resolved Hide resolved
@barkbay
Copy link
Contributor

barkbay commented Oct 19, 2021

jenkins test this please

Copy link
Contributor

@barkbay barkbay left a comment

Choose a reason for hiding this comment

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

LGTM

@barkbay
Copy link
Contributor

barkbay commented Oct 19, 2021

@koneko096 Thanks for your contribution !

@barkbay barkbay merged commit 1f27801 into elastic:master Oct 19, 2021
fantapsody pushed a commit to fantapsody/cloud-on-k8s that referenced this pull request Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement Enhancement of existing functionality v1.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Elasticsearch HTTP client: log requests at debug level
4 participants