Skip to content

Commit 0b0393b

Browse files
committed
remove instance id.
1 parent 3c49a68 commit 0b0393b

File tree

8 files changed

+3
-49
lines changed

8 files changed

+3
-49
lines changed

polaris-discovery/polaris-discovery-client/src/main/java/com/tencent/polaris/discovery/client/flow/DefaultDiscoveryFlow.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,6 @@ private InstanceRegisterResponse doRegister(InstanceRegisterRequest req, Map<Str
153153
response.getInstanceID());
154154
serviceCallResult.setRetStatus(RetStatus.RetSuccess);
155155
serviceCallResult.setRetCode(ErrorCode.Success.getCode());
156-
sdkContext.getValueContext().setPort(req.getPort());
157-
sdkContext.getValueContext().setInstanceId(response.getInstanceID());
158156
return new InstanceRegisterResponse(response.getInstanceID(), response.isExists());
159157
} catch (PolarisException e) {
160158
serviceCallResult.setRetStatus(RetStatus.RetFail);

polaris-plugins/polaris-plugin-api/src/main/java/com/tencent/polaris/api/plugin/common/ValueContext.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,8 @@ public class ValueContext {
3434

3535
private static final String KEY_HOST = "key_host";
3636

37-
private static final String KEY_PORT = "key_port";
38-
3937
private static final String KEY_CLIENT_ID = "key_clientId";
4038

41-
private static final String KEY_INSTANCE_ID = "key_instanceId";
42-
4339
private static final String KEY_ENGINE = "key_engine";
4440

4541
private static final String KEY_SERVER_CONNECTOR_PROTOCOL = "key_serverConnectorProtocol";
@@ -93,14 +89,6 @@ public void setHost(String host) {
9389
setValue(KEY_HOST, host);
9490
}
9591

96-
public Integer getPort() {
97-
return getValue(KEY_PORT);
98-
}
99-
100-
public void setPort(Integer port) {
101-
setValue(KEY_PORT, port);
102-
}
103-
10492
public String getClientId() {
10593
return getValue(KEY_CLIENT_ID);
10694
}
@@ -109,14 +97,6 @@ public void setClientId(String clientId) {
10997
setValue(KEY_CLIENT_ID, clientId);
11098
}
11199

112-
public String getInstanceId() {
113-
return getValue(KEY_INSTANCE_ID);
114-
}
115-
116-
public void setInstanceId(String instanceId) {
117-
setValue(KEY_INSTANCE_ID, instanceId);
118-
}
119-
120100
public String getServerConnectorProtocol() {
121101
return getValue(KEY_SERVER_CONNECTOR_PROTOCOL);
122102
}

polaris-plugins/polaris-plugin-api/src/main/java/com/tencent/polaris/api/plugin/event/FlowEvent.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,6 @@ public class FlowEvent {
9393
@JsonProperty("api_method")
9494
private final String apiMethod;
9595

96-
/**
97-
* 实例ID
98-
*/
99-
@JsonProperty("instance_id")
100-
private final String instanceId;
101-
10296
/**
10397
* 实例IP
10498
*/
@@ -168,7 +162,6 @@ private FlowEvent(Builder builder) {
168162
this.apiProtocol = builder.apiProtocol;
169163
this.apiPath = builder.apiPath;
170164
this.apiMethod = builder.apiMethod;
171-
this.instanceId = builder.instanceId;
172165
this.host = builder.host;
173166
if (builder.port != null) {
174167
this.port = String.valueOf(builder.port);
@@ -197,7 +190,6 @@ public static class Builder {
197190
private String apiProtocol = "";
198191
private String apiPath = "";
199192
private String apiMethod = "";
200-
private String instanceId = "";
201193
private String host = "";
202194
private Integer port;
203195
private String sourceNamespace = "";
@@ -259,11 +251,6 @@ public Builder withApiMethod(String apiMethod) {
259251
return this;
260252
}
261253

262-
public Builder withInstanceId(String instanceId) {
263-
this.instanceId = instanceId;
264-
return this;
265-
}
266-
267254
public Builder withHost(String host) {
268255
this.host = host;
269256
return this;
@@ -359,10 +346,6 @@ public String getApiMethod() {
359346
return apiMethod;
360347
}
361348

362-
public String getInstanceId() {
363-
return instanceId;
364-
}
365-
366349
public String getHost() {
367350
return host;
368351
}
@@ -420,7 +403,6 @@ public String toString() {
420403
", apiProtocol='" + apiProtocol + '\'' +
421404
", apiPath='" + apiPath + '\'' +
422405
", apiMethod='" + apiMethod + '\'' +
423-
", instanceId='" + instanceId + '\'' +
424406
", host='" + host + '\'' +
425407
", port='" + port + '\'' +
426408
", sourceNamespace='" + sourceNamespace + '\'' +

polaris-plugins/polaris-plugins-circuitbreaker/circuitbreaker-composite/src/main/java/com/tencent/polaris/plugins/circuitbreaker/composite/ResourceCounters.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ private void reportEvent(CircuitBreakerStatus.Status previousStatus, CircuitBrea
351351
.withClientIp(extensions.getValueContext().getHost())
352352
.withNamespace(resource.getService().getNamespace())
353353
.withService(resource.getService().getService())
354-
.withInstanceId(extensions.getValueContext().getInstanceId())
355354
.withSourceNamespace(resource.getCallerService().getNamespace())
356355
.withSourceService(resource.getService().getService())
357356
.withCurrentStatus(currentFlowEventStatus)

polaris-plugins/polaris-plugins-lossless/lossless-common/src/main/java/com/tencent/polaris/plugin/lossless/common/LosslessEventUtils.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public static void reportEvent(Extensions extensions, String namespace, String s
4444
.withClientIp(extensions.getValueContext().getHost())
4545
.withNamespace(namespace)
4646
.withService(service)
47-
.withInstanceId(extensions.getValueContext().getInstanceId())
4847
.withHost(host)
4948
.withPort(port);
5049

polaris-plugins/polaris-plugins-observability/event-logger/src/main/java/com/tencent/polaris/plugins/event/logger/LoggerEventReporter.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,8 @@ public String convertMessage(FlowEvent event) {
117117
return eventType + "|" + eventName + "|" + formattedDateTime + "|" + event.getClientId() + "|"
118118
+ event.getClientIp() + "|" + event.getNamespace() + "|" + event.getService() + "|"
119119
+ event.getApiProtocol() + "|" + event.getApiPath() + "|" + event.getApiMethod() + "|"
120-
+ event.getInstanceId() + "|" + event.getHost() + "|" + event.getPort() + "|"
121-
+ event.getSourceNamespace() + "|" + event.getSourceService() + "|" + event.getLabels() + "|"
122-
+ currentStatus + "|" + previousStatus + "|" + resourceType + "|" + event.getRuleName() + "|"
123-
+ event.getReason();
120+
+ event.getHost() + "|" + event.getPort() + "|" + event.getSourceNamespace() + "|"
121+
+ event.getSourceService() + "|" + event.getLabels() + "|" + currentStatus + "|"
122+
+ previousStatus + "|" + resourceType + "|" + event.getRuleName() + "|" + event.getReason();
124123
}
125124
}

polaris-plugins/polaris-plugins-observability/event-pushgateway/src/test/java/com/tencent/polaris/plugins/event/pushgateway/PushGatewayEventRequestTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public void test() throws JsonProcessingException {
5050
.withClientIp("1.2.3.4")
5151
.withNamespace("test-namespace")
5252
.withService("test-service")
53-
.withInstanceId("test-instance")
5453
.withHost("1.2.3.4")
5554
.withPort(8080)
5655
.build();

polaris-ratelimit/polaris-ratelimit-client/src/main/java/com/tencent/polaris/ratelimit/client/utils/RateLimiterEventUtils.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ public static void reportEvent(Extensions extensions, ServiceKey serviceKey, Rat
5656
.withNamespace(serviceKey.getNamespace())
5757
.withService(serviceKey.getService())
5858
.withApiPath(rule.getMethod().getValue().getValue())
59-
.withInstanceId(extensions.getValueContext().getInstanceId())
6059
.withHost(extensions.getValueContext().getHost())
61-
.withPort(extensions.getValueContext().getPort())
6260
.withSourceNamespace(sourceNamespace)
6361
.withSourceService(sourceService)
6462
.withLabels(labels)

0 commit comments

Comments
 (0)