Skip to content

Commit 087a041

Browse files
author
fishtailfu
committed
feat: support config event and monitor address list.
1 parent a1f42fa commit 087a041

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ private URI getEventUri() {
170170
}
171171

172172
private URI getEventUriByNode(Node node) {
173+
if (LOG.isDebugEnabled()) {
174+
LOG.debug("[PushGatewayEventReporter] choose node: {}", node.getHostPort());
175+
}
173176
if (node != null) {
174177
// First try to get URI from cache.
175178
URI cachedUri = eventUriMap.get(node);

polaris-plugins/polaris-plugins-observability/stat-prometheus/src/main/java/com/tencent/polaris/plugins/stat/prometheus/plugin/PrometheusReporter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@ private void startSchedulePushTask() {
312312

313313
private void doPush() {
314314
String address = serviceAddressRepository.getServiceAddress();
315+
if (LOGGER.isDebugEnabled()) {
316+
LOGGER.debug("[PrometheusReporter] send push request to :" + address);
317+
}
315318
try {
316319
CommonHandler.putDataFromContainerInOrder(sampleMapping, container.getInsCollector(),
317320
container.getInsCollector().getCurrentRevision(),

polaris-plugins/polaris-plugins-observability/stat-prometheus/src/test/java/com/tencent/polaris/plugins/stat/prometheus/plugin/PrometheusReporterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void setUp() {
6363
PrometheusHandlerConfig config = new PrometheusHandlerConfig();
6464
config.setType("push");
6565
config.setPushInterval(pushInterval);
66-
config.setAddress(PUSH_DEFAULT_ADDRESS);
66+
config.setAddress(Collections.singletonList(PUSH_DEFAULT_ADDRESS));
6767
MockPushGateway pgw = new MockPushGateway(PUSH_DEFAULT_ADDRESS);
6868
handler = new PrometheusReporter();
6969
handler.setEnable(true);

0 commit comments

Comments
 (0)