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 f5cd798185 Fix `NullPointerException` in Istio ServiceEntry registry 
(#12087)
f5cd798185 is described below

commit f5cd7981851886b323ec268f9b0a8e3040fd5a00
Author: kezhenxu94 <kezhenx...@apache.org>
AuthorDate: Wed Apr 10 20:43:01 2024 +0800

    Fix `NullPointerException` in Istio ServiceEntry registry (#12087)
---
 docs/en/changes/changes.md                                            | 1 +
 .../server/receiver/envoy/als/istio/IstioServiceEntryRegistry.java    | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md
index d23ae7e0aa..544b6fad72 100644
--- a/docs/en/changes/changes.md
+++ b/docs/en/changes/changes.md
@@ -93,6 +93,7 @@
     - API `/api/v1/labels` and `/api/v1/label/<label_name>/values` support 
return matched metrics labels.
   - OAL:
     - Deprecate `percentile` function and introduce `percentile2` function 
instead.
+* Fix `NullPointerException` in Istio ServiceEntry registry.
 
 #### UI
 
diff --git 
a/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/istio/IstioServiceEntryRegistry.java
 
b/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/istio/IstioServiceEntryRegistry.java
index a525c4fea5..1bc118205d 100644
--- 
a/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/istio/IstioServiceEntryRegistry.java
+++ 
b/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/istio/IstioServiceEntryRegistry.java
@@ -74,6 +74,10 @@ public class IstioServiceEntryRegistry {
                     .filter(se -> 
!ignoredNamespaces.contains(se.getMetadata().getNamespace()))
                     .filter(se -> {
                         final var spec = se.getSpec();
+                        if (spec.getResolution() == null) {
+                            log.debug("Unsupported service entry resolution: 
{}", spec.getResolution());
+                            return false;
+                        }
                         switch (spec.getResolution()) {
                             case STATIC:
                                 return spec

Reply via email to