diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..476dcdd --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,16 @@ +name: tiered-storage-build + +on: [pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Build with Maven + run: mvn -B package --file pom.xml \ No newline at end of file diff --git a/ts-segment-uploader/src/main/java/com/pinterest/kafka/tieredstorage/uploader/UploaderMetrics.java b/ts-segment-uploader/src/main/java/com/pinterest/kafka/tieredstorage/uploader/UploaderMetrics.java index 36e05e7..13aca8c 100644 --- a/ts-segment-uploader/src/main/java/com/pinterest/kafka/tieredstorage/uploader/UploaderMetrics.java +++ b/ts-segment-uploader/src/main/java/com/pinterest/kafka/tieredstorage/uploader/UploaderMetrics.java @@ -34,4 +34,5 @@ public class UploaderMetrics { public static final String ADD_WATCHER_FAILED_METRIC = UPLOADER_METRIC_PREFIX + "." + "add.watcher.failed"; public static final String ENQUEUE_TO_UPLOAD_LATENCY_MS_METRIC = UPLOADER_METRIC_PREFIX + "." + "enqueue.to.upload.latency.ms"; public static final String RETRY_MARKED_FOR_DELETION_COUNT_METRIC = UPLOADER_METRIC_PREFIX + "." + "retry.marked.for.deletion.count"; + public static final String WATCHER_ZK_EXCEPTION_METRIC = UPLOADER_METRIC_PREFIX + "." + "watcher.zk.exception"; } diff --git a/ts-segment-uploader/src/main/java/com/pinterest/kafka/tieredstorage/uploader/leadership/KafkaLeadershipWatcher.java b/ts-segment-uploader/src/main/java/com/pinterest/kafka/tieredstorage/uploader/leadership/KafkaLeadershipWatcher.java index 4ef3547..4d7775f 100644 --- a/ts-segment-uploader/src/main/java/com/pinterest/kafka/tieredstorage/uploader/leadership/KafkaLeadershipWatcher.java +++ b/ts-segment-uploader/src/main/java/com/pinterest/kafka/tieredstorage/uploader/leadership/KafkaLeadershipWatcher.java @@ -96,6 +96,13 @@ public void start() throws InterruptedException, KeeperException { applyCurrentState(); } catch (Exception e) { LOG.error("Caught exception while applying current state", e); + MetricRegistryManager.getInstance(config.getMetricsConfiguration()).incrementCounter( + null, + null, + UploaderMetrics.WATCHER_ZK_EXCEPTION_METRIC, + "cluster=" + environmentProvider.clusterId(), + "broker=" + environmentProvider.brokerId() + ); } }, config.getZkWatcherPollIntervalSeconds(), config.getZkWatcherPollIntervalSeconds(), java.util.concurrent.TimeUnit.SECONDS); }