Skip to content

Commit e1c9e28

Browse files
authored
fix: fix chinese garbled characters in event. (#602)
1 parent 3aa56a3 commit e1c9e28

File tree

1 file changed

+2
-1
lines changed
  • polaris-plugins/polaris-plugins-observability/event-pushgateway/src/main/java/com/tencent/polaris/plugins/event/pushgateway

1 file changed

+2
-1
lines changed

polaris-plugins/polaris-plugins-observability/event-pushgateway/src/main/java/com/tencent/polaris/plugins/event/pushgateway/PushGatewayEventReporter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252

5353
import java.net.URI;
5454
import java.net.URISyntaxException;
55+
import java.nio.charset.StandardCharsets;
5556
import java.util.ArrayList;
5657
import java.util.Collections;
5758
import java.util.List;
@@ -223,7 +224,7 @@ private void postPushGatewayEvent(PushGatewayEventRequest request) {
223224
RequestConfig config = RequestConfig.custom().setConnectTimeout(2000).setConnectionRequestTimeout(10000).setSocketTimeout(10000).build();
224225
try (CloseableHttpClient httpClient = HttpClientBuilder.create().setDefaultRequestConfig(config).build()) {
225226
HttpPost httpPost = new HttpPost(getEventUri());
226-
postBody = new StringEntity(mapper.writeValueAsString(request));
227+
postBody = new StringEntity(mapper.writeValueAsString(request), StandardCharsets.UTF_8);
227228
if (LOG.isDebugEnabled()) {
228229
LOG.debug("postPushGatewayEvent body:{}", postBody);
229230
}

0 commit comments

Comments
 (0)