Restore bootstrap.yml. Don't throw exception in reporting process.

pull/546/head
pandaapo 3 years ago
parent f0c6c2ef95
commit 500faa1e1a

@ -9,6 +9,6 @@ spring:
content:
label1: value1
polaris:
address: grpc://127.0.0.1:8091
address: grpc://183.47.111.80:8091
namespace: default
enabled: true

@ -9,6 +9,6 @@ spring:
content:
label1: value2
polaris:
address: grpc://127.0.0.1:8091
address: grpc://183.47.111.80:8091
namespace: default
enabled: true

@ -8,17 +8,12 @@ spring:
metadata:
content:
k1: v1
rpc-enhancement:
reporter:
series: client_error, server_error
polaris:
address: grpc://127.0.0.1:8091
address: grpc://183.47.111.80:8091
namespace: default
enabled: true
loadbalancer:
enabled: true
stat:
enabled: true
management:
endpoints:
web:

@ -31,6 +31,8 @@ import com.tencent.polaris.api.utils.CollectionUtils;
import feign.Request;
import feign.RequestTemplate;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static com.tencent.cloud.common.constant.ContextConstant.UTF_8;
@ -41,6 +43,8 @@ import static com.tencent.cloud.common.constant.ContextConstant.UTF_8;
*/
public final class ReporterUtils {
private static final Logger LOGGER = LoggerFactory.getLogger(ReporterUtils.class);
private ReporterUtils() {
}
@ -57,10 +61,9 @@ public final class ReporterUtils {
label = URLDecoder.decode(label, UTF_8);
}
catch (UnsupportedEncodingException e) {
throw new RuntimeException("unsupported charset exception " + UTF_8);
LOGGER.error("unsupported charset exception " + UTF_8, e);
}
label = convertLabel(label);
resultRequest.setLabels(label);
resultRequest.setLabels(convertLabel(label));
}
resultRequest.setService(serviceName);
URI uri = URI.create(request.url());

@ -83,7 +83,7 @@ public class ReporterUtilsTest {
RequestTemplate requestTemplate = new RequestTemplate();
requestTemplate.feignTarget(target);
try {
requestTemplate.header(RouterConstants.ROUTER_LABEL_HEADER, URLEncoder.encode("k1:v1|k2:v2", UTF_8));
requestTemplate.header(RouterConstants.ROUTER_LABEL_HEADER, URLEncoder.encode("{\"k1\":\"v1\",\"k2\":\"v2\"}", UTF_8));
}
catch (UnsupportedEncodingException e) {
throw new RuntimeException("unsupported charset exception " + UTF_8);

Loading…
Cancel
Save