You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ha...@apache.org on 2021/04/08 02:13:53 UTC

[skywalking] 01/01: Fix slash root issues in es7 client

This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a commit to branch storage/es-client7
in repository https://gitbox.apache.org/repos/asf/skywalking.git

commit 5fc8569bd3793995e818dd5363f411dc1aabcaab
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Thu Apr 8 10:11:56 2021 +0800

    Fix slash root issues in es7 client
    
    Signed-off-by: Gao Hongtao <ha...@gmail.com>
---
 CHANGES.md                                                            | 2 +-
 .../storage/plugin/elasticsearch7/client/ElasticSearch7Client.java    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index f21b92d..989dc38 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -74,7 +74,7 @@ Release Notes.
 * Make the flushing metrics operation concurrent.
 * Fix ALS K8SServiceRegistry didn't remove the correct entry.
 * Using "service.istio.io/canonical-name" to replace "app" label to resolve Envoy ALS service name.
-* Append the root slash(/) to getIndex and getTemplate requests in ES client.
+* Append the root slash(/) to getIndex and getTemplate requests in ES(6 and 7) client.
 * Fix `disable` statement not working. This bug exists since 8.0.0.
 * Remove the useless metric in `vm.yaml`.
 
diff --git a/oap-server/server-storage-plugin/storage-elasticsearch7-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch7/client/ElasticSearch7Client.java b/oap-server/server-storage-plugin/storage-elasticsearch7-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch7/client/ElasticSearch7Client.java
index f94ff09..c0e0d72 100644
--- a/oap-server/server-storage-plugin/storage-elasticsearch7-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch7/client/ElasticSearch7Client.java
+++ b/oap-server/server-storage-plugin/storage-elasticsearch7-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch7/client/ElasticSearch7Client.java
@@ -175,7 +175,7 @@ public class ElasticSearch7Client extends ElasticSearchClient {
         indexName = formatIndexName(indexName);
         try {
             Response response = client.getLowLevelClient()
-                                      .performRequest(new Request(HttpGet.METHOD_NAME, indexName));
+                                      .performRequest(new Request(HttpGet.METHOD_NAME, "/" + indexName));
             int statusCode = response.getStatusLine().getStatusCode();
             if (statusCode != HttpStatus.SC_OK) {
                 healthChecker.health();
@@ -218,7 +218,7 @@ public class ElasticSearch7Client extends ElasticSearchClient {
         name = formatIndexName(name);
         try {
             Response response = client.getLowLevelClient()
-                                      .performRequest(new Request(HttpGet.METHOD_NAME, "_template/" + name));
+                                      .performRequest(new Request(HttpGet.METHOD_NAME, "/_template/" + name));
             int statusCode = response.getStatusLine().getStatusCode();
             if (statusCode != HttpStatus.SC_OK) {
                 healthChecker.health();