Set telemetry instanced id for etcd and nacos plugin (#3492)

* Update docker-entrypoint.sh

* Set telemtry instance id in etcd and nacos plugins
This commit is contained in:
Gao Hongtao 2019-09-20 11:35:22 +08:00 committed by 吴晟 Wu Sheng
parent 60236a27d6
commit 09064e97a8
2 changed files with 4 additions and 0 deletions

View File

@ -33,6 +33,7 @@ import org.apache.skywalking.oap.server.core.cluster.ClusterRegister;
import org.apache.skywalking.oap.server.core.cluster.RemoteInstance;
import org.apache.skywalking.oap.server.core.cluster.ServiceRegisterException;
import org.apache.skywalking.oap.server.core.remote.client.Address;
import org.apache.skywalking.oap.server.telemetry.api.TelemetryRelatedContext;
/**
* @author Alan Lau
@ -90,6 +91,7 @@ public class EtcdCoordinator implements ClusterRegister, ClusterNodesQuery {
}
this.selfAddress = remoteInstance.getAddress();
TelemetryRelatedContext.INSTANCE.setId(selfAddress.toString());
EtcdEndpoint endpoint = new EtcdEndpoint.Builder().serviceName(serviceName).host(selfAddress.getHost()).port(selfAddress.getPort()).build();
try {

View File

@ -24,6 +24,7 @@ import com.alibaba.nacos.api.naming.pojo.Instance;
import org.apache.skywalking.oap.server.core.cluster.*;
import org.apache.skywalking.oap.server.core.remote.client.Address;
import org.apache.skywalking.oap.server.library.util.CollectionUtils;
import org.apache.skywalking.oap.server.telemetry.api.TelemetryRelatedContext;
import java.util.ArrayList;
import java.util.List;
@ -72,5 +73,6 @@ public class NacosCoordinator implements ClusterRegister, ClusterNodesQuery {
throw new ServiceRegisterException(e.getMessage());
}
this.selfAddress = remoteInstance.getAddress();
TelemetryRelatedContext.INSTANCE.setId(selfAddress.toString());
}
}