You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2019/05/28 08:05:45 UTC
[skywalking] branch master updated: Filtering pods not in 'Running'
phase (#2771)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git
The following commit(s) were added to refs/heads/master by this push:
new 4f89ea2 Filtering pods not in 'Running' phase (#2771)
4f89ea2 is described below
commit 4f89ea2704e560ca93d5fcd5830679c9db82c2cd
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Tue May 28 16:05:36 2019 +0800
Filtering pods not in 'Running' phase (#2771)
* Filtering pods not in 'Running' phase
* Amending checkstyle errors
---
.../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..96b4367 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()));