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 2019/05/28 06:42:24 UTC

[skywalking] branch patch/als created (now f71f63c)

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

hanahmily pushed a change to branch patch/als
in repository https://gitbox.apache.org/repos/asf/skywalking.git.


      at f71f63c  Filtering pods not in 'Running' phase

This branch includes the following new commits:

     new f71f63c  Filtering pods not in 'Running' phase

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[skywalking] 01/01: Filtering pods not in 'Running' phase

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a commit to branch patch/als
in repository https://gitbox.apache.org/repos/asf/skywalking.git

commit f71f63c5abed3f6c8c1a501f2a507c3e042ac083
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Tue May 28 14:42:01 2019 +0800

    Filtering pods not in 'Running' phase
---
 .../server/receiver/envoy/als/K8sALSServiceMeshHTTPAnalysis.java | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/K8sALSServiceMeshHTTPAnalysis.java b/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/K8sALSServiceMeshHTTPAnalysis.java
index 64aedc3..f144b89 100644
--- a/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/K8sALSServiceMeshHTTPAnalysis.java
+++ b/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/K8sALSServiceMeshHTTPAnalysis.java
@@ -63,6 +63,8 @@ public class K8sALSServiceMeshHTTPAnalysis implements ALSHTTPAnalysis {
 
     private static final String ADDRESS_TYPE_INTERNAL_IP = "InternalIP";
 
+    private static final String VALID_PHASE = "Running";
+
     @Getter(AccessLevel.PROTECTED)
     private final AtomicReference<Map<String, ServiceMetaInfo>> ipServiceMap = new AtomicReference<>();
 
@@ -93,8 +95,13 @@ public class K8sALSServiceMeshHTTPAnalysis implements ALSHTTPAnalysis {
             Map<String, ServiceMetaInfo> ipMap = new HashMap<>(list.getItems().size());
             long startTime = System.nanoTime();
             for (V1Pod item : list.getItems()) {
+                if (!item.getStatus().getPhase().equals(VALID_PHASE)) {
+                    logger.debug("Invalid pod {} is not in a valid phase {}", item.getMetadata().getName(), item.getStatus().getPhase());
+                    continue;
+                }
                 if (item.getStatus().getPodIP().equals(item.getStatus().getHostIP())) {
-                    logger.warn("Pod {}.{} is removed because hostIP and podIP are identical ", item.getMetadata().getName());
+                    logger.debug("Pod {}.{} is removed because hostIP and podIP are identical ", item.getMetadata().getName()
+                            , item.getMetadata().getNamespace());
                     continue;
                 }
                 ipMap.put(item.getStatus().getPodIP(), createServiceMetaInfo(item.getMetadata()));