Skip to content
This repository has been archived by the owner on Mar 15, 2021. It is now read-only.

Commit

Permalink
Iterate batch points for OpenTelemetry output (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
hexedpackets authored Feb 18, 2021
1 parent 431cbfb commit e62faa2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.spotify.ffwd.model.v2.Batch;
import com.spotify.ffwd.model.v2.Metric;
import com.spotify.ffwd.output.PluginSink;
import com.spotify.ffwd.util.BatchMetricConverter;
import eu.toolchain.async.AsyncFramework;
import eu.toolchain.async.AsyncFuture;
import io.grpc.ManagedChannel;
Expand Down Expand Up @@ -106,7 +107,10 @@ public void sendMetric(Metric metric) {

@Override
public void sendBatch(Batch batch) {
throw new RuntimeException("Batches are unsupported");
// TODO(hexedpackets): The batch point iteration is temporary.
// Multiple metrics can be more efficiently sent in a single protobuf
batch.getPoints().forEach(point ->
sendMetric(BatchMetricConverter.convertBatchMetric(batch, point)));
}

@Override
Expand Down

0 comments on commit e62faa2

Please sign in to comment.