提交 09064e97 编写于 作者: G Gao Hongtao 提交者: wu-sheng

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

* Update docker-entrypoint.sh

* Set telemtry instance id in etcd and nacos plugins
上级 60236a27
......@@ -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 {
......
......@@ -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());
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册