diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/test/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/transform/SpringSleuthSegmentBuilderTest.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/test/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/transform/SpringSleuthSegmentBuilderTest.java index 16a673a32fd2b155e5e9149c3ec5ec3f32f3a82c..21f0347a63b236a7e9313277b5e387a95eedfe65 100644 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/test/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/transform/SpringSleuthSegmentBuilderTest.java +++ b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/test/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/transform/SpringSleuthSegmentBuilderTest.java @@ -125,11 +125,11 @@ public class SpringSleuthSegmentBuilderTest implements SegmentListener { private List buildSpringSleuthExampleTrace() throws UnsupportedEncodingException { List spans = new LinkedList<>(); - String span = "{\"traceId\":\"5b0e64354eea4fa71a8a1b5bdd791b8a\",\"id\":\"1a8a1b5bdd791b8a\",\"kind\":\"SERVER\",\"name\":\"get /\",\"timestamp\":1527669813700123,\"duration\":11295,\"localEndpoint\":{\"serviceName\":\"frontend\",\"ipv4\":\"192.168.72.220\"},\"remoteEndpoint\":{\"ipv6\":\"::1\",\"port\":55146},\"tags\":{\"http.method\":\"GET\",\"http.path\":\"/\",\"mvc.controller.class\":\"Frontend\",\"mvc.controller.method\":\"callBackend\"}}"; + String span = "{\"traceId\":\"5b0e64354eea4fa71a8a1b5bdd791b8a\",\"id\":\"1a8a1b5bdd791b8a\",\"kind\":\"SERVER\",\"name\":\"get /\",\"timestamp\":1527669813700123,\"duration\":11295,\"localEndpoint\":{\"serviceName\":\"frontend\",\"ipv4s\":\"192.168.72.220\"},\"remoteEndpoint\":{\"ipv6\":\"::1\",\"port\":55146},\"tags\":{\"http.method\":\"GET\",\"http.path\":\"/\",\"mvc.controller.class\":\"Frontend\",\"mvc.controller.method\":\"callBackend\"}}"; spans.add(SpanBytesDecoder.JSON_V2.decodeOne(span.getBytes("UTF-8"))); - span = "{\"traceId\":\"5b0e64354eea4fa71a8a1b5bdd791b8a\",\"parentId\":\"1a8a1b5bdd791b8a\",\"id\":\"d7d5b93dcda767c8\",\"kind\":\"CLIENT\",\"name\":\"get\",\"timestamp\":1527669813702456,\"duration\":6672,\"localEndpoint\":{\"serviceName\":\"frontend\",\"ipv4\":\"192.168.72.220\"},\"tags\":{\"http.method\":\"GET\",\"http.path\":\"/api\"}}"; + span = "{\"traceId\":\"5b0e64354eea4fa71a8a1b5bdd791b8a\",\"parentId\":\"1a8a1b5bdd791b8a\",\"id\":\"d7d5b93dcda767c8\",\"kind\":\"CLIENT\",\"name\":\"get\",\"timestamp\":1527669813702456,\"duration\":6672,\"localEndpoint\":{\"serviceName\":\"frontend\",\"ipv4s\":\"192.168.72.220\"},\"tags\":{\"http.method\":\"GET\",\"http.path\":\"/api\"}}"; spans.add(SpanBytesDecoder.JSON_V2.decodeOne(span.getBytes("UTF-8"))); - span = "{\"traceId\":\"5b0e64354eea4fa71a8a1b5bdd791b8a\",\"parentId\":\"1a8a1b5bdd791b8a\",\"id\":\"d7d5b93dcda767c8\",\"kind\":\"SERVER\",\"name\":\"get /api\",\"timestamp\":1527669813705106,\"duration\":4802,\"localEndpoint\":{\"serviceName\":\"backend\",\"ipv4\":\"192.168.72.220\"},\"remoteEndpoint\":{\"ipv4\":\"127.0.0.1\",\"port\":55147},\"tags\":{\"http.method\":\"GET\",\"http.path\":\"/api\",\"mvc.controller.class\":\"Backend\",\"mvc.controller.method\":\"printDate\"},\"shared\":true}"; + span = "{\"traceId\":\"5b0e64354eea4fa71a8a1b5bdd791b8a\",\"parentId\":\"1a8a1b5bdd791b8a\",\"id\":\"d7d5b93dcda767c8\",\"kind\":\"SERVER\",\"name\":\"get /api\",\"timestamp\":1527669813705106,\"duration\":4802,\"localEndpoint\":{\"serviceName\":\"backend\",\"ipv4s\":\"192.168.72.220\"},\"remoteEndpoint\":{\"ipv4s\":\"127.0.0.1\",\"port\":55147},\"tags\":{\"http.method\":\"GET\",\"http.path\":\"/api\",\"mvc.controller.class\":\"Backend\",\"mvc.controller.method\":\"printDate\"},\"shared\":true}"; spans.add(SpanBytesDecoder.JSON_V2.decodeOne(span.getBytes("UTF-8"))); return SpanBytesDecoder.JSON_V2.decodeList(spans.toString().getBytes("UTF-8")); diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextCarrier.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextCarrier.java index b45c805b120a12c95fb27deda7f7816164a384c1..52c5ae82602510664c8d53a0dde36a3843f920ea 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextCarrier.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextCarrier.java @@ -57,7 +57,7 @@ public class ContextCarrier implements Serializable { private int entryApplicationInstanceId = DictionaryUtil.nullValue(); /** - * peer(ipv4/ipv6/hostname + port) of the server, from client side. + * peer(ipv4s/ipv6/hostname + port) of the server, from client side. */ private String peerHost; diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cache/EndpointInventoryCache.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cache/EndpointInventoryCache.java index b46c34de1b4506aa6baa3816574373330f48eaab..8cce526bf3e460efc2a0e65c71dd92860e90ba87 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cache/EndpointInventoryCache.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cache/EndpointInventoryCache.java @@ -52,18 +52,18 @@ public class EndpointInventoryCache implements Service { } return cacheDAO; } - + public int getEndpointId(int serviceId, String endpointName) { String id = EndpointInventory.buildId(serviceId, endpointName); int endpointId = Const.NONE; try { - endpointId = endpointNameCache.get(EndpointInventory.buildId(serviceId, endpointName), () -> getCacheDAO().getEndpointId(serviceId, endpointName)); + endpointId = endpointNameCache.get(id, () -> getCacheDAO().getEndpointId(serviceId, endpointName)); } catch (Throwable e) { logger.error(e.getMessage(), e); } - if (serviceId == Const.NONE) { + if (endpointId == Const.NONE) { endpointId = getCacheDAO().getEndpointId(serviceId, endpointName); if (endpointId != Const.NONE) { endpointNameCache.put(id, endpointId); diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cache/ServiceInventoryCache.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cache/ServiceInventoryCache.java index e4cf969cde1be5f7381e6adfae77cdeec5543df3..4213aca9e7dc291e4255900339b549b8fe98f20a 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cache/ServiceInventoryCache.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cache/ServiceInventoryCache.java @@ -19,6 +19,7 @@ package org.apache.skywalking.oap.server.core.cache; import com.google.common.cache.*; +import org.apache.skywalking.oap.server.core.Const; import org.apache.skywalking.oap.server.core.register.ServiceInventory; import org.apache.skywalking.oap.server.core.storage.StorageModule; import org.apache.skywalking.oap.server.core.storage.cache.IServiceInventoryCacheDAO; @@ -53,16 +54,16 @@ public class ServiceInventoryCache implements Service { } public int getServiceId(String serviceName) { - int serviceId = 0; + int serviceId = Const.NONE; try { serviceId = serviceNameCache.get(ServiceInventory.buildId(serviceName), () -> getCacheDAO().getServiceId(serviceName)); } catch (Throwable e) { logger.error(e.getMessage(), e); } - if (serviceId == 0) { + if (serviceId == Const.NONE) { serviceId = getCacheDAO().getServiceId(serviceName); - if (serviceId != 0) { + if (serviceId != Const.NONE) { serviceNameCache.put(ServiceInventory.buildId(serviceName), serviceId); } } @@ -70,16 +71,16 @@ public class ServiceInventoryCache implements Service { } public int getServiceId(int addressId) { - int serviceId = 0; + int serviceId = Const.NONE; try { serviceId = addressIdCache.get(ServiceInventory.buildId(addressId), () -> getCacheDAO().getServiceId(addressId)); } catch (Throwable e) { logger.error(e.getMessage(), e); } - if (serviceId == 0) { + if (serviceId == Const.NONE) { serviceId = getCacheDAO().getServiceId(addressId); - if (serviceId != 0) { + if (serviceId != Const.NONE) { addressIdCache.put(ServiceInventory.buildId(addressId), serviceId); } } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/ServiceInstanceInventory.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/ServiceInstanceInventory.java index 723244e54c109e0b28e2ea19f2065e15ecf328e5..dc6807c40b066b8df3731b7dd5576b23d834279e 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/ServiceInstanceInventory.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/ServiceInstanceInventory.java @@ -18,6 +18,8 @@ package org.apache.skywalking.oap.server.core.register; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; import java.util.*; import lombok.*; import org.apache.skywalking.oap.server.core.Const; @@ -40,13 +42,13 @@ public class ServiceInstanceInventory extends RegisterSource { public static final String MODEL_NAME = "service_instance_inventory"; public static final String NAME = "name"; - public static final String SERVICE_ID = "service_id"; - public static final String IS_ADDRESS = "is_address"; - public static final String ADDRESS_ID = "address_id"; + private static final String SERVICE_ID = "service_id"; + private static final String IS_ADDRESS = "is_address"; + private static final String ADDRESS_ID = "address_id"; private static final String OS_NAME = "os_name"; private static final String HOST_NAME = "host_name"; private static final String PROCESS_NO = "process_no"; - private static final String IPV4 = "ipv4"; + private static final String IPV4S = "ipv4s"; @Setter @Getter @Column(columnName = NAME, matchQuery = true) private String name = Const.EMPTY_STRING; @Setter @Getter @Column(columnName = SERVICE_ID) private int serviceId; @@ -55,7 +57,7 @@ public class ServiceInstanceInventory extends RegisterSource { @Setter @Getter @Column(columnName = OS_NAME) private String osName; @Setter @Getter @Column(columnName = HOST_NAME) private String hostName; @Setter @Getter @Column(columnName = PROCESS_NO) private int processNo; - @Setter @Getter @Column(columnName = IPV4) private String ipv4; + @Setter @Getter @Column(columnName = IPV4S) private String ipv4s; public static String buildId(int serviceId, String serviceInstanceName) { return serviceId + Const.ID_SPLIT + serviceInstanceName + Const.ID_SPLIT + BooleanUtils.FALSE + Const.ID_SPLIT + Const.NONE; @@ -117,7 +119,7 @@ public class ServiceInstanceInventory extends RegisterSource { remoteBuilder.setDataStrings(0, name); remoteBuilder.setDataStrings(1, osName); remoteBuilder.setDataStrings(2, hostName); - remoteBuilder.setDataStrings(3, ipv4); + remoteBuilder.setDataStrings(3, ipv4s); return remoteBuilder; } @@ -134,7 +136,7 @@ public class ServiceInstanceInventory extends RegisterSource { setName(remoteData.getDataStrings(0)); setOsName(remoteData.getDataStrings(1)); setHostName(remoteData.getDataStrings(2)); - setIpv4(remoteData.getDataStrings(3)); + setIpv4s(remoteData.getDataStrings(3)); } public static class Builder implements StorageBuilder { @@ -153,7 +155,7 @@ public class ServiceInstanceInventory extends RegisterSource { inventory.setName((String)dbMap.get(NAME)); inventory.setOsName((String)dbMap.get(OS_NAME)); inventory.setHostName((String)dbMap.get(HOST_NAME)); - inventory.setIpv4((String)dbMap.get(IPV4)); + inventory.setIpv4s((String)dbMap.get(IPV4S)); return inventory; } @@ -171,8 +173,30 @@ public class ServiceInstanceInventory extends RegisterSource { map.put(NAME, storageData.getName()); map.put(OS_NAME, storageData.getOsName()); map.put(HOST_NAME, storageData.getHostName()); - map.put(IPV4, storageData.getIpv4()); + map.put(IPV4S, storageData.getIpv4s()); return map; } } + + public static class AgentOsInfo { + @Setter @Getter private String osName; + @Setter @Getter private String hostname; + @Setter @Getter private int processNo; + @Getter private List ipv4s; + + public AgentOsInfo() { + this.ipv4s = new ArrayList<>(); + } + + public static String ipv4sSerialize(List ipv4) { + Gson gson = new Gson(); + return gson.toJson(ipv4); + } + + public static List ipv4sDeserialize(String ipv4s) { + Gson gson = new Gson(); + return gson.fromJson(ipv4s, new TypeToken>() { + }.getType()); + } + } } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/EndpointInventoryRegister.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/EndpointInventoryRegister.java index 8bfa3555126c48f99934fb98b8173504a65cf634..b3cd3dc50e7cf598d1df9cfe160ec4acd55353dd 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/EndpointInventoryRegister.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/EndpointInventoryRegister.java @@ -21,6 +21,7 @@ package org.apache.skywalking.oap.server.core.register.service; import org.apache.skywalking.oap.server.core.*; import org.apache.skywalking.oap.server.core.cache.EndpointInventoryCache; import org.apache.skywalking.oap.server.core.register.EndpointInventory; +import org.apache.skywalking.oap.server.core.register.worker.InventoryProcess; import org.apache.skywalking.oap.server.library.module.ModuleManager; import org.slf4j.*; @@ -59,6 +60,8 @@ public class EndpointInventoryRegister implements IEndpointInventoryRegister { long now = System.currentTimeMillis(); endpointInventory.setRegisterTime(now); endpointInventory.setHeartbeatTime(now); + + InventoryProcess.INSTANCE.in(endpointInventory); } return endpointId; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/IServiceInstanceInventoryRegister.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/IServiceInstanceInventoryRegister.java index fd5a38a8b9715b48424bfbd34871ac68ab1d01b2..acee9a8d9532630efb07119b750abd11bdc8492b 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/IServiceInstanceInventoryRegister.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/IServiceInstanceInventoryRegister.java @@ -18,6 +18,7 @@ package org.apache.skywalking.oap.server.core.register.service; +import org.apache.skywalking.oap.server.core.register.ServiceInstanceInventory; import org.apache.skywalking.oap.server.library.module.Service; /** @@ -25,7 +26,8 @@ import org.apache.skywalking.oap.server.library.module.Service; */ public interface IServiceInstanceInventoryRegister extends Service { - int getOrCreate(int serviceId, String serviceInstanceName, long registerTime); + int getOrCreate(int serviceId, String serviceInstanceName, long registerTime, + ServiceInstanceInventory.AgentOsInfo osInfo); int getOrCreate(int serviceId, int addressId, long registerTime); } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/NetworkAddressInventoryRegister.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/NetworkAddressInventoryRegister.java index ba2970232530257172a44f3a92ae94ec6e32dcb7..ba7f1070268d5df16774d3179739917ea70f150a 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/NetworkAddressInventoryRegister.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/NetworkAddressInventoryRegister.java @@ -81,6 +81,7 @@ public class NetworkAddressInventoryRegister implements INetworkAddressInventory long now = System.currentTimeMillis(); newNetworkAddress.setRegisterTime(now); newNetworkAddress.setHeartbeatTime(now); + InventoryProcess.INSTANCE.in(newNetworkAddress); } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/ServiceInstanceInventoryRegister.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/ServiceInstanceInventoryRegister.java index a4b99eb0ef7f9958b5efc6a9e5ea8962df80287b..bf67627556a72d8b0d7aa75f33518aaa23efa484 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/ServiceInstanceInventoryRegister.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/ServiceInstanceInventoryRegister.java @@ -18,9 +18,10 @@ package org.apache.skywalking.oap.server.core.register.service; -import org.apache.skywalking.oap.server.core.*; +import org.apache.skywalking.oap.server.core.Const; import org.apache.skywalking.oap.server.core.register.ServiceInstanceInventory; import org.apache.skywalking.oap.server.core.register.worker.InventoryProcess; +import org.apache.skywalking.oap.server.core.storage.StorageModule; import org.apache.skywalking.oap.server.core.storage.cache.IServiceInstanceInventoryCacheDAO; import org.apache.skywalking.oap.server.library.module.ModuleManager; import org.apache.skywalking.oap.server.library.util.BooleanUtils; @@ -44,12 +45,13 @@ public class ServiceInstanceInventoryRegister implements IServiceInstanceInvento private IServiceInstanceInventoryCacheDAO getCacheDAO() { if (isNull(cacheDAO)) { - cacheDAO = moduleManager.find(CoreModule.NAME).getService(IServiceInstanceInventoryCacheDAO.class); + cacheDAO = moduleManager.find(StorageModule.NAME).getService(IServiceInstanceInventoryCacheDAO.class); } return cacheDAO; } - @Override public int getOrCreate(int serviceId, String serviceInstanceName, long registerTime) { + @Override public int getOrCreate(int serviceId, String serviceInstanceName, long registerTime, + ServiceInstanceInventory.AgentOsInfo osInfo) { if (logger.isDebugEnabled()) { logger.debug("Get or create service instance by service instance name, service id: {}, service instance name: {}, registerTime: {}", serviceId, serviceInstanceName, registerTime); } @@ -66,6 +68,11 @@ public class ServiceInstanceInventoryRegister implements IServiceInstanceInvento serviceInstanceInventory.setRegisterTime(registerTime); serviceInstanceInventory.setHeartbeatTime(registerTime); + serviceInstanceInventory.setOsName(osInfo.getOsName()); + serviceInstanceInventory.setHostName(osInfo.getHostname()); + serviceInstanceInventory.setProcessNo(osInfo.getProcessNo()); + serviceInstanceInventory.setIpv4s(ServiceInstanceInventory.AgentOsInfo.ipv4sSerialize(osInfo.getIpv4s())); + InventoryProcess.INSTANCE.in(serviceInstanceInventory); } return serviceInstanceId; diff --git a/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/register/provider/RegisterModuleProvider.java b/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/register/provider/RegisterModuleProvider.java index 38fd9bff735e7481f16d7131a7520a8208eb39d1..6a1706a24a4460e2d2e7e62efce09c22806d7dfa 100644 --- a/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/register/provider/RegisterModuleProvider.java +++ b/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/register/provider/RegisterModuleProvider.java @@ -47,7 +47,9 @@ public class RegisterModuleProvider extends ModuleProvider { @Override public void start() { GRPCHandlerRegister grpcHandlerRegister = getManager().find(CoreModule.NAME).getService(GRPCHandlerRegister.class); grpcHandlerRegister.addHandler(new ApplicationRegisterHandler(getManager())); + grpcHandlerRegister.addHandler(new InstanceDiscoveryServiceHandler(getManager())); grpcHandlerRegister.addHandler(new ServiceNameDiscoveryHandler(getManager())); + grpcHandlerRegister.addHandler(new NetworkAddressRegisterServiceHandler(getManager())); } @Override public void notifyAfterCompleted() { diff --git a/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/ApplicationRegisterHandler.java b/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/ApplicationRegisterHandler.java index 97b3aca92f0f4a5169fb20720fab497fa5266665..ea698bc14040cdd38294f6a1ad6e27685ae8a603 100644 --- a/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/ApplicationRegisterHandler.java +++ b/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/ApplicationRegisterHandler.java @@ -42,7 +42,7 @@ public class ApplicationRegisterHandler extends ApplicationRegisterServiceGrpc.A @Override public void applicationCodeRegister(Application request, StreamObserver responseObserver) { if (logger.isDebugEnabled()) { - logger.debug("register application"); + logger.debug("Register application, application code: {}", request.getApplicationCode()); } ApplicationMapping.Builder builder = ApplicationMapping.newBuilder(); diff --git a/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/InstanceDiscoveryServiceHandler.java b/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/InstanceDiscoveryServiceHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..4295b0912555c1f7c9a4b40cce92012c06c791ac --- /dev/null +++ b/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/InstanceDiscoveryServiceHandler.java @@ -0,0 +1,70 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.oap.server.receiver.register.provider.handler.v5; + +import io.grpc.stub.StreamObserver; +import org.apache.skywalking.apm.network.language.agent.*; +import org.apache.skywalking.oap.server.core.CoreModule; +import org.apache.skywalking.oap.server.core.register.ServiceInstanceInventory; +import org.apache.skywalking.oap.server.core.register.service.IServiceInstanceInventoryRegister; +import org.apache.skywalking.oap.server.library.module.ModuleManager; +import org.apache.skywalking.oap.server.library.server.grpc.GRPCHandler; +import org.slf4j.*; + +/** + * @author peng-yongsheng + */ +public class InstanceDiscoveryServiceHandler extends InstanceDiscoveryServiceGrpc.InstanceDiscoveryServiceImplBase implements GRPCHandler { + + private static final Logger logger = LoggerFactory.getLogger(InstanceDiscoveryServiceHandler.class); + + private final IServiceInstanceInventoryRegister serviceInstanceInventoryRegister; +// private final IInstanceHeartBeatService instanceHeartBeatService; + + public InstanceDiscoveryServiceHandler(ModuleManager moduleManager) { + this.serviceInstanceInventoryRegister = moduleManager.find(CoreModule.NAME).getService(IServiceInstanceInventoryRegister.class); +// this.instanceHeartBeatService = moduleManager.find(CoreModule.NAME).getService(IInstanceHeartBeatService.class); + } + + @Override + public void registerInstance(ApplicationInstance request, + StreamObserver responseObserver) { + OSInfo osinfo = request.getOsinfo(); + ServiceInstanceInventory.AgentOsInfo agentOsInfo = new ServiceInstanceInventory.AgentOsInfo(); + agentOsInfo.setHostname(osinfo.getHostname()); + agentOsInfo.setOsName(osinfo.getOsName()); + agentOsInfo.setProcessNo(osinfo.getProcessNo()); + agentOsInfo.getIpv4s().addAll(osinfo.getIpv4SList()); + + int serviceInstanceId = serviceInstanceInventoryRegister.getOrCreate(request.getApplicationId(), request.getAgentUUID(), request.getRegisterTime(), agentOsInfo); + ApplicationInstanceMapping.Builder builder = ApplicationInstanceMapping.newBuilder(); + builder.setApplicationId(request.getApplicationId()); + builder.setApplicationInstanceId(serviceInstanceId); + responseObserver.onNext(builder.build()); + responseObserver.onCompleted(); + } + + @Override public void heartbeat(ApplicationInstanceHeartbeat request, StreamObserver responseObserver) { +// int instanceId = request.getApplicationInstanceId(); +// long heartBeatTime = request.getHeartbeatTime(); +// this.instanceHeartBeatService.heartBeat(instanceId, heartBeatTime); +// responseObserver.onNext(Downstream.getDefaultInstance()); +// responseObserver.onCompleted(); + } +} diff --git a/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/NetworkAddressRegisterServiceHandler.java b/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/NetworkAddressRegisterServiceHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..6df497b591cf4ff3c305981c918471432df87cb8 --- /dev/null +++ b/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/NetworkAddressRegisterServiceHandler.java @@ -0,0 +1,63 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.oap.server.receiver.register.provider.handler.v5; + +import com.google.protobuf.ProtocolStringList; +import io.grpc.stub.StreamObserver; +import org.apache.skywalking.apm.network.language.agent.*; +import org.apache.skywalking.oap.server.core.*; +import org.apache.skywalking.oap.server.core.register.service.INetworkAddressInventoryRegister; +import org.apache.skywalking.oap.server.library.module.ModuleManager; +import org.apache.skywalking.oap.server.library.server.grpc.GRPCHandler; +import org.slf4j.*; + +/** + * @author peng-yongsheng + */ +public class NetworkAddressRegisterServiceHandler extends NetworkAddressRegisterServiceGrpc.NetworkAddressRegisterServiceImplBase implements GRPCHandler { + + private static final Logger logger = LoggerFactory.getLogger(NetworkAddressRegisterServiceHandler.class); + + private final INetworkAddressInventoryRegister networkAddressInventoryRegister; + + public NetworkAddressRegisterServiceHandler(ModuleManager moduleManager) { + this.networkAddressInventoryRegister = moduleManager.find(CoreModule.NAME).getService(INetworkAddressInventoryRegister.class); + } + + @Override + public void batchRegister(NetworkAddresses request, StreamObserver responseObserver) { + if (logger.isDebugEnabled()) { + logger.debug("register application"); + } + + ProtocolStringList addressesList = request.getAddressesList(); + + NetworkAddressMappings.Builder builder = NetworkAddressMappings.newBuilder(); + for (String networkAddress : addressesList) { + int addressId = networkAddressInventoryRegister.getOrCreate(networkAddress); + + if (addressId != Const.NONE) { + KeyWithIntegerValue value = KeyWithIntegerValue.newBuilder().setKey(networkAddress).setValue(addressId).build(); + builder.addAddressIds(value); + } + } + responseObserver.onNext(builder.build()); + responseObserver.onCompleted(); + } +} diff --git a/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/ApplicationRegisterHandlerTestCase.java b/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/ApplicationRegisterHandlerTestCase.java index a4e3a08c29355e422832f83bb71ca2bf1e665b24..19dbe6701b30c36537d880f56072cf3e8dc8eca6 100644 --- a/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/ApplicationRegisterHandlerTestCase.java +++ b/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/ApplicationRegisterHandlerTestCase.java @@ -38,6 +38,6 @@ public class ApplicationRegisterHandlerTestCase { application.setApplicationCode("dubbox-consumer"); ApplicationMapping applicationMapping = stub.applicationCodeRegister(application.build()); - logger.debug("application id: {}", applicationMapping.getApplication().getValue()); + logger.info("application id: {}", applicationMapping.getApplication().getValue()); } } diff --git a/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/InstanceDiscoveryServiceHandlerTestCase.java b/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/InstanceDiscoveryServiceHandlerTestCase.java new file mode 100644 index 0000000000000000000000000000000000000000..20a0226beac76e0a98acbf74bd23d1ac3b2a8a36 --- /dev/null +++ b/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/InstanceDiscoveryServiceHandlerTestCase.java @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.oap.server.receiver.register.provider.handler.v5; + +import io.grpc.*; +import org.apache.skywalking.apm.network.language.agent.*; +import org.slf4j.*; + +/** + * @author peng-yongsheng + */ +public class InstanceDiscoveryServiceHandlerTestCase { + + private static final Logger logger = LoggerFactory.getLogger(InstanceDiscoveryServiceHandlerTestCase.class); + + public static void main(String[] args) { + ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 11800).usePlaintext(true).build(); + + InstanceDiscoveryServiceGrpc.InstanceDiscoveryServiceBlockingStub stub = InstanceDiscoveryServiceGrpc.newBlockingStub(channel); + + ApplicationInstance.Builder applicationInstance = ApplicationInstance.newBuilder(); + applicationInstance.setApplicationId(1); + applicationInstance.setAgentUUID("Test"); + applicationInstance.setRegisterTime(System.currentTimeMillis()); + + OSInfo.Builder osInfo = OSInfo.newBuilder(); + osInfo.setOsName("mac os"); + osInfo.setHostname("pengys"); + osInfo.setProcessNo(1); + osInfo.addIpv4S("10.0.0.1"); + osInfo.addIpv4S("10.0.0.2"); + applicationInstance.setOsinfo(osInfo); + + ApplicationInstanceMapping instanceMapping = stub.registerInstance(applicationInstance.build()); + logger.info("application id: {}, application instance id: {}", instanceMapping.getApplicationId(), instanceMapping.getApplicationInstanceId()); + } +} diff --git a/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/NetworkAddressRegisterServiceHandlerTestCase.java b/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/NetworkAddressRegisterServiceHandlerTestCase.java new file mode 100644 index 0000000000000000000000000000000000000000..52ecded86d76ac9e58eceef2150bf4a85ae51eeb --- /dev/null +++ b/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/NetworkAddressRegisterServiceHandlerTestCase.java @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.oap.server.receiver.register.provider.handler.v5; + +import io.grpc.*; +import org.apache.skywalking.apm.network.language.agent.*; +import org.slf4j.*; + +/** + * @author peng-yongsheng + */ +public class NetworkAddressRegisterServiceHandlerTestCase { + + private static final Logger logger = LoggerFactory.getLogger(NetworkAddressRegisterServiceHandlerTestCase.class); + + public static void main(String[] args) { + ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 11800).usePlaintext(true).build(); + + NetworkAddressRegisterServiceGrpc.NetworkAddressRegisterServiceBlockingStub stub = NetworkAddressRegisterServiceGrpc.newBlockingStub(channel); + + NetworkAddresses.Builder networkAddresses = NetworkAddresses.newBuilder(); + networkAddresses.addAddresses("127.0.0.1:8080"); + + NetworkAddressMappings addressMappings = stub.batchRegister(networkAddresses.build()); + + for (KeyWithIntegerValue value : addressMappings.getAddressIdsList()) { + logger.info("key: {}, value: {}", value.getKey(), value.getValue()); + } + } +} diff --git a/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/ServiceNameDiscoveryHandlerTestCase.java b/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/ServiceNameDiscoveryHandlerTestCase.java index 5a000440756aa5f8264cb44d45a9833d6b6c6f42..b324d9cc09bd7c0908cc027a7696b301023e6d55 100644 --- a/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/ServiceNameDiscoveryHandlerTestCase.java +++ b/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v5/ServiceNameDiscoveryHandlerTestCase.java @@ -41,8 +41,9 @@ public class ServiceNameDiscoveryHandlerTestCase { serviceNameCollection.addElements(serviceNameElement); ServiceNameMappingCollection collection = stub.discovery(serviceNameCollection.build()); + for (ServiceNameMappingElement element : collection.getElementsList()) { - logger.debug("service id: {}", element.getServiceId()); + logger.info("service id: {}", element.getServiceId()); } } } diff --git a/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/test/resources/log4j2.xml b/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/test/resources/log4j2.xml index 6eb5b3fb98466839418c5d6f2cf003c983960df0..cd672826bb3f1101d0e50c682f82db68895a66a7 100644 --- a/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/test/resources/log4j2.xml +++ b/oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/test/resources/log4j2.xml @@ -17,14 +17,14 @@ ~ --> - + - + diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/ColumnTypeEsMapping.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/ColumnTypeEsMapping.java index 41bcb78045fc05addadb63d1d2ea2b4e45270e62..c7ceeeda951e45e17e6f16f8392913144dd4be9f 100644 --- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/ColumnTypeEsMapping.java +++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/ColumnTypeEsMapping.java @@ -33,7 +33,7 @@ public class ColumnTypeEsMapping implements DataTypeMapping { } else if (Double.class.equals(type) || double.class.equals(type)) { return "double"; } else if (String.class.equals(type)) { - return "text"; + return "keyword"; } else { throw new IllegalArgumentException("Unsupported data type: " + type.getName()); } diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/EndpointInventoryCacheEsDAO.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/EndpointInventoryCacheEsDAO.java index bb8ee22e0ddc5980b273cf2d92ece185b4e988fd..ecdf877f9a34654c40f60e0178f184f17cea6528 100644 --- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/EndpointInventoryCacheEsDAO.java +++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/EndpointInventoryCacheEsDAO.java @@ -48,7 +48,7 @@ public class EndpointInventoryCacheEsDAO extends EsDAO implements IEndpointInven String id = EndpointInventory.buildId(serviceId, endpointName); GetResponse response = getClient().get(EndpointInventory.MODEL_NAME, id); if (response.isExists()) { - return response.getField(RegisterSource.SEQUENCE).getValue(); + return (int)response.getSource().getOrDefault(RegisterSource.SEQUENCE, 0); } else { return Const.NONE; } diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/NetworkAddressInventoryCacheEsDAO.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/NetworkAddressInventoryCacheEsDAO.java index b8325180919d8a2b111018ecb1361ab7e042286b..9022f860ba95919a94d4d7a011582dae44e60692 100644 --- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/NetworkAddressInventoryCacheEsDAO.java +++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/NetworkAddressInventoryCacheEsDAO.java @@ -48,7 +48,7 @@ public class NetworkAddressInventoryCacheEsDAO extends EsDAO implements INetwork String id = NetworkAddressInventory.buildId(networkAddress); GetResponse response = getClient().get(NetworkAddressInventory.MODEL_NAME, id); if (response.isExists()) { - return response.getField(RegisterSource.SEQUENCE).getValue(); + return (int)response.getSource().getOrDefault(RegisterSource.SEQUENCE, 0); } else { return Const.NONE; } diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/ServiceInstanceInventoryCacheDAO.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/ServiceInstanceInventoryCacheDAO.java index e56215d856a066e0082604e7aaffd34f5c9c857d..ecfb568c7a611013380538fa9e4473ae034bf454 100644 --- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/ServiceInstanceInventoryCacheDAO.java +++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/ServiceInstanceInventoryCacheDAO.java @@ -76,7 +76,7 @@ public class ServiceInstanceInventoryCacheDAO extends EsDAO implements IServiceI try { GetResponse response = getClient().get(ServiceInstanceInventory.MODEL_NAME, id); if (response.isExists()) { - return response.getField(RegisterSource.SEQUENCE).getValue(); + return (int)response.getSource().getOrDefault(RegisterSource.SEQUENCE, 0); } else { return Const.NONE; } diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/ServiceInventoryCacheEsDAO.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/ServiceInventoryCacheEsDAO.java index c0afba8eaf529fa4ec217757f1e5813b3d504bad..8c5e2c00a9581341f4a067af2b2e3af13c4a0967 100644 --- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/ServiceInventoryCacheEsDAO.java +++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/ServiceInventoryCacheEsDAO.java @@ -57,7 +57,7 @@ public class ServiceInventoryCacheEsDAO extends EsDAO implements IServiceInvento try { GetResponse response = getClient().get(ServiceInventory.MODEL_NAME, id); if (response.isExists()) { - return response.getField(RegisterSource.SEQUENCE).getValue(); + return (int)response.getSource().getOrDefault(RegisterSource.SEQUENCE, 0); } else { return Const.NONE; } diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/lock/RegisterLockInstaller.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/lock/RegisterLockInstaller.java index dc1be5bd62fc156dfd70e5300e55ac777a45e0a6..383f7b4c4d5ded1f4c05b60c6022a0f88a34703f 100644 --- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/lock/RegisterLockInstaller.java +++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/lock/RegisterLockInstaller.java @@ -48,6 +48,7 @@ public class RegisterLockInstaller { putIfAbsent(Scope.Endpoint.ordinal()); putIfAbsent(Scope.ServiceInstance.ordinal()); putIfAbsent(Scope.Service.ordinal()); + putIfAbsent(Scope.NetworkAddress.ordinal()); } catch (IOException e) { throw new StorageException(e.getMessage()); }